From 86c30a0cfbf53d4c0c9c49e183362f8714dcff05 Mon Sep 17 00:00:00 2001 From: LemADEC Date: Fri, 13 Nov 2015 22:43:52 +0100 Subject: [PATCH] Fixed ship scanner texture names Code cleanup --- .../block/building/BlockShipScanner.java | 30 ++++++++---------- .../{shipScannerUp.png => shipScannerTop.png} | Bin 2 files changed, 14 insertions(+), 16 deletions(-) rename src/main/resources/assets/warpdrive/textures/blocks/building/{shipScannerUp.png => shipScannerTop.png} (100%) diff --git a/src/main/java/cr0s/warpdrive/block/building/BlockShipScanner.java b/src/main/java/cr0s/warpdrive/block/building/BlockShipScanner.java index 4d98d622..571f9e84 100644 --- a/src/main/java/cr0s/warpdrive/block/building/BlockShipScanner.java +++ b/src/main/java/cr0s/warpdrive/block/building/BlockShipScanner.java @@ -17,6 +17,9 @@ import cr0s.warpdrive.block.TileEntityAbstractEnergy; public class BlockShipScanner extends BlockContainer { private IIcon[] iconBuffer; + private final static int ICON_BOTTOM = 0; + private final static int ICON_TOP = 1; + private final static int ICON_SIDE = 2; public BlockShipScanner() { super(Material.rock); @@ -28,21 +31,22 @@ public class BlockShipScanner extends BlockContainer { @Override public void registerBlockIcons(IIconRegister par1IconRegister) { - iconBuffer = new IIcon[3]; - iconBuffer[0] = par1IconRegister.registerIcon("warpdrive:building/shipScannerUp"); - iconBuffer[1] = par1IconRegister.registerIcon("warpdrive:building/shipScannerSide"); - iconBuffer[2] = par1IconRegister.registerIcon("warpdrive:building/shipScannerBottom"); + iconBuffer = new IIcon[16]; + iconBuffer[ICON_BOTTOM] = par1IconRegister.registerIcon("warpdrive:building/shipScannerBottom"); + iconBuffer[ICON_TOP ] = par1IconRegister.registerIcon("warpdrive:building/shipScannerTop"); + iconBuffer[ICON_SIDE ] = par1IconRegister.registerIcon("warpdrive:building/shipScannerSide"); } @Override public IIcon getIcon(int side, int metadata) { - if (side == 1) { // UP - return iconBuffer[0]; - } else if (side == 0) { // DOWN - return iconBuffer[2]; + if (side == 0) { + return iconBuffer[ICON_BOTTOM]; + } + if (side == 1) { + return iconBuffer[ICON_TOP]; } - return iconBuffer[1]; + return iconBuffer[ICON_SIDE]; } @Override @@ -50,25 +54,19 @@ public class BlockShipScanner extends BlockContainer { return new TileEntityShipScanner(); } - /** - * 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 item 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 world, int x, int y, int z, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) { if (FMLCommonHandler.instance().getEffectiveSide().isClient()) { diff --git a/src/main/resources/assets/warpdrive/textures/blocks/building/shipScannerUp.png b/src/main/resources/assets/warpdrive/textures/blocks/building/shipScannerTop.png similarity index 100% rename from src/main/resources/assets/warpdrive/textures/blocks/building/shipScannerUp.png rename to src/main/resources/assets/warpdrive/textures/blocks/building/shipScannerTop.png