Finishing touches

i mean i think that's everything?
This commit is contained in:
Vaern 2023-05-17 07:47:32 -07:00
parent d871e46b9f
commit b68b83e2e2
3 changed files with 43 additions and 2 deletions

View File

@ -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(){

View File

@ -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() });

View File

@ -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