Fixed last PR and removed unneeded Textures

This commit is contained in:
CovertJaguar 2013-04-29 12:11:25 -07:00
parent 437a870ab0
commit 62f374e40d
2 changed files with 42 additions and 55 deletions

View file

@ -20,7 +20,7 @@ import cpw.mods.fml.relauncher.SideOnly;
public class BlockHopper extends BlockBuildCraft { public class BlockHopper extends BlockBuildCraft {
private static icons[3]; private static Icon icon;
public BlockHopper(int blockId) { public BlockHopper(int blockId) {
super(blockId, Material.iron); super(blockId, Material.iron);
@ -52,13 +52,15 @@ public class BlockHopper extends BlockBuildCraft {
super.onBlockActivated(world, x, y, z, entityplayer, par6, par7, par8, par9); super.onBlockActivated(world, x, y, z, entityplayer, par6, par7, par8, par9);
// Drop through if the player is sneaking // Drop through if the player is sneaking
if (entityplayer.isSneaking()) if (entityplayer.isSneaking()) {
return false; return false;
}
if (entityplayer.getCurrentEquippedItem() != null) { if (entityplayer.getCurrentEquippedItem() != null) {
if (entityplayer.getCurrentEquippedItem().getItem() instanceof IItemPipe) if (entityplayer.getCurrentEquippedItem().getItem() instanceof IItemPipe) {
return false; return false;
} }
}
if (!CoreProxy.proxy.isRenderWorld(world)) { if (!CoreProxy.proxy.isRenderWorld(world)) {
entityplayer.openGui(BuildCraftFactory.instance, GuiIds.HOPPER, world, x, y, z); entityplayer.openGui(BuildCraftFactory.instance, GuiIds.HOPPER, world, x, y, z);
@ -75,20 +77,13 @@ public class BlockHopper extends BlockBuildCraft {
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IconRegister par1IconRegister) public void registerIcons(IconRegister par1IconRegister) {
{ icon = par1IconRegister.registerIcon("buildcraft:hopperBottom");
icons = new Icon[3];
icons[0] = par1IconRegister.registerIcon("buildcraft:hopperBottom");
icons[1] = par1IconRegister.registerIcon("buildcraft:hopperTop");
icons[2] = par1IconRegister.registerIcon("buildcraft:hopperSide");
} }
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public Icon getIcon(int par1, int par2) public Icon getIcon(int par1, int par2) {
{ return icon;
if (par1 < 2) return icons[par2];
return icons[3];
} }
} }

View file

@ -1,12 +1,10 @@
/** /**
* Copyright (c) SpaceToad, 2011 * Copyright (c) SpaceToad, 2011 http://www.mod-buildcraft.com
* http://www.mod-buildcraft.com
* *
* BuildCraft is distributed under the terms of the Minecraft Mod Public * BuildCraft is distributed under the terms of the Minecraft Mod Public License
* License 1.0, or MMPL. Please check the contents of the license located in * 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt * http://www.mod-buildcraft.com/MMPL-1.0.txt
*/ */
package buildcraft.factory; package buildcraft.factory;
import java.util.ArrayList; import java.util.ArrayList;
@ -36,7 +34,8 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
public class BlockRefinery extends BlockContainer { public class BlockRefinery extends BlockContainer {
private static Icon[] icons;
private static Icon icon;
public BlockRefinery(int i) { public BlockRefinery(int i) {
super(i, Material.iron); super(i, Material.iron);
@ -81,8 +80,9 @@ public class BlockRefinery extends BlockContainer {
@Override @Override
public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityplayer, int par6, float par7, float par8, float par9) { public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityplayer, int par6, float par7, float par8, float par9) {
// Drop through if the player is sneaking // Drop through if the player is sneaking
if (entityplayer.isSneaking()) if (entityplayer.isSneaking()) {
return false; return false;
}
Item equipped = entityplayer.getCurrentEquippedItem() != null ? entityplayer.getCurrentEquippedItem().getItem() : null; Item equipped = entityplayer.getCurrentEquippedItem() != null ? entityplayer.getCurrentEquippedItem().getItem() : null;
if (equipped instanceof IToolWrench && ((IToolWrench) equipped).canWrench(entityplayer, i, j, k)) { if (equipped instanceof IToolWrench && ((IToolWrench) equipped).canWrench(entityplayer, i, j, k)) {
@ -138,21 +138,13 @@ public class BlockRefinery extends BlockContainer {
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerIcons(IconRegister par1IconRegister) public void registerIcons(IconRegister par1IconRegister) {
{ icon = par1IconRegister.registerIcon("buildcraft:refineryBack");
icons = new Icon[6];
icons[ForgeDirection.DOWN.ordinal()] = par1IconRegister.registerIcon("buildcraft:refineryBottom");
icons[ForgeDirection.UP.ordinal()] = par1IconRegister.registerIcon("buildcraft:refineryTop");
icons[ForgeDirection.NORTH.ordinal()] = par1IconRegister.registerIcon("buildcraft:refineryFront");
icons[ForgeDirection.SOUTH.ordinal()] = par1IconRegister.registerIcon("buildcraft:refineryBack");
icons[ForgeDirection.EAST.ordinal()] = par1IconRegister.registerIcon("buildcraft:refineryEast");
icons[ForgeDirection.WEST.ordinal()] = par1IconRegister.registerIcon("buildcraft:refineryWest");
} }
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public Icon getIcon(int par1, int par2) public Icon getIcon(int par1, int par2) {
{ return icon;
return icons[par1];
} }
} }