From 20bef6e26d948698398bd16aeab8c9e6b89110e4 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Thu, 22 Aug 2019 20:01:40 -0400 Subject: Format/import cleanup --- .../darkknight/jewelrycraft/block/BlockMolder.java | 109 +++++++-------------- 1 file changed, 33 insertions(+), 76 deletions(-) (limited to 'src/main/java/darkknight/jewelrycraft/block/BlockMolder.java') diff --git a/src/main/java/darkknight/jewelrycraft/block/BlockMolder.java b/src/main/java/darkknight/jewelrycraft/block/BlockMolder.java index 4f763ad..7f2bec4 100755 --- a/src/main/java/darkknight/jewelrycraft/block/BlockMolder.java +++ b/src/main/java/darkknight/jewelrycraft/block/BlockMolder.java @@ -41,49 +41,34 @@ public class BlockMolder extends BlockContainer { } @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) { - TileEntityMolder te = (TileEntityMolder) world - .getTileEntity(i, j, k); + TileEntityMolder te = (TileEntityMolder) world.getTileEntity(i, j, k); ItemStack item = entityPlayer.inventory.getCurrentItem(); if (te != null && !world.isRemote) { - if (item != null && !te.hasMold && item - .getItem() == ItemList.molds) { + if (item != null && !te.hasMold && item.getItem() == ItemList.molds) { te.mold = item.copy(); te.hasMold = true; if (!entityPlayer.capabilities.isCreativeMode) --item.stackSize; - entityPlayer.addChatMessage( - new ChatComponentText( - StatCollector.translateToLocalFormatted( - "chatmessage." + Variables.MODID - + ".molder.addedmold", - te.mold.getDisplayName()))); + entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocalFormatted( + "chatmessage." + Variables.MODID + ".molder.addedmold", te.mold.getDisplayName()))); te.isDirty = true; } - if (te.hasMold && entityPlayer.isSneaking() - && !te.hasMoltenMetal) { - dropItem(world, te.xCoord, te.yCoord, - te.zCoord, te.mold.copy()); - te.mold = new ItemStack( - Item.getItemById(0), 0, 0); + if (te.hasMold && entityPlayer.isSneaking() && !te.hasMoltenMetal) { + dropItem(world, te.xCoord, te.yCoord, te.zCoord, te.mold.copy()); + te.mold = new ItemStack(Item.getItemById(0), 0, 0); te.hasMold = false; te.isDirty = true; } else if (te.hasMoltenMetal) - entityPlayer.addChatMessage( - new ChatComponentText( - StatCollector.translateToLocal( - "chatmessage." + Variables.MODID - + ".molder.hasmoltenmetal"))); + entityPlayer.addChatMessage(new ChatComponentText( + StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".molder.hasmoltenmetal"))); } return true; } - public void dropItem(World world, double x, double y, double z, - ItemStack stack) { - EntityItem entityitem = new EntityItem(world, x + 0.5D, - y + 0.5D, z + 0.5D, stack); + public void dropItem(World world, double x, double y, double z, ItemStack stack) { + EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack); entityitem.motionX = 0; entityitem.motionZ = 0; entityitem.motionY = 0.11000000298023224D; @@ -91,79 +76,51 @@ public class BlockMolder extends BlockContainer { } @Override - public void breakBlock(World world, int i, int j, int k, - Block par5, int par6) { - TileEntityMolder te = (TileEntityMolder) world - .getTileEntity(i, j, k); + public void breakBlock(World world, int i, int j, int k, Block par5, int par6) { + TileEntityMolder te = (TileEntityMolder) world.getTileEntity(i, j, k); if (te != null) { if (te.hasJewelBase) - dropItem(te.getWorldObj(), te.xCoord, - te.yCoord, te.zCoord, - te.jewelBase.copy()); + dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, te.jewelBase.copy()); if (te.hasMold) - dropItem(world, te.xCoord, te.yCoord, - te.zCoord, te.mold.copy()); + dropItem(world, te.xCoord, te.yCoord, te.zCoord, te.mold.copy()); world.removeTileEntity(i, j, k); } super.breakBlock(world, i, j, k, par5, par6); } @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 - * 4.0F / 360.0F + 0.5D) - & 3; + int rotation = MathHelper.floor_double(entityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; world.setBlockMetadataWithNotify(i, j, k, rotation, 2); } @Override - public void onBlockClicked(World world, int i, int j, int k, - EntityPlayer player) { - TileEntityMolder me = (TileEntityMolder) world - .getTileEntity(i, j, k); + public void onBlockClicked(World world, int i, int j, int k, EntityPlayer player) { + TileEntityMolder me = (TileEntityMolder) world.getTileEntity(i, j, k); if (me != null && !world.isRemote) { if (me.hasJewelBase) { - dropItem(me.getWorldObj(), me.xCoord, - me.yCoord, me.zCoord, - me.jewelBase.copy()); - me.jewelBase = new ItemStack( - Item.getItemById(0), 0, 0); + dropItem(me.getWorldObj(), me.xCoord, me.yCoord, me.zCoord, me.jewelBase.copy()); + me.jewelBase = new ItemStack(Item.getItemById(0), 0, 0); me.hasJewelBase = false; } else if (me.hasMoltenMetal && me.cooling >= 0) - player.addChatMessage( - new ChatComponentText( - StatCollector.translateToLocal( - "chatmessage." + Variables.MODID - + ".molder.metaliscooling") - + " (" - + (ConfigHandler.INGOT_COOLING_TIME - - me.cooling) - * 100 - / ConfigHandler.INGOT_COOLING_TIME - + "%)")); - else if (me.mold.getItem() == ItemList.molds - && !me.hasMoltenMetal) - player.addChatMessage( - new ChatComponentText( - StatCollector.translateToLocal( - "chatmessage." + Variables.MODID - + ".molder.moldisempty"))); + player.addChatMessage(new ChatComponentText( + StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".molder.metaliscooling") + + " (" + (ConfigHandler.INGOT_COOLING_TIME - me.cooling) * 100 + / ConfigHandler.INGOT_COOLING_TIME + + "%)")); + else if (me.mold.getItem() == ItemList.molds && !me.hasMoltenMetal) + player.addChatMessage(new ChatComponentText( + StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".molder.moldisempty"))); else if (me.mold.getItem() != ItemList.molds) - player.addChatMessage( - new ChatComponentText( - StatCollector.translateToLocal( - "chatmessage." + Variables.MODID - + ".molder.moldismissing"))); + player.addChatMessage(new ChatComponentText( + StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".molder.moldismissing"))); me.isDirty = true; } } @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; } -- cgit v1.2.3