diff options
| author | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2015-02-21 21:31:16 +0000 |
|---|---|---|
| committer | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2015-02-21 21:31:16 +0000 |
| commit | 420faddca46e70e3a70def168fb4e452ef193b0d (patch) | |
| tree | 247e334012e4bf9e4fa6d42718bf601ce6bd42d9 /java/darkknight/jewelrycraft/block/BlockShadowHand.java | |
| parent | 3f4c717de5ebc9b942d65ae45ac87c43bdf8a31b (diff) | |
Added just a butt ton of stuff, also thanks to pau101 for helping me with the Hand Pedestal animation :)
Diffstat (limited to 'java/darkknight/jewelrycraft/block/BlockShadowHand.java')
| -rw-r--r-- | java/darkknight/jewelrycraft/block/BlockShadowHand.java | 74 |
1 files changed, 60 insertions, 14 deletions
diff --git a/java/darkknight/jewelrycraft/block/BlockShadowHand.java b/java/darkknight/jewelrycraft/block/BlockShadowHand.java index 2af6d02..45a260f 100644 --- a/java/darkknight/jewelrycraft/block/BlockShadowHand.java +++ b/java/darkknight/jewelrycraft/block/BlockShadowHand.java @@ -1,7 +1,5 @@ package darkknight.jewelrycraft.block; -import java.util.Random; - import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; @@ -17,44 +15,75 @@ import darkknight.jewelrycraft.tileentity.TileEntityShadowHand; public class BlockShadowHand extends BlockContainer { - Random rand = new Random(); - protected BlockShadowHand(Material par2Material) + /** + * @param material + */ + protected BlockShadowHand(Material material) { - super(par2Material); - this.setBlockBounds(0.2F, 0F, 0.2F, 0.8F, 1.0F, 0.8F); + super(material); + setBlockBounds(0.2F, 0F, 0.2F, 0.8F, 1.0F, 0.8F); } + /** + * @param world + * @param var2 + * @return + */ @Override public TileEntity createNewTileEntity(World world, int var2) { return new TileEntityShadowHand(); } + /** + * @return + */ @Override public boolean renderAsNormalBlock() { return false; } + /** + * @param iblockaccess + * @param i + * @param j + * @param k + * @param l + * @return + */ @Override public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) { return false; } + /** + * @return + */ @Override public boolean isOpaqueCube() { return false; } + /** + * @return + */ @Override public int getRenderType() { return -1; } + /** + * @param world + * @param x + * @param y + * @param z + * @param stack + */ public void dropItem(World world, double x, double y, double z, ItemStack stack) { EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 1.5D, z + 0.5D, stack); @@ -64,19 +93,33 @@ public class BlockShadowHand extends BlockContainer world.spawnEntityInWorld(entityitem); } + /** + * @param world + * @param i + * @param j + * @param k + * @param block + * @param par6 + */ + @Override public void breakBlock(World world, int i, int j, int k, Block block, int par6) { - TileEntityShadowHand te = (TileEntityShadowHand) world.getTileEntity(i, j, k); - - if (te != null && te.hasObject) - { - dropItem(te.getWorldObj(), (double) te.xCoord, (double) te.yCoord, (double) te.zCoord, te.object); + TileEntityShadowHand te = (TileEntityShadowHand)world.getTileEntity(i, j, k); + if (te != null && te.getHeldItemStack() != null){ + dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, te.getHeldItemStack()); world.removeTileEntity(i, j, k); } - super.breakBlock(world, i, j, k, block, par6); } + /** + * @param world + * @param i + * @param j + * @param k + * @param entityLiving + * @param par6ItemStack + */ @Override public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityLiving, ItemStack par6ItemStack) { @@ -84,9 +127,12 @@ public class BlockShadowHand extends BlockContainer world.setBlockMetadataWithNotify(i, j, k, rotation, 2); } + /** + * @param icon + */ @Override public void registerBlockIcons(IIconRegister icon) { - this.blockIcon = icon.registerIcon("minecraft:coal_block"); + blockIcon = icon.registerIcon("minecraft:coal_block"); } -} +}
\ No newline at end of file |
