From 7de3ab043912ac17d70d10a55c9ea19e8cc7216b Mon Sep 17 00:00:00 2001 From: LemADEC Date: Fri, 13 Nov 2015 21:37:32 +0100 Subject: [PATCH] Code cleanup --- .../block/movement/BlockShipController.java | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/src/main/java/cr0s/warpdrive/block/movement/BlockShipController.java b/src/main/java/cr0s/warpdrive/block/movement/BlockShipController.java index f9f662ed..c34bcf2d 100644 --- a/src/main/java/cr0s/warpdrive/block/movement/BlockShipController.java +++ b/src/main/java/cr0s/warpdrive/block/movement/BlockShipController.java @@ -18,9 +18,12 @@ import cr0s.warpdrive.WarpDrive; public class BlockShipController extends BlockContainer { private IIcon[] iconBuffer; - - private final int ICON_INACTIVE_SIDE = 0, ICON_BOTTOM = 1, ICON_TOP = 2, ICON_SIDE_ACTIVATED = 3; - + + private final int ICON_INACTIVE_SIDE = 0; + private final int ICON_BOTTOM = 1; + private final int ICON_TOP = 2; + private final int ICON_SIDE_ACTIVATED = 3; + public BlockShipController() { super(Material.rock); setHardness(0.5F); @@ -28,7 +31,7 @@ public class BlockShipController extends BlockContainer { setCreativeTab(WarpDrive.creativeTabWarpDrive); setBlockName("warpdrive.movement.ShipController"); } - + @Override @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister par1IconRegister) { @@ -46,7 +49,7 @@ public class BlockShipController extends BlockContainer { iconBuffer[ICON_SIDE_ACTIVATED + 5] = par1IconRegister.registerIcon("warpdrive:movement/shipControllerSideActive5"); iconBuffer[ICON_SIDE_ACTIVATED + 6] = par1IconRegister.registerIcon("warpdrive:movement/shipControllerSideActive6"); } - + @Override public IIcon getIcon(int side, int metadata) { if (side == 0) { @@ -54,7 +57,7 @@ public class BlockShipController extends BlockContainer { } else if (side == 1) { return iconBuffer[ICON_TOP]; } - + if (metadata == 0) { // Inactive state return iconBuffer[ICON_INACTIVE_SIDE]; } else if (metadata > 0) { // Activated, in metadata stored mode number @@ -64,39 +67,34 @@ public class BlockShipController extends BlockContainer { return null; } } - + return null; } - + @Override public TileEntity createNewTileEntity(World var1, int i) { return new TileEntityShipController(); } - - /** - * Returns the quantity of items to drop on block destruction. - */ + @Override public int quantityDropped(Random par1Random) { return 1; } - + /** - * Returns the ID of the items to drop on destruction. + * Returns the items to drop on destruction. */ @Override public Item getItemDropped(int par1, Random par2Random, int par3) { return Item.getItemFromBlock(this); } - /** - * Called upon block activation (right click on the block.) - */ + @Override public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { if (FMLCommonHandler.instance().getEffectiveSide().isClient()) { return false; } - + if (par5EntityPlayer.getHeldItem() == null) { TileEntityShipController controller = (TileEntityShipController)par1World.getTileEntity(par2, par3, par4); if (controller != null) { @@ -105,7 +103,7 @@ public class BlockShipController extends BlockContainer { return true; } } - + return false; } } \ No newline at end of file