diff options
Diffstat (limited to 'src/main/java/darkknight/jewelrycraft/block/BlockHandPedestal.java')
| -rwxr-xr-x | src/main/java/darkknight/jewelrycraft/block/BlockHandPedestal.java | 39 |
1 files changed, 12 insertions, 27 deletions
diff --git a/src/main/java/darkknight/jewelrycraft/block/BlockHandPedestal.java b/src/main/java/darkknight/jewelrycraft/block/BlockHandPedestal.java index 2cfe437..2cd8788 100755 --- a/src/main/java/darkknight/jewelrycraft/block/BlockHandPedestal.java +++ b/src/main/java/darkknight/jewelrycraft/block/BlockHandPedestal.java @@ -51,8 +51,7 @@ public class BlockHandPedestal extends BlockContainer { * @return
*/
@Override
- public boolean shouldSideBeRendered(IBlockAccess iblockaccess,
- int i, int j, int k, int l) {
+ public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l) {
return false;
}
@@ -85,24 +84,18 @@ public class BlockHandPedestal extends BlockContainer { * @return
*/
@Override
- public boolean onBlockActivated(World world, int i, int j, int k,
- EntityPlayer entityPlayer, int par6, float par7,
+ public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityPlayer, int par6, float par7,
float par8, float par9) {
- TileEntityHandPedestal te = (TileEntityHandPedestal) world
- .getTileEntity(i, j, k);
+ TileEntityHandPedestal te = (TileEntityHandPedestal) world.getTileEntity(i, j, k);
ItemStack item = entityPlayer.inventory.getCurrentItem();
if (te != null) {
- if (!world.isRemote
- && te.getHeldItemStack() == null
- && item != null) {
+ if (!world.isRemote && te.getHeldItemStack() == null && item != null) {
te.setHeldItemStack(item.copy());
if (!entityPlayer.capabilities.isCreativeMode)
item.stackSize--;
te.markDirty();
} else if (entityPlayer.isSneaking())
- if (entityPlayer.inventory
- .addItemStackToInventory(te
- .getHeldItemStack())) {
+ if (entityPlayer.inventory.addItemStackToInventory(te.getHeldItemStack())) {
te.removeHeldItemStack();
}
te.markDirty();
@@ -117,10 +110,8 @@ public class BlockHandPedestal extends BlockContainer { * @param z
* @param stack
*/
- public void dropItem(World world, double x, double y, double z,
- ItemStack stack) {
- EntityItem entityitem = new EntityItem(world, x + 0.5,
- y + 1.5, z + 0.5, stack);
+ public void dropItem(World world, double x, double y, double z, ItemStack stack) {
+ EntityItem entityitem = new EntityItem(world, x + 0.5, y + 1.5, z + 0.5, stack);
entityitem.motionX = 0;
entityitem.motionZ = 0;
entityitem.motionY = 0.11000000298023224D;
@@ -136,13 +127,10 @@ public class BlockHandPedestal extends BlockContainer { * @param par6
*/
@Override
- public void breakBlock(World world, int i, int j, int k,
- Block block, int par6) {
- TileEntityHandPedestal te = (TileEntityHandPedestal) world
- .getTileEntity(i, j, k);
+ public void breakBlock(World world, int i, int j, int k, Block block, int par6) {
+ TileEntityHandPedestal te = (TileEntityHandPedestal) world.getTileEntity(i, j, k);
if (te != null && te.getHeldItemStack() != null) {
- dropItem(te.getWorldObj(), te.xCoord, te.yCoord,
- te.zCoord, te.getHeldItemStack());
+ dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, te.getHeldItemStack());
world.removeTileEntity(i, j, k);
}
super.breakBlock(world, i, j, k, block, par6);
@@ -157,12 +145,9 @@ public class BlockHandPedestal extends BlockContainer { * @param par6ItemStack
*/
@Override
- public void onBlockPlacedBy(World world, int i, int j, int k,
- EntityLivingBase entityLiving,
+ public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityLiving,
ItemStack par6ItemStack) {
- int rotation = MathHelper.floor_double(
- entityLiving.rotationYaw * 8 / 360 + 0.5)
- & 7;
+ int rotation = MathHelper.floor_double(entityLiving.rotationYaw * 8 / 360 + 0.5) & 7;
world.setBlockMetadataWithNotify(i, j, k, rotation, 2);
}
|
