diff --git a/src/main/java/com/hbm/blocks/machine/PistonInserter.java b/src/main/java/com/hbm/blocks/machine/PistonInserter.java index 8dd6114df..91e3e25b1 100644 --- a/src/main/java/com/hbm/blocks/machine/PistonInserter.java +++ b/src/main/java/com/hbm/blocks/machine/PistonInserter.java @@ -114,7 +114,46 @@ public class PistonInserter extends BlockContainerBase { return meta != side.ordinal() && meta != side.getOpposite().ordinal(); } - //TODO make item drop when block is broken + @Override + public void breakBlock(World world, int x, int y, int z, Block block, int meta) { + IInventory tileentityfurnace = (IInventory) world.getTileEntity(x, y, z); + + if(tileentityfurnace != null) { + + ItemStack itemstack = tileentityfurnace.getStackInSlot(0); + + if(itemstack != null) { + float f = world.rand.nextFloat() * 0.8F + 0.1F; + float f1 = world.rand.nextFloat() * 0.8F + 0.1F; + float f2 = world.rand.nextFloat() * 0.8F + 0.1F; + + while(itemstack.stackSize > 0) { + int j1 = world.rand.nextInt(21) + 10; + + if(j1 > itemstack.stackSize) { + j1 = itemstack.stackSize; + } + + itemstack.stackSize -= j1; + EntityItem entityitem = new EntityItem(world, x + f, y + f1, z + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); + + if(itemstack.hasTagCompound()) { + entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy()); + } + + float f3 = 0.05F; + entityitem.motionX = (float) world.rand.nextGaussian() * f3; + entityitem.motionY = (float) world.rand.nextGaussian() * f3 + 0.2F; + entityitem.motionZ = (float) world.rand.nextGaussian() * f3; + world.spawnEntityInWorld(entityitem); + } + } + + world.func_147453_f(x, y, z, block); + } + + super.breakBlock(world, x, y, z, block, meta); + } @Override public int getRenderType(){ diff --git a/src/main/java/com/hbm/main/CraftingManager.java b/src/main/java/com/hbm/main/CraftingManager.java index baadb5428..77f0c09fa 100644 --- a/src/main/java/com/hbm/main/CraftingManager.java +++ b/src/main/java/com/hbm/main/CraftingManager.java @@ -308,7 +308,8 @@ public class CraftingManager { addRecipeAuto(new ItemStack(ModBlocks.furnace_iron), new Object[] { "III", "IFI", "BBB", 'I', IRON.ingot(), 'F', Blocks.furnace, 'B', Blocks.stonebrick }); addRecipeAuto(new ItemStack(ModBlocks.machine_mixer), new Object[] { "PIP", "GCG", "PMP", 'P', STEEL.plate(), 'I', DURA.ingot(), 'G', KEY_ANYPANE, 'C', ModItems.circuit_copper, 'M', ModItems.motor }); addRecipeAuto(new ItemStack(ModBlocks.fan), new Object[] { "BPB", "PRP", "BPB", 'B', ModItems.bolt_tungsten, 'P', IRON.plate(), 'R', REDSTONE.dust() }); - + addRecipeAuto(new ItemStack(ModBlocks.piston_inserter), new Object[] { "ITI", "TPT", "ITI", 'P', DictFrame.fromOne(ModItems.part_generic, EnumPartType.PISTON_PNEUMATIC), 'I', IRON.plate(), 'T', ModItems.bolt_tungsten }); + addRecipeAuto(new ItemStack(ModBlocks.muffler, 1), new Object[] { "III", "IWI", "III", 'I', ModItems.plate_polymer, 'W', Blocks.wool }); addRecipeAuto(new ItemStack(Item.getItemFromBlock(ModBlocks.factory_titanium_hull), 8), new Object[] { "PIP", "I I", "PIP", 'P', TI.plate(), 'I', TI.ingot() }); diff --git a/src/main/resources/assets/hbm/lang/en_US.lang b/src/main/resources/assets/hbm/lang/en_US.lang index e2b518d48..5af3a39a9 100644 --- a/src/main/resources/assets/hbm/lang/en_US.lang +++ b/src/main/resources/assets/hbm/lang/en_US.lang @@ -4462,6 +4462,7 @@ tile.deco_beryllium.name=Beryllium Deco Block tile.deco_computer.ibm_300pl.name=IBM Personal Computer 300PL tile.deco_emitter.name=Deco Light Emitter tile.part_emitter.name=Deco Particle Emitter +tile.piston_inserter.name=Inserter tile.deco_lead.name=Lead Deco Block tile.deco_rbmk.name=RBMK Deco Block tile.deco_rbmk_smooth.name=Smooth RBMK Deco Block