Java 类net.minecraft.world.Explosion 实例源码

项目:Steam-and-Steel    文件:GlassFluidTank.java   
@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);

}
项目:DecompiledMinecraft    文件:EntityWitherSkull.java   
/**
 * 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;
}
项目:DecompiledMinecraft    文件:BlockTNT.java   
/**
 * 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);
    }
}
项目:DecompiledMinecraft    文件:EntityWitherSkull.java   
/**
 * 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;
}
项目:DecompiledMinecraft    文件:BlockTNT.java   
/**
 * 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);
    }
}
项目:DecompiledMinecraft    文件:NetHandlerPlayClient.java   
/**
 * 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();
}
项目:BaseClient    文件:EntityWitherSkull.java   
/**
 * 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;
}
项目:BaseClient    文件:BlockTNT.java   
/**
 * 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);
    }
}
项目:BaseClient    文件:NetHandlerPlayClient.java   
/**
 * 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();
}
项目:BaseClient    文件:EntityWitherSkull.java   
/**
 * 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;
}
项目:BaseClient    文件:BlockTNT.java   
/**
 * 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);
    }
}
项目:BaseClient    文件:NetHandlerPlayClient.java   
/**
 * 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();
}
项目:UniversalRemote    文件:WorldServerProxy.java   
@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);
    }
}
项目:UniversalRemote    文件:WorldServerProxy.java   
@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);
    }
}
项目:UniversalRemote    文件:EntityPlayerMPProxy.java   
@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));
    }
}
项目:UniversalRemote    文件:EntityPlayerMPProxy.java   
@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_));
    }
}
项目:UniversalRemote    文件:EntityPlayerProxy.java   
@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);
    }
}
项目:UniversalRemote    文件:EntityPlayerProxy.java   
@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_);
    }
}
项目:Solar    文件:Megumin.java   
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;
}
项目:Zombe-Modpack    文件:NetHandlerPlayClient.java   
/**
 * 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();
}
项目:Backmemed    文件:EntityWitherSkull.java   
/**
 * 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;
}
项目:Backmemed    文件:BlockTNT.java   
/**
 * 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);
    }
}
项目:Backmemed    文件:NetHandlerPlayClient.java   
/**
 * 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();
}
项目:CustomWorldGen    文件:ForgeEventFactory.java   
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));
}
项目:CustomWorldGen    文件:EntityWitherSkull.java   
/**
 * 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;
}
项目:CustomWorldGen    文件:BlockTNT.java   
/**
 * 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);
    }
}
项目:CustomWorldGen    文件:NetHandlerPlayClient.java   
/**
 * 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();
}
项目:rezolve    文件:EthernetCableBlock.java   
@Override
public void onBlockDestroyedByExplosion(World world, BlockPos pos, Explosion explosionIn) {
    this.onBlockDestroyed(world, pos);
    super.onBlockDestroyedByExplosion(world, pos, explosionIn);
}
项目:Bewitchment    文件:BlockCircleGlyph.java   
@Override
public float getExplosionResistance(World world, BlockPos pos, Entity exploder, Explosion explosion) {
    return 100;
}
项目:Got-Wood    文件:BlockDates.java   
@Override
public boolean canDropFromExplosion(Explosion explosionIn) {
    return false;
}
项目:Randores2    文件:RandoresItemHelper.java   
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);
}
项目:ExPetrum    文件:BlockOre.java   
@Override
public float getExplosionResistance(World world, BlockPos pos, Entity exploder, Explosion explosion)
{
    return world.getBlockState(pos).getValue(ROCK_CLASS).getResistance();
}
项目:DecompiledMinecraft    文件:EntityMinecartTNT.java   
/**
 * 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;
}
项目:DecompiledMinecraft    文件:EntityMinecartTNT.java   
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;
}
项目:DecompiledMinecraft    文件:Entity.java   
/**
 * 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);
}
项目:DecompiledMinecraft    文件:Entity.java   
public boolean verifyExplosion(Explosion explosionIn, World worldIn, BlockPos pos, IBlockState blockStateIn, float p_174816_5_)
{
    return true;
}
项目:DecompiledMinecraft    文件:EntityDragon.java   
/**
 * 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;
    }
}
项目:DecompiledMinecraft    文件:BlockTNT.java   
/**
 * Return whether this block can drop from an explosion.
 */
public boolean canDropFromExplosion(Explosion explosionIn)
{
    return false;
}
项目:DecompiledMinecraft    文件:BlockStairs.java   
/**
 * Called when this Block is destroyed by an Explosion
 */
public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn)
{
    this.modelBlock.onBlockDestroyedByExplosion(worldIn, pos, explosionIn);
}
项目:DecompiledMinecraft    文件:Block.java   
/**
 * Called when this Block is destroyed by an Explosion
 */
public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn)
{
}