@Override public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) { Utils.dropStackInWorld(world, x, y, z, Utils.getTankStackFromTile((TileGlassFluidTank) world.getTileEntity(x, y, z), true)); world.setBlockToAir(x, y, z); onBlockDestroyedByExplosion(world, x, y, z, explosion); }
/** * Explosion resistance of a block relative to this entity */ public float getExplosionResistance(Explosion explosionIn, World worldIn, BlockPos pos, IBlockState blockStateIn) { float f = super.getExplosionResistance(explosionIn, worldIn, pos, blockStateIn); Block block = blockStateIn.getBlock(); if (this.isInvulnerable() && EntityWither.func_181033_a(block)) { f = Math.min(0.8F, f); } return f; }
/** * Called when this Block is destroyed by an Explosion */ public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn) { if (!worldIn.isRemote) { EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(worldIn, (double)((float)pos.getX() + 0.5F), (double)pos.getY(), (double)((float)pos.getZ() + 0.5F), explosionIn.getExplosivePlacedBy()); entitytntprimed.fuse = worldIn.rand.nextInt(entitytntprimed.fuse / 4) + entitytntprimed.fuse / 8; worldIn.spawnEntityInWorld(entitytntprimed); } }
/** * Initiates a new explosion (sound, particles, drop spawn) for the affected blocks indicated by the packet. */ public void handleExplosion(S27PacketExplosion packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); Explosion explosion = new Explosion(this.gameController.theWorld, (Entity)null, packetIn.getX(), packetIn.getY(), packetIn.getZ(), packetIn.getStrength(), packetIn.getAffectedBlockPositions()); explosion.doExplosionB(true); this.gameController.thePlayer.motionX += (double)packetIn.func_149149_c(); this.gameController.thePlayer.motionY += (double)packetIn.func_149144_d(); this.gameController.thePlayer.motionZ += (double)packetIn.func_149147_e(); }
/** * Initiates a new explosion (sound, particles, drop spawn) for the affected * blocks indicated by the packet. */ public void handleExplosion(S27PacketExplosion packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); Explosion explosion = new Explosion(this.gameController.theWorld, (Entity) null, packetIn.getX(), packetIn.getY(), packetIn.getZ(), packetIn.getStrength(), packetIn.getAffectedBlockPositions()); explosion.doExplosionB(true); this.gameController.thePlayer.motionX += (double) packetIn.func_149149_c(); this.gameController.thePlayer.motionY += (double) packetIn.func_149144_d(); this.gameController.thePlayer.motionZ += (double) packetIn.func_149147_e(); }
@Override public Explosion createExplosion(Entity entityIn, double x, double y, double z, float strength, boolean isSmoking) { if (m_proxyWorld != null && Util.isPrefixInCallStack(m_modPrefix)) { return m_proxyWorld.createExplosion(entityIn, x, y, z, strength, isSmoking); } else if (m_realWorld != null) { return m_realWorld.createExplosion(entityIn, x, y, z, strength, isSmoking); } else { return super.createExplosion(entityIn, x, y, z, strength, isSmoking); } }
@Override public Explosion newExplosion(Entity entityIn, double x, double y, double z, float strength, boolean isFlaming, boolean isSmoking) { if (m_proxyWorld != null && Util.isPrefixInCallStack(m_modPrefix)) { return m_proxyWorld.newExplosion(entityIn, x, y, z, strength, isFlaming, isSmoking); } else if (m_realWorld != null) { return m_realWorld.newExplosion(entityIn, x, y, z, strength, isFlaming, isSmoking); } else { return super.newExplosion(entityIn, x, y, z, strength, isFlaming, isSmoking); } }
@Override public float getExplosionResistance(Explosion explosionIn, World worldIn, BlockPos pos, IBlockState blockStateIn) { if (m_realPlayer == null) { return super.getExplosionResistance(explosionIn, worldIn, pos, blockStateIn); } else { syncToRealPlayer(); return syncPublicFieldsFromRealAndReturn(m_realPlayer.getExplosionResistance(explosionIn, worldIn, pos, blockStateIn)); } }
@Override public boolean canExplosionDestroyBlock(Explosion explosionIn, World worldIn, BlockPos pos, IBlockState blockStateIn, float p_174816_5_) { if (m_realPlayer == null) { return super.canExplosionDestroyBlock(explosionIn, worldIn, pos, blockStateIn, p_174816_5_); } else { syncToRealPlayer(); return syncPublicFieldsFromRealAndReturn(m_realPlayer.canExplosionDestroyBlock(explosionIn, worldIn, pos, blockStateIn, p_174816_5_)); } }
@Override public float getExplosionResistance(Explosion explosionIn, World worldIn, BlockPos pos, IBlockState blockStateIn) { if (m_realPlayer == null) { return super.getExplosionResistance(explosionIn, worldIn, pos, blockStateIn); } else { return m_realPlayer.getExplosionResistance(explosionIn, worldIn, pos, blockStateIn); } }
@Override public boolean canExplosionDestroyBlock(Explosion explosionIn, World worldIn, BlockPos pos, IBlockState blockStateIn, float p_174816_5_) { if (m_realPlayer == null) { return super.canExplosionDestroyBlock(explosionIn, worldIn, pos, blockStateIn, p_174816_5_); } else { return m_realPlayer.canExplosionDestroyBlock(explosionIn, worldIn, pos, blockStateIn, p_174816_5_); } }
private Megumin(World world, Vector3 pos, float size, boolean damageEntities) { dummy = new Explosion(world, null, pos.x, pos.y, pos.z, size, false, false); this.world = world; this.pos = pos; this.size = size; this.damageEntities = damageEntities; }
/** * Initiates a new explosion (sound, particles, drop spawn) for the affected blocks indicated by the packet. */ public void handleExplosion(SPacketExplosion packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); Explosion explosion = new Explosion(this.gameController.world, (Entity)null, packetIn.getX(), packetIn.getY(), packetIn.getZ(), packetIn.getStrength(), packetIn.getAffectedBlockPositions()); explosion.doExplosionB(true); this.gameController.player.motionX += (double)packetIn.getMotionX(); this.gameController.player.motionY += (double)packetIn.getMotionY(); this.gameController.player.motionZ += (double)packetIn.getMotionZ(); }
/** * Explosion resistance of a block relative to this entity */ public float getExplosionResistance(Explosion explosionIn, World worldIn, BlockPos pos, IBlockState blockStateIn) { float f = super.getExplosionResistance(explosionIn, worldIn, pos, blockStateIn); Block block = blockStateIn.getBlock(); if (this.isInvulnerable() && EntityWither.canDestroyBlock(block)) { f = Math.min(0.8F, f); } return f; }
/** * Called when this Block is destroyed by an Explosion */ public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn) { if (!worldIn.isRemote) { EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(worldIn, (double)((float)pos.getX() + 0.5F), (double)pos.getY(), (double)((float)pos.getZ() + 0.5F), explosionIn.getExplosivePlacedBy()); entitytntprimed.setFuse((short)(worldIn.rand.nextInt(entitytntprimed.getFuse() / 4) + entitytntprimed.getFuse() / 8)); worldIn.spawnEntityInWorld(entitytntprimed); } }
/** * Initiates a new explosion (sound, particles, drop spawn) for the affected blocks indicated by the packet. */ public void handleExplosion(SPacketExplosion packetIn) { if(Hacks.findMod(AntiVelocity.class).isEnabled()) return; PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); Explosion explosion = new Explosion(this.gameController.world, (Entity)null, packetIn.getX(), packetIn.getY(), packetIn.getZ(), packetIn.getStrength(), packetIn.getAffectedBlockPositions()); explosion.doExplosionB(true); this.gameController.player.motionX += (double)packetIn.getMotionX(); this.gameController.player.motionY += (double)packetIn.getMotionY(); this.gameController.player.motionZ += (double)packetIn.getMotionZ(); }
public static void onExplosionDetonate(World world, Explosion explosion, List<Entity> list, double diameter) { //Filter entities to only those who are effected, to prevent modders from seeing more then will be hurt. /* Enable this if we get issues with modders looping to much. Iterator<Entity> itr = list.iterator(); Vec3 p = explosion.getPosition(); while (itr.hasNext()) { Entity e = itr.next(); double dist = e.getDistance(p.xCoord, p.yCoord, p.zCoord) / diameter; if (e.isImmuneToExplosions() || dist > 1.0F) itr.remove(); } */ MinecraftForge.EVENT_BUS.post(new ExplosionEvent.Detonate(world, explosion, list)); }
/** * Explosion resistance of a block relative to this entity */ public float getExplosionResistance(Explosion explosionIn, World worldIn, BlockPos pos, IBlockState blockStateIn) { float f = super.getExplosionResistance(explosionIn, worldIn, pos, blockStateIn); Block block = blockStateIn.getBlock(); if (this.isInvulnerable() && block.canEntityDestroy(blockStateIn, worldIn, pos, this)) { f = Math.min(0.8F, f); } return f; }
/** * Initiates a new explosion (sound, particles, drop spawn) for the affected blocks indicated by the packet. */ public void handleExplosion(SPacketExplosion packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); Explosion explosion = new Explosion(this.gameController.theWorld, (Entity)null, packetIn.getX(), packetIn.getY(), packetIn.getZ(), packetIn.getStrength(), packetIn.getAffectedBlockPositions()); explosion.doExplosionB(true); this.gameController.thePlayer.motionX += (double)packetIn.getMotionX(); this.gameController.thePlayer.motionY += (double)packetIn.getMotionY(); this.gameController.thePlayer.motionZ += (double)packetIn.getMotionZ(); }
@Override public void onBlockDestroyedByExplosion(World world, BlockPos pos, Explosion explosionIn) { this.onBlockDestroyed(world, pos); super.onBlockDestroyedByExplosion(world, pos, explosionIn); }
@Override public float getExplosionResistance(World world, BlockPos pos, Entity exploder, Explosion explosion) { return 100; }
@Override public boolean canDropFromExplosion(Explosion explosionIn) { return false; }
public static float getOreExplosionResistanceImpl(Block self, World world, BlockPos pos, @Nullable Entity exploder, Explosion explosion) { return RandoresItemHelper.delegate(world, pos, def -> def.getOre().getHardness(), () -> 0f); }
@Override public float getExplosionResistance(World world, BlockPos pos, Entity exploder, Explosion explosion) { return world.getBlockState(pos).getValue(ROCK_CLASS).getResistance(); }
/** * Explosion resistance of a block relative to this entity */ public float getExplosionResistance(Explosion explosionIn, World worldIn, BlockPos pos, IBlockState blockStateIn) { return !this.isIgnited() || !BlockRailBase.isRailBlock(blockStateIn) && !BlockRailBase.isRailBlock(worldIn, pos.up()) ? super.getExplosionResistance(explosionIn, worldIn, pos, blockStateIn) : 0.0F; }
public boolean verifyExplosion(Explosion explosionIn, World worldIn, BlockPos pos, IBlockState blockStateIn, float p_174816_5_) { return !this.isIgnited() || !BlockRailBase.isRailBlock(blockStateIn) && !BlockRailBase.isRailBlock(worldIn, pos.up()) ? super.verifyExplosion(explosionIn, worldIn, pos, blockStateIn, p_174816_5_) : false; }
/** * Explosion resistance of a block relative to this entity */ public float getExplosionResistance(Explosion explosionIn, World worldIn, BlockPos pos, IBlockState blockStateIn) { return blockStateIn.getBlock().getExplosionResistance(this); }
public boolean verifyExplosion(Explosion explosionIn, World worldIn, BlockPos pos, IBlockState blockStateIn, float p_174816_5_) { return true; }
/** * Updates the state of the enderdragon's current endercrystal. */ private void updateDragonEnderCrystal() { if (this.healingEnderCrystal != null) { if (this.healingEnderCrystal.isDead) { if (!this.worldObj.isRemote) { this.attackEntityFromPart(this.dragonPartHead, DamageSource.setExplosionSource((Explosion)null), 10.0F); } this.healingEnderCrystal = null; } else if (this.ticksExisted % 10 == 0 && this.getHealth() < this.getMaxHealth()) { this.setHealth(this.getHealth() + 1.0F); } } if (this.rand.nextInt(10) == 0) { float f = 32.0F; List<EntityEnderCrystal> list = this.worldObj.<EntityEnderCrystal>getEntitiesWithinAABB(EntityEnderCrystal.class, this.getEntityBoundingBox().expand((double)f, (double)f, (double)f)); EntityEnderCrystal entityendercrystal = null; double d0 = Double.MAX_VALUE; for (EntityEnderCrystal entityendercrystal1 : list) { double d1 = entityendercrystal1.getDistanceSqToEntity(this); if (d1 < d0) { d0 = d1; entityendercrystal = entityendercrystal1; } } this.healingEnderCrystal = entityendercrystal; } }
/** * Return whether this block can drop from an explosion. */ public boolean canDropFromExplosion(Explosion explosionIn) { return false; }
/** * Called when this Block is destroyed by an Explosion */ public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn) { this.modelBlock.onBlockDestroyedByExplosion(worldIn, pos, explosionIn); }
/** * Called when this Block is destroyed by an Explosion */ public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn) { }