Fixed ship scanner texture names

Code cleanup
This commit is contained in:
LemADEC 2015-11-13 22:43:52 +01:00
parent 2f335a0c84
commit 86c30a0cfb
2 changed files with 14 additions and 16 deletions

View file

@ -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()) {