diff --git a/mechanical/src/main/java/resonantinduction/mechanical/energy/turbine/BlockMechanicalTurbine.java b/mechanical/src/main/java/resonantinduction/mechanical/energy/turbine/BlockMechanicalTurbine.java index 7b3899cf5..b4a96b019 100644 --- a/mechanical/src/main/java/resonantinduction/mechanical/energy/turbine/BlockMechanicalTurbine.java +++ b/mechanical/src/main/java/resonantinduction/mechanical/energy/turbine/BlockMechanicalTurbine.java @@ -1,5 +1,7 @@ package resonantinduction.mechanical.energy.turbine; +import java.util.ArrayList; + import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -19,6 +21,35 @@ public class BlockMechanicalTurbine extends BlockTurbine rotationMask = Byte.parseByte("111111", 2); } + @Override + public int getDamageValue(World world, int x, int y, int z) + { + TileEntity tile = world.getBlockTileEntity(x, y, z); + System.out.println(world.isRemote + " : " + tile); + if (tile instanceof TileTurbine) + return ((TileTurbine) tile).tier; + + return 0; + } + + /** + * Temporarily "cheat" var for dropping with damage. + */ + int dropDamage = 0; + + @Override + public int damageDropped(int par1) + { + return dropDamage; + } + + @Override + public void breakBlock(World world, int x, int y, int z, int par5, int par6) + { + dropDamage = getDamageValue(world, x, y, z); + super.breakBlock(world, x, y, z, par5, par6); + } + @Override public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityLiving, ItemStack itemStack) { diff --git a/mechanical/src/main/java/resonantinduction/mechanical/energy/turbine/BlockWaterTurbine.java b/mechanical/src/main/java/resonantinduction/mechanical/energy/turbine/BlockWaterTurbine.java index 38ed13fd3..c0a5c1c31 100644 --- a/mechanical/src/main/java/resonantinduction/mechanical/energy/turbine/BlockWaterTurbine.java +++ b/mechanical/src/main/java/resonantinduction/mechanical/energy/turbine/BlockWaterTurbine.java @@ -2,6 +2,7 @@ package resonantinduction.mechanical.energy.turbine; import java.util.List; +import calclavia.lib.prefab.turbine.TileTurbine; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity;