Convert Pipe Icon Prov to enum

And fixed a issue with the PowerProvider casting objects to TileEntities
that aren't TileEntities. Fixed by adding a getWorldObj() function to
IPowerReceptor.
This commit is contained in:
CovertJaguar 2013-06-27 13:10:01 -07:00
parent 42181dbc7f
commit 12de71213a
36 changed files with 126 additions and 154 deletions

View file

@ -7,6 +7,7 @@
*/
package buildcraft.api.power;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
public interface IPowerReceptor {
@ -14,4 +15,6 @@ public interface IPowerReceptor {
public PowerProvider getPowerProvider(ForgeDirection side);
public void doWork(PowerProvider workProvider);
public World getWorldObj();
}

View file

@ -8,7 +8,6 @@
package buildcraft.api.power;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import buildcraft.api.core.SafeTimeTracker;
@ -141,8 +140,7 @@ public final class PowerProvider {
private void applyPerdition() {
if (energyStored > 0) {
TileEntity tile = (TileEntity) receptor;
if (energyLossTracker.markTimeIfDelay(tile.worldObj, 10)) {
if (energyLossTracker.markTimeIfDelay(receptor.getWorldObj(), 10)) {
float newEnergy = getPerdition().applyPerdition(this, energyStored);
if (newEnergy == 0 || newEnergy < energyStored) {
energyStored = newEnergy;
@ -155,8 +153,7 @@ public final class PowerProvider {
private void applyWork() {
if (energyStored >= activationEnergy) {
TileEntity tile = (TileEntity) receptor;
if (doWorkTracker.markTimeIfDelay(tile.worldObj, 1)) {
if (doWorkTracker.markTimeIfDelay(receptor.getWorldObj(), 1)) {
receptor.doWork(this);
}
}

View file

@ -22,6 +22,7 @@ import buildcraft.core.network.PacketUpdate;
import buildcraft.core.network.TilePacketWrapper;
import buildcraft.core.proxy.CoreProxy;
import buildcraft.core.utils.Utils;
import net.minecraft.world.World;
public abstract class TileBuildCraft extends TileEntity implements ISynchronizedTile {

View file

@ -918,7 +918,7 @@ public class BlockGenericPipe extends BlockContainer {
@Override
@SideOnly(Side.CLIENT)
public Icon getIcon(int par1, int par2) {
return BuildCraftTransport.instance.pipeIconProvider.getIcon(PipeIconProvider.Stripes);
return BuildCraftTransport.instance.pipeIconProvider.getIcon(PipeIconProvider.TYPE.Stripes.ordinal());
}
/**

View file

@ -729,4 +729,8 @@ public abstract class Pipe implements IPipe, IDropControlInventory {
}
public World getWorldObj(){
return worldObj;
}
}

View file

@ -8,114 +8,81 @@ import cpw.mods.fml.relauncher.SideOnly;
public class PipeIconProvider implements IIconProvider {
public static final int PipeStructureCobblestone = 0;
public static final int PipeItemsCobbleStone = 1;
public static final int PipeItemsDiamond_Center = 2;
public static final int PipeItemsDiamond_Down = 3;
public static final int PipeItemsDiamond_Up = 4;
public static final int PipeItemsDiamond_North = 5;
public static final int PipeItemsDiamond_South = 6;
public static final int PipeItemsDiamond_West = 7;
public static final int PipeItemsDiamond_East = 8;
public static final int PipeItemsWood_Standard = 9;
public static final int PipeAllWood_Solid = 10;
public static final int PipeItemsEmerald_Standard = 11;
public static final int PipeAllEmerald_Solid = 12;
public static final int PipeItemsGold = 13;
public static final int PipeItemsIron_Standard = 14;
public static final int PipeAllIron_Solid = 15;
public static final int PipeItemsObsidian = 16;
public static final int PipeItemsSandstone = 17;
public static final int PipeItemsStone = 18;
public static final int PipeItemsVoid = 19;
public static final int PipeLiquidsCobblestone = 20;
public static final int PipeLiquidsWood_Standard = 21;
public static final int PipeLiquidsEmerald_Standard = 22;
public static final int PipeLiquidsGold = 23;
public static final int PipeLiquidsIron_Standard = 24;
public static final int PipeLiquidsSandstone = 25;
public static final int PipeLiquidsStone = 26;
public static final int PipeLiquidsVoid = 27;
public static final int PipePowerGold = 28;
public static final int PipePowerStone = 29;
public static final int PipePowerWood_Standard = 30;
public enum TYPE {
public static final int Power_Normal = 31;
public static final int Power_Overload = 32;
PipeStructureCobblestone("pipeStructureCobblestone"),
//
PipeItemsCobbleStone("pipeItemsCobblestone"),
//
PipeItemsDiamond_Center("pipeItemsDiamond_center"),
PipeItemsDiamond_Down("pipeItemsDiamond_down"),
PipeItemsDiamond_Up("pipeItemsDiamond_up"),
PipeItemsDiamond_North("pipeItemsDiamond_north"),
PipeItemsDiamond_South("pipeItemsDiamond_south"),
PipeItemsDiamond_West("pipeItemsDiamond_west"),
PipeItemsDiamond_East("pipeItemsDiamond_east"),
//
PipeItemsWood_Standard("pipeItemsWood_standard"),
PipeAllWood_Solid("pipeAllWood_solid"),
//
PipeItemsEmerald_Standard("pipeItemsEmerald_standard"),
PipeAllEmerald_Solid("pipeAllEmerald_solid"),
//
PipeItemsGold("pipeItemsGold"),
//
PipeItemsIron_Standard("pipeItemsIron_standard"),
PipeAllIron_Solid("pipeAllIron_solid"),
//
PipeItemsObsidian("pipeItemsObsidian"),
PipeItemsSandstone("pipeItemsSandstone"),
PipeItemsStone("pipeItemsStone"),
PipeItemsQuartz("pipeItemsQuartz"),
PipeItemsVoid("pipeItemsVoid"),
//
PipeLiquidsCobblestone("pipeLiquidsCobblestone"),
PipeLiquidsWood_Standard("pipeLiquidsWood_standard"),
PipeLiquidsEmerald_Standard("pipeLiquidsEmerald_standard"),
PipeLiquidsGold("pipeLiquidsGold"),
PipeLiquidsIron_Standard("pipeLiquidsIron_standard"),
PipeLiquidsSandstone("pipeLiquidsSandstone"),
PipeLiquidsStone("pipeLiquidsStone"),
PipeLiquidsVoid("pipeLiquidsVoid"),
//
PipePowerDiamond("pipePowerDiamond"),
PipePowerGold("pipePowerGold"),
PipePowerQuartz("pipePowerQuartz"),
PipePowerStone("pipePowerStone"),
PipePowerCobblestone("pipePowerCobblestone"),
PipePowerWood_Standard("pipePowerWood_standard"),
//
Power_Normal("texture_cyan"),
Power_Overload("texture_red_lit"),
Stripes("pipeStripes");
//
public static final TYPE[] VALUES = values();
private final String iconTag;
private Icon icon;
public static final int Stripes = 33;
private TYPE(String iconTag) {
this.iconTag = iconTag;
}
public static final int PipePowerCobblestone = 34;
public static final int PipePowerDiamond = 35;
public static final int PipePowerQuartz = 36;
public static final int PipeItemsQuartz = 37;
public static final int MAX = 38;
@SideOnly(Side.CLIENT)
private Icon[] _icons;
private void registerIcon(IconRegister iconRegister) {
icon = iconRegister.registerIcon("buildcraft:" + iconTag);
}
}
@Override
@SideOnly(Side.CLIENT)
public Icon getIcon(int pipeIconIndex) {
return _icons[pipeIconIndex];
return TYPE.VALUES[pipeIconIndex].icon;
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister) {
_icons = new Icon[PipeIconProvider.MAX];
_icons[PipeIconProvider.PipeStructureCobblestone] = iconRegister.registerIcon("buildcraft:pipeStructureCobblestone");
_icons[PipeIconProvider.PipeItemsCobbleStone] = iconRegister.registerIcon("buildcraft:pipeItemsCobblestone");
_icons[PipeIconProvider.PipeItemsDiamond_Center] = iconRegister.registerIcon("buildcraft:pipeItemsDiamond_center");
_icons[PipeIconProvider.PipeItemsDiamond_Down] = iconRegister.registerIcon("buildcraft:pipeItemsDiamond_down");
_icons[PipeIconProvider.PipeItemsDiamond_Up] = iconRegister.registerIcon("buildcraft:pipeItemsDiamond_up");
_icons[PipeIconProvider.PipeItemsDiamond_North] = iconRegister.registerIcon("buildcraft:pipeItemsDiamond_north");
_icons[PipeIconProvider.PipeItemsDiamond_South] = iconRegister.registerIcon("buildcraft:pipeItemsDiamond_south");
_icons[PipeIconProvider.PipeItemsDiamond_West] = iconRegister.registerIcon("buildcraft:pipeItemsDiamond_west");
_icons[PipeIconProvider.PipeItemsDiamond_East] = iconRegister.registerIcon("buildcraft:pipeItemsDiamond_east");
_icons[PipeIconProvider.PipeItemsWood_Standard] = iconRegister.registerIcon("buildcraft:pipeItemsWood_standard");
_icons[PipeIconProvider.PipeAllWood_Solid] = iconRegister.registerIcon("buildcraft:pipeAllWood_solid");
_icons[PipeIconProvider.PipeItemsEmerald_Standard] = iconRegister.registerIcon("buildcraft:pipeItemsEmerald_standard");
_icons[PipeIconProvider.PipeAllEmerald_Solid] = iconRegister.registerIcon("buildcraft:pipeAllEmerald_solid");
_icons[PipeIconProvider.PipeItemsGold] = iconRegister.registerIcon("buildcraft:pipeItemsGold");
_icons[PipeIconProvider.PipeItemsIron_Standard] = iconRegister.registerIcon("buildcraft:pipeItemsIron_standard");
_icons[PipeIconProvider.PipeAllIron_Solid] = iconRegister.registerIcon("buildcraft:pipeAllIron_solid");
_icons[PipeIconProvider.PipeItemsObsidian] = iconRegister.registerIcon("buildcraft:pipeItemsObsidian");
_icons[PipeIconProvider.PipeItemsSandstone] = iconRegister.registerIcon("buildcraft:pipeItemsSandstone");
_icons[PipeIconProvider.PipeItemsStone] = iconRegister.registerIcon("buildcraft:pipeItemsStone");
_icons[PipeIconProvider.PipeItemsQuartz] = iconRegister.registerIcon("buildcraft:pipeItemsQuartz");
_icons[PipeIconProvider.PipeItemsVoid] = iconRegister.registerIcon("buildcraft:pipeItemsVoid");
_icons[PipeIconProvider.PipeLiquidsCobblestone] = iconRegister.registerIcon("buildcraft:pipeLiquidsCobblestone");
_icons[PipeIconProvider.PipeLiquidsWood_Standard] = iconRegister.registerIcon("buildcraft:pipeLiquidsWood_standard");
_icons[PipeIconProvider.PipeLiquidsEmerald_Standard] = iconRegister.registerIcon("buildcraft:pipeLiquidsEmerald_standard");
_icons[PipeIconProvider.PipeLiquidsGold] = iconRegister.registerIcon("buildcraft:pipeLiquidsGold");
_icons[PipeIconProvider.PipeLiquidsIron_Standard] = iconRegister.registerIcon("buildcraft:pipeLiquidsIron_standard");
_icons[PipeIconProvider.PipeLiquidsSandstone] = iconRegister.registerIcon("buildcraft:pipeLiquidsSandstone");
_icons[PipeIconProvider.PipeLiquidsStone] = iconRegister.registerIcon("buildcraft:pipeLiquidsStone");
_icons[PipeIconProvider.PipeLiquidsVoid] = iconRegister.registerIcon("buildcraft:pipeLiquidsVoid");
_icons[PipeIconProvider.PipePowerDiamond] = iconRegister.registerIcon("buildcraft:pipePowerDiamond");
_icons[PipeIconProvider.PipePowerGold] = iconRegister.registerIcon("buildcraft:pipePowerGold");
_icons[PipeIconProvider.PipePowerQuartz] = iconRegister.registerIcon("buildcraft:pipePowerQuartz");
_icons[PipeIconProvider.PipePowerStone] = iconRegister.registerIcon("buildcraft:pipePowerStone");
_icons[PipeIconProvider.PipePowerCobblestone] = iconRegister.registerIcon("buildcraft:pipePowerCobblestone");
_icons[PipeIconProvider.PipePowerWood_Standard] = iconRegister.registerIcon("buildcraft:pipePowerWood_standard");
_icons[PipeIconProvider.Power_Normal] = iconRegister.registerIcon("buildcraft:texture_cyan");
_icons[PipeIconProvider.Power_Overload] = iconRegister.registerIcon("buildcraft:texture_red_lit");
_icons[PipeIconProvider.Stripes] = iconRegister.registerIcon("buildcraft:pipeStripes");
for (TYPE type : TYPE.VALUES) {
type.registerIcon(iconRegister);
}
}
}

View file

@ -32,7 +32,7 @@ public class PipeItemsCobblestone extends Pipe {
@Override
public int getIconIndex(ForgeDirection direction) {
return PipeIconProvider.PipeItemsCobbleStone;
return PipeIconProvider.TYPE.PipeItemsCobbleStone.ordinal();
}
}

View file

@ -45,13 +45,13 @@ public class PipeItemsDiamond extends Pipe implements IPipeTransportItemsHook, I
@Override
public int getIconIndex(ForgeDirection direction) {
switch(direction){
case UNKNOWN: return PipeIconProvider.PipeItemsDiamond_Center;
case DOWN: return PipeIconProvider.PipeItemsDiamond_Down;
case UP: return PipeIconProvider.PipeItemsDiamond_Up;
case NORTH: return PipeIconProvider.PipeItemsDiamond_North;
case SOUTH: return PipeIconProvider.PipeItemsDiamond_South;
case WEST: return PipeIconProvider.PipeItemsDiamond_West;
case EAST: return PipeIconProvider.PipeItemsDiamond_East;
case UNKNOWN: return PipeIconProvider.TYPE.PipeItemsDiamond_Center.ordinal();
case DOWN: return PipeIconProvider.TYPE.PipeItemsDiamond_Down.ordinal();
case UP: return PipeIconProvider.TYPE.PipeItemsDiamond_Up.ordinal();
case NORTH: return PipeIconProvider.TYPE.PipeItemsDiamond_North.ordinal();
case SOUTH: return PipeIconProvider.TYPE.PipeItemsDiamond_South.ordinal();
case WEST: return PipeIconProvider.TYPE.PipeItemsDiamond_West.ordinal();
case EAST: return PipeIconProvider.TYPE.PipeItemsDiamond_East.ordinal();
default: throw new IllegalArgumentException("direction out of bounds");
}
}

View file

@ -40,8 +40,8 @@ public class PipeItemsEmerald extends PipeItemsWood implements ISpecialInventory
protected PipeItemsEmerald(int itemID, PipeTransportItems transport) {
super(transport, new PipeLogicEmerald(), itemID);
standardIconIndex = PipeIconProvider.PipeItemsEmerald_Standard;
solidIconIndex = PipeIconProvider.PipeAllEmerald_Solid;
standardIconIndex = PipeIconProvider.TYPE.PipeItemsEmerald_Standard.ordinal();
solidIconIndex = PipeIconProvider.TYPE.PipeAllEmerald_Solid.ordinal();
}
public PipeItemsEmerald(int itemID) {

View file

@ -37,7 +37,7 @@ public class PipeItemsGold extends Pipe implements IPipeTransportItemsHook {
@Override
public int getIconIndex(ForgeDirection direction) {
return PipeIconProvider.PipeItemsGold;
return PipeIconProvider.TYPE.PipeItemsGold.ordinal();
}
@Override

View file

@ -19,8 +19,8 @@ import cpw.mods.fml.relauncher.SideOnly;
public class PipeItemsIron extends Pipe {
private int standardIconIndex = PipeIconProvider.PipeItemsIron_Standard;
private int solidIconIndex = PipeIconProvider.PipeAllIron_Solid;
private int standardIconIndex = PipeIconProvider.TYPE.PipeItemsIron_Standard.ordinal();
private int solidIconIndex = PipeIconProvider.TYPE.PipeAllIron_Solid.ordinal();
public PipeItemsIron(int itemID) {
super(new PipeTransportItems(), new PipeLogicIron(), itemID);
@ -35,7 +35,7 @@ public class PipeItemsIron extends Pipe {
else {
int metadata = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
if (metadata == direction.ordinal())
if (metadata != direction.ordinal())
return solidIconIndex;
else
return standardIconIndex;

View file

@ -63,7 +63,7 @@ public class PipeItemsObsidian extends Pipe implements IPowerReceptor {
@Override
public int getIconIndex(ForgeDirection direction) {
return PipeIconProvider.PipeItemsObsidian;
return PipeIconProvider.TYPE.PipeItemsObsidian.ordinal();
}
@Override

View file

@ -37,7 +37,7 @@ public class PipeItemsQuartz extends Pipe implements IPipeTransportItemsHook {
@Override
public int getIconIndex(ForgeDirection direction) {
return PipeIconProvider.PipeItemsQuartz;
return PipeIconProvider.TYPE.PipeItemsQuartz.ordinal();
}
@Override

View file

@ -31,6 +31,6 @@ public class PipeItemsSandstone extends Pipe {
@Override
public int getIconIndex(ForgeDirection direction) {
return PipeIconProvider.PipeItemsSandstone;
return PipeIconProvider.TYPE.PipeItemsSandstone.ordinal();
}
}

View file

@ -38,7 +38,7 @@ public class PipeItemsStone extends Pipe implements IPipeTransportItemsHook {
@Override
public int getIconIndex(ForgeDirection direction) {
return PipeIconProvider.PipeItemsStone;
return PipeIconProvider.TYPE.PipeItemsStone.ordinal();
}
@Override

View file

@ -36,7 +36,7 @@ public class PipeItemsVoid extends Pipe implements IItemTravelingHook {
@Override
public int getIconIndex(ForgeDirection direction) {
return PipeIconProvider.PipeItemsVoid;
return PipeIconProvider.TYPE.PipeItemsVoid.ordinal();
}
// This is called if the void pipe is only connected to one pipe

View file

@ -33,8 +33,8 @@ import cpw.mods.fml.relauncher.SideOnly;
public class PipeItemsWood extends Pipe implements IPowerReceptor {
protected PowerProvider powerProvider;
protected int standardIconIndex = PipeIconProvider.PipeItemsWood_Standard;
protected int solidIconIndex = PipeIconProvider.PipeAllWood_Solid;
protected int standardIconIndex = PipeIconProvider.TYPE.PipeItemsWood_Standard.ordinal();
protected int solidIconIndex = PipeIconProvider.TYPE.PipeAllWood_Solid.ordinal();
protected PipeItemsWood(PipeTransportItems transport, PipeLogic logic, int itemID) {
super(transport, logic, itemID);

View file

@ -31,6 +31,6 @@ public class PipeLiquidsCobblestone extends Pipe {
@Override
public int getIconIndex(ForgeDirection direction) {
return PipeIconProvider.PipeLiquidsCobblestone;
return PipeIconProvider.TYPE.PipeLiquidsCobblestone.ordinal();
}
}

View file

@ -20,8 +20,8 @@ public class PipeLiquidsEmerald extends PipeLiquidsWood {
public PipeLiquidsEmerald(int itemID) {
super(new PipeLogicEmerald(), itemID);
standardIconIndex = PipeIconProvider.PipeLiquidsEmerald_Standard;
solidIconIndex = PipeIconProvider.PipeAllEmerald_Solid;
standardIconIndex = PipeIconProvider.TYPE.PipeLiquidsEmerald_Standard.ordinal();
solidIconIndex = PipeIconProvider.TYPE.PipeAllEmerald_Solid.ordinal();
((PipeTransportLiquids) transport).flowRate = 40;
((PipeTransportLiquids) transport).travelDelay = 4;

View file

@ -34,7 +34,7 @@ public class PipeLiquidsGold extends Pipe {
@Override
public int getIconIndex(ForgeDirection direction) {
return PipeIconProvider.PipeLiquidsGold;
return PipeIconProvider.TYPE.PipeLiquidsGold.ordinal();
}
}

View file

@ -19,8 +19,8 @@ import cpw.mods.fml.relauncher.SideOnly;
public class PipeLiquidsIron extends Pipe {
protected int standardIconIndex = PipeIconProvider.PipeLiquidsIron_Standard;
protected int solidIconIndex = PipeIconProvider.PipeAllIron_Solid;
protected int standardIconIndex = PipeIconProvider.TYPE.PipeLiquidsIron_Standard.ordinal();
protected int solidIconIndex = PipeIconProvider.TYPE.PipeAllIron_Solid.ordinal();
public PipeLiquidsIron(int itemID) {

View file

@ -34,7 +34,7 @@ public class PipeLiquidsSandstone extends Pipe implements IPipeTransportLiquidsH
@Override
public int getIconIndex(ForgeDirection direction) {
return PipeIconProvider.PipeLiquidsSandstone;
return PipeIconProvider.TYPE.PipeLiquidsSandstone.ordinal();
}
@Override

View file

@ -33,7 +33,7 @@ public class PipeLiquidsStone extends Pipe {
@Override
public int getIconIndex(ForgeDirection direction) {
return PipeIconProvider.PipeLiquidsStone;
return PipeIconProvider.TYPE.PipeLiquidsStone.ordinal();
}
}

View file

@ -34,7 +34,7 @@ public class PipeLiquidsVoid extends Pipe implements IPipeTransportLiquidsHook {
@Override
public int getIconIndex(ForgeDirection direction) {
return PipeIconProvider.PipeLiquidsVoid;
return PipeIconProvider.TYPE.PipeLiquidsVoid.ordinal();
}
@Override

View file

@ -34,8 +34,8 @@ public class PipeLiquidsWood extends Pipe implements IPowerReceptor {
private PowerProvider powerProvider;
protected int standardIconIndex = PipeIconProvider.PipeLiquidsWood_Standard;
protected int solidIconIndex = PipeIconProvider.PipeAllWood_Solid;
protected int standardIconIndex = PipeIconProvider.TYPE.PipeLiquidsWood_Standard.ordinal();
protected int solidIconIndex = PipeIconProvider.TYPE.PipeAllWood_Solid.ordinal();
long lastMining = 0;
boolean lastPower = false;

View file

@ -31,6 +31,6 @@ public class PipePowerCobblestone extends Pipe {
@Override
public int getIconIndex(ForgeDirection direction) {
return PipeIconProvider.PipePowerCobblestone;
return PipeIconProvider.TYPE.PipePowerCobblestone.ordinal();
}
}

View file

@ -31,6 +31,6 @@ public class PipePowerDiamond extends Pipe {
@Override
public int getIconIndex(ForgeDirection direction) {
return PipeIconProvider.PipePowerDiamond;
return PipeIconProvider.TYPE.PipePowerDiamond.ordinal();
}
}

View file

@ -31,6 +31,6 @@ public class PipePowerGold extends Pipe {
@Override
public int getIconIndex(ForgeDirection direction) {
return PipeIconProvider.PipePowerGold;
return PipeIconProvider.TYPE.PipePowerGold.ordinal();
}
}

View file

@ -31,6 +31,6 @@ public class PipePowerQuartz extends Pipe {
@Override
public int getIconIndex(ForgeDirection direction) {
return PipeIconProvider.PipePowerQuartz;
return PipeIconProvider.TYPE.PipePowerQuartz.ordinal();
}
}

View file

@ -31,6 +31,6 @@ public class PipePowerStone extends Pipe {
@Override
public int getIconIndex(ForgeDirection direction) {
return PipeIconProvider.PipePowerStone;
return PipeIconProvider.TYPE.PipePowerStone.ordinal();
}
}

View file

@ -22,8 +22,8 @@ import net.minecraft.nbt.NBTTagCompound;
public class PipePowerWood extends Pipe implements IPowerReceptor {
private PowerProvider powerProvider;
protected int standardIconIndex = PipeIconProvider.PipePowerWood_Standard;
protected int solidIconIndex = PipeIconProvider.PipeAllWood_Solid;
protected int standardIconIndex = PipeIconProvider.TYPE.PipePowerWood_Standard.ordinal();
protected int solidIconIndex = PipeIconProvider.TYPE.PipeAllWood_Solid.ordinal();
private boolean[] powerSources = new boolean[6];
private boolean full;

View file

@ -23,6 +23,6 @@ public class PipeStructureCobblestone extends Pipe {
@Override
public int getIconIndex(ForgeDirection direction) {
return PipeIconProvider.PipeStructureCobblestone;
return PipeIconProvider.TYPE.PipeStructureCobblestone.ordinal();
}
}

View file

@ -62,7 +62,7 @@ public class FacadeItemRenderer implements IItemRenderer {
// Render StructurePipe
block = BuildCraftTransport.genericPipeBlock;
Icon textureID = BuildCraftTransport.instance.pipeIconProvider.getIcon(PipeIconProvider.PipeStructureCobblestone); // Structure pipe
Icon textureID = BuildCraftTransport.instance.pipeIconProvider.getIcon(PipeIconProvider.TYPE.PipeStructureCobblestone.ordinal()); // Structure pipe
block.setBlockBounds(Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMinPos, Utils.pipeMaxPos, Utils.pipeMaxPos, Utils.pipeMaxPos - 1F / 16F);
block.setBlockBoundsForItemRender();

View file

@ -267,7 +267,7 @@ public class PipeWorldRenderer implements ISimpleBlockRenderingHandler {
zeroState[2][0] = Utils.pipeMinPos;
zeroState[2][1] = Utils.pipeMaxPos;
state.currentTexture = BuildCraftTransport.instance.pipeIconProvider.getIcon(PipeIconProvider.PipeStructureCobblestone); // Structure Pipe
state.currentTexture = BuildCraftTransport.instance.pipeIconProvider.getIcon(PipeIconProvider.TYPE.PipeStructureCobblestone.ordinal()); // Structure Pipe
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
if (state.facadeMatrix.getFacadeBlockId(direction) != 0 && !state.pipeConnectionMatrix.isConnected(direction)) {
@ -296,7 +296,7 @@ public class PipeWorldRenderer implements ISimpleBlockRenderingHandler {
zeroState[2][0] = 0.25F + zFightOffset;
zeroState[2][1] = 0.75F - zFightOffset;
state.currentTexture = BuildCraftTransport.instance.pipeIconProvider.getIcon(PipeIconProvider.PipeStructureCobblestone); // Structure Pipe
state.currentTexture = BuildCraftTransport.instance.pipeIconProvider.getIcon(PipeIconProvider.TYPE.PipeStructureCobblestone.ordinal()); // Structure Pipe
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
if (state.plugMatrix.isConnected(direction)) {
@ -319,7 +319,7 @@ public class PipeWorldRenderer implements ISimpleBlockRenderingHandler {
zeroState[2][0] = 0.25F + 0.125F/2;
zeroState[2][1] = 0.75F - 0.125F/2;
state.currentTexture = BuildCraftTransport.instance.pipeIconProvider.getIcon(PipeIconProvider.PipeStructureCobblestone); // Structure Pipe
state.currentTexture = BuildCraftTransport.instance.pipeIconProvider.getIcon(PipeIconProvider.TYPE.PipeStructureCobblestone.ordinal()); // Structure Pipe
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
if (state.plugMatrix.isConnected(direction)) {

View file

@ -20,7 +20,7 @@ public class PlugItemRenderer implements IItemRenderer{
Tessellator tessellator = Tessellator.instance;
block = BuildCraftTransport.genericPipeBlock;
Icon textureID = BuildCraftTransport.instance.pipeIconProvider.getIcon(PipeIconProvider.PipeStructureCobblestone); // Structure pipe
Icon textureID = BuildCraftTransport.instance.pipeIconProvider.getIcon(PipeIconProvider.TYPE.PipeStructureCobblestone.ordinal()); // Structure pipe
block.setBlockBounds(0.25F, 0.25F, 0.25F, 0.75F, 0.375F, 0.75F);
block.setBlockBoundsForItemRender();

View file

@ -196,7 +196,7 @@ public class RenderPipe extends TileEntitySpecialRenderer {
initialized = true;
BlockInterface block = new BlockInterface();
block.texture = BuildCraftTransport.instance.pipeIconProvider.getIcon(PipeIconProvider.Power_Normal);
block.texture = BuildCraftTransport.instance.pipeIconProvider.getIcon(PipeIconProvider.TYPE.Power_Normal.ordinal());
float size = Utils.pipeMaxPos - Utils.pipeMinPos;
@ -222,7 +222,7 @@ public class RenderPipe extends TileEntitySpecialRenderer {
GL11.glEndList();
}
block.texture = BuildCraftTransport.instance.pipeIconProvider.getIcon(PipeIconProvider.Power_Overload);
block.texture = BuildCraftTransport.instance.pipeIconProvider.getIcon(PipeIconProvider.TYPE.Power_Overload.ordinal());
size = Utils.pipeMaxPos - Utils.pipeMinPos;