Search in sources :

Example 1 with Explosion

use of net.minecraft.world.Explosion in project LogisticsPipes by RS485.

the class PipeMultiBlockTransportLogistics method handleTileReachedServer.

@Override
protected void handleTileReachedServer(LPTravelingItemServer arrivingItem, TileEntity tile, ForgeDirection dir) {
    markChunkModified(tile);
    if (tile instanceof LogisticsTileGenericPipe && ((LogisticsTileGenericPipe) tile).pipe instanceof CoreMultiBlockPipe) {
        passToNextPipe(arrivingItem, tile);
        return;
    } else if (tile instanceof LogisticsTileGenericSubMultiBlock) {
        List<LogisticsTileGenericPipe> masterTile = ((LogisticsTileGenericSubMultiBlock) tile).getMainPipe();
        if (!masterTile.isEmpty()) {
            if (masterTile.size() > 1) {
                throw new UnsupportedOperationException();
            }
            passToNextPipe(arrivingItem, masterTile.get(0));
            return;
        }
    }
    Explosion explosion = new Explosion(this.getWorld(), null, this.getPipe().getX(), this.getPipe().getY(), this.getPipe().getZ(), 4.0F);
    explosion.isFlaming = false;
    explosion.isSmoking = true;
    explosion.doExplosionB(true);
}
Also used : Explosion(net.minecraft.world.Explosion) CoreMultiBlockPipe(logisticspipes.pipes.basic.CoreMultiBlockPipe) LogisticsTileGenericSubMultiBlock(logisticspipes.pipes.basic.LogisticsTileGenericSubMultiBlock) LogisticsTileGenericPipe(logisticspipes.pipes.basic.LogisticsTileGenericPipe) List(java.util.List)

Example 2 with Explosion

use of net.minecraft.world.Explosion in project ImmersiveEngineering by BluSunrize.

the class EntityIEExplosive method onUpdate.

@Override
public void onUpdate() {
    if (worldObj.isRemote && this.block == null)
        this.getBlockSynced();
    this.prevPosX = this.posX;
    this.prevPosY = this.posY;
    this.prevPosZ = this.posZ;
    this.motionY -= 0.03999999910593033D;
    this.moveEntity(this.motionX, this.motionY, this.motionZ);
    this.motionX *= 0.9800000190734863D;
    this.motionY *= 0.9800000190734863D;
    this.motionZ *= 0.9800000190734863D;
    if (this.onGround) {
        this.motionX *= 0.699999988079071D;
        this.motionZ *= 0.699999988079071D;
        this.motionY *= -0.5D;
    }
    int newFuse = this.getFuse() - 1;
    this.setFuse(newFuse);
    if (newFuse-- <= 0) {
        this.setDead();
        if (!this.worldObj.isRemote) {
            Explosion explosion = new IEExplosion(worldObj, this, posX, posY + (height / 16f), posZ, explosionPower, explosionFire, explosionSmoke).setDropChance(explosionDropChance);
            if (!ForgeEventFactory.onExplosionStart(worldObj, explosion)) {
                explosion.doExplosionA();
                explosion.doExplosionB(true);
            }
        }
    } else {
        this.handleWaterMovement();
        this.worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D);
    }
}
Also used : IEExplosion(blusunrize.immersiveengineering.common.util.IEExplosion) Explosion(net.minecraft.world.Explosion) IEExplosion(blusunrize.immersiveengineering.common.util.IEExplosion)

Example 3 with Explosion

use of net.minecraft.world.Explosion in project Engine by VoltzEngine-Project.

the class AbstractTileTest method testOnDestroyedByExplosion.

@Test
public void testOnDestroyedByExplosion() {
    FakeWorld world = FakeWorld.newWorld("TestOnDestroyedByExplosion");
    world.setBlock(0, 0, 0, block);
    ((Tile) world.getTileEntity(0, 0, 0)).onDestroyedByExplosion(new Explosion(world, null, 0, 0, 0, 10));
}
Also used : Explosion(net.minecraft.world.Explosion) FakeWorld(com.builtbroken.mc.testing.junit.world.FakeWorld) PacketTile(com.builtbroken.mc.core.network.packet.PacketTile) BlockTile(com.builtbroken.mc.prefab.tile.BlockTile) Tile(com.builtbroken.mc.prefab.tile.Tile) Test(org.junit.Test)

Example 4 with Explosion

use of net.minecraft.world.Explosion in project SecurityCraft by Geforce132.

the class BlockMine method newExplosion.

/**
	 * returns a new explosion. Does initiation (at time of writing Explosion is not finished)
	 */
public Explosion newExplosion(Entity par1Entity, double par2, double par4, double par6, float par8, boolean par9, boolean par10, World par11World) {
    Explosion explosion = new Explosion(par11World, par1Entity, par2, par4, par6, par8);
    if (mod_SecurityCraft.configHandler.shouldSpawnFire) {
        explosion.isFlaming = true;
    } else {
        explosion.isFlaming = false;
    }
    explosion.isSmoking = par10;
    explosion.doExplosionA();
    explosion.doExplosionB(true);
    return explosion;
}
Also used : Explosion(net.minecraft.world.Explosion)

Example 5 with Explosion

use of net.minecraft.world.Explosion in project SecurityCraft by Geforce132.

the class BlockMine method newExplosion.

/**
     * returns a new explosion. Does initiation (at time of writing Explosion is not finished)
     */
public Explosion newExplosion(Entity par1Entity, double par2, double par4, double par6, float par8, boolean par9, boolean par10, World par11World) {
    Explosion explosion = new Explosion(par11World, par1Entity, par2, par4, par6, par8);
    if (mod_SecurityCraft.configHandler.shouldSpawnFire) {
        explosion.isFlaming = true;
    } else {
        explosion.isFlaming = false;
    }
    explosion.isSmoking = par10;
    explosion.doExplosionA();
    explosion.doExplosionB(true);
    return explosion;
}
Also used : Explosion(net.minecraft.world.Explosion)

Aggregations

Explosion (net.minecraft.world.Explosion)9 List (java.util.List)2 CoreMultiBlockPipe (logisticspipes.pipes.basic.CoreMultiBlockPipe)2 LogisticsTileGenericPipe (logisticspipes.pipes.basic.LogisticsTileGenericPipe)2 LogisticsTileGenericSubMultiBlock (logisticspipes.pipes.basic.LogisticsTileGenericSubMultiBlock)2 Vector (ValkyrienWarfareBase.API.Vector)1 PhysicsQueuedForce (ValkyrienWarfareBase.Physics.PhysicsQueuedForce)1 PhysicsWrapperEntity (ValkyrienWarfareBase.PhysicsManagement.PhysicsWrapperEntity)1 IEExplosion (blusunrize.immersiveengineering.common.util.IEExplosion)1 PacketTile (com.builtbroken.mc.core.network.packet.PacketTile)1 BlockTile (com.builtbroken.mc.prefab.tile.BlockTile)1 Tile (com.builtbroken.mc.prefab.tile.Tile)1 FakeWorld (com.builtbroken.mc.testing.junit.world.FakeWorld)1 Block (net.minecraft.block.Block)1 BlockLiquid (net.minecraft.block.BlockLiquid)1 IBlockState (net.minecraft.block.state.IBlockState)1 EntityCreeper (net.minecraft.entity.monster.EntityCreeper)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 ChatComponentText (net.minecraft.util.ChatComponentText)1 AxisAlignedBB (net.minecraft.util.math.AxisAlignedBB)1