diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_4_4.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/action_machinecontrol_loop.png similarity index 100% rename from buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_4_4.png rename to buildcraft_resources/mods/buildcraft/textures/items/triggers/action_machinecontrol_loop.png diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_4_3.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/action_machinecontrol_off.png similarity index 100% rename from buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_4_3.png rename to buildcraft_resources/mods/buildcraft/textures/items/triggers/action_machinecontrol_off.png diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_4_2.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/action_machinecontrol_on.png similarity index 100% rename from buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_4_2.png rename to buildcraft_resources/mods/buildcraft/textures/items/triggers/action_machinecontrol_on.png diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_1_0.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_engineheat_blue.png similarity index 100% rename from buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_1_0.png rename to buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_engineheat_blue.png diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_1_1.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_engineheat_green.png similarity index 100% rename from buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_1_1.png rename to buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_engineheat_green.png diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_1_3.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_engineheat_red.png similarity index 100% rename from buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_1_3.png rename to buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_engineheat_red.png diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_1_2.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_engineheat_yellow.png similarity index 100% rename from buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_1_2.png rename to buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_engineheat_yellow.png diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_2_5.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_inventory_contains.png similarity index 100% rename from buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_2_5.png rename to buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_inventory_contains.png diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_2_4.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_inventory_empty.png similarity index 100% rename from buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_2_4.png rename to buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_inventory_empty.png diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_2_7.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_inventory_full.png similarity index 100% rename from buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_2_7.png rename to buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_inventory_full.png diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_2_6.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_inventory_space.png similarity index 100% rename from buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_2_6.png rename to buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_inventory_space.png diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_2_1.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_liquidcontainer_contains.png similarity index 100% rename from buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_2_1.png rename to buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_liquidcontainer_contains.png diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_2_0.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_liquidcontainer_empty.png similarity index 100% rename from buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_2_0.png rename to buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_liquidcontainer_empty.png diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_2_3.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_liquidcontainer_full.png similarity index 100% rename from buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_2_3.png rename to buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_liquidcontainer_full.png diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_2_2.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_liquidcontainer_space.png similarity index 100% rename from buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_2_2.png rename to buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_liquidcontainer_space.png diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_4_0.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_machine_active.png similarity index 100% rename from buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_4_0.png rename to buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_machine_active.png diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_4_1.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_machine_inactive.png similarity index 100% rename from buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_4_1.png rename to buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_machine_inactive.png diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_3_3.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipecontents_containsenergy.png similarity index 100% rename from buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_3_3.png rename to buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipecontents_containsenergy.png diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_3_1.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipecontents_containsitems.png similarity index 100% rename from buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_3_1.png rename to buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipecontents_containsitems.png diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_3_2.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipecontents_containsliquid.png similarity index 100% rename from buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_3_2.png rename to buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipecontents_containsliquid.png diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_3_0.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipecontents_empty.png similarity index 100% rename from buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_3_0.png rename to buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipecontents_empty.png diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_0_5.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_blue_active.png similarity index 100% rename from buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_0_5.png rename to buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_blue_active.png diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_0_4.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_blue_inactive.png similarity index 100% rename from buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_0_4.png rename to buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_blue_inactive.png diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_0_7.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_green_active.png similarity index 100% rename from buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_0_7.png rename to buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_green_active.png diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_0_6.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_green_inactive.png similarity index 100% rename from buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_0_6.png rename to buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_green_inactive.png diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_0_3.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_red_active.png similarity index 100% rename from buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_0_3.png rename to buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_red_active.png diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_0_2.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_red_inactive.png similarity index 100% rename from buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_0_2.png rename to buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_red_inactive.png diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_0_9.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_yellow_active.png similarity index 100% rename from buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_0_9.png rename to buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_yellow_active.png diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_0_8.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_yellow_inactive.png similarity index 100% rename from buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_0_8.png rename to buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_pipesignal_yellow_inactive.png diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_0_0.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_redstoneinput_active.png similarity index 100% rename from buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_0_0.png rename to buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_redstoneinput_active.png diff --git a/buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_0_1.png b/buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_redstoneinput_inactive.png similarity index 100% rename from buildcraft_resources/mods/buildcraft/textures/items/triggers/guitriggers_0_1.png rename to buildcraft_resources/mods/buildcraft/textures/items/triggers/trigger_redstoneinput_inactive.png diff --git a/common/buildcraft/api/gates/ITrigger.java b/common/buildcraft/api/gates/ITrigger.java index 99067dc0..b7f10be3 100644 --- a/common/buildcraft/api/gates/ITrigger.java +++ b/common/buildcraft/api/gates/ITrigger.java @@ -13,7 +13,7 @@ public interface ITrigger { * Return the texture file for this trigger icon */ @SideOnly(Side.CLIENT) - public abstract Icon getTexture(); + public abstract Icon getTextureIcon(); /** * Return true if this trigger can accept parameters diff --git a/common/buildcraft/api/gates/Trigger.java b/common/buildcraft/api/gates/Trigger.java index 41df3f52..1f26b7e3 100644 --- a/common/buildcraft/api/gates/Trigger.java +++ b/common/buildcraft/api/gates/Trigger.java @@ -47,7 +47,7 @@ public abstract class Trigger implements ITrigger { */ @SideOnly(Side.CLIENT) @Override - public abstract Icon getTexture(); + public abstract Icon getTextureIcon(); /* * (non-Javadoc) diff --git a/common/buildcraft/core/triggers/ActionMachineControl.java b/common/buildcraft/core/triggers/ActionMachineControl.java index 811a6307..957fb495 100644 --- a/common/buildcraft/core/triggers/ActionMachineControl.java +++ b/common/buildcraft/core/triggers/ActionMachineControl.java @@ -1,7 +1,12 @@ package buildcraft.core.triggers; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.util.Icon; +import buildcraft.BuildCraftTransport; import buildcraft.api.gates.Action; import buildcraft.core.DefaultProps; +import buildcraft.transport.IconItemConstants; public class ActionMachineControl extends Action { @@ -17,20 +22,6 @@ public class ActionMachineControl extends Action { this.mode = mode; } - @Override - public int getIndexInTexture() { - switch (mode) { - case On: - return 4 * 16 + 2; - case Off: - return 4 * 16 + 3; - case Loop: - return 4 * 16 + 4; - default: - return 0; - } - } - @Override public String getDescription() { switch (mode) { @@ -46,8 +37,18 @@ public class ActionMachineControl extends Action { } @Override - public String getTexture() { - return DefaultProps.TEXTURE_TRIGGERS; + @SideOnly(Side.CLIENT) + public Icon getTexture() { + switch (mode) { + case On: + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Action_MachineControl_On]; + case Off: + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Action_MachineControl_Off]; + case Loop: + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Action_MachineControl_Loop]; + default: + return null; + } } } diff --git a/common/buildcraft/core/triggers/ActionRedstoneOutput.java b/common/buildcraft/core/triggers/ActionRedstoneOutput.java index c504d9b8..63df04f3 100644 --- a/common/buildcraft/core/triggers/ActionRedstoneOutput.java +++ b/common/buildcraft/core/triggers/ActionRedstoneOutput.java @@ -9,8 +9,13 @@ package buildcraft.core.triggers; +import net.minecraft.util.Icon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import buildcraft.BuildCraftTransport; import buildcraft.api.gates.Action; import buildcraft.core.DefaultProps; +import buildcraft.transport.IconItemConstants; public class ActionRedstoneOutput extends Action { @@ -18,18 +23,14 @@ public class ActionRedstoneOutput extends Action { super(id); } - @Override - public int getIndexInTexture() { - return 0 * 16 + 0; - } - @Override public String getDescription() { return "Redstone Signal"; } @Override - public String getTexture() { - return DefaultProps.TEXTURE_TRIGGERS; + @SideOnly(Side.CLIENT) + public Icon getTexture() { + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Trigger_RedstoneInput_Active]; } } diff --git a/common/buildcraft/core/triggers/TriggerInventory.java b/common/buildcraft/core/triggers/TriggerInventory.java index a877e4c8..8dbdb111 100644 --- a/common/buildcraft/core/triggers/TriggerInventory.java +++ b/common/buildcraft/core/triggers/TriggerInventory.java @@ -9,17 +9,22 @@ package buildcraft.core.triggers; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.Icon; import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.common.ISidedInventory; +import buildcraft.BuildCraftTransport; import buildcraft.api.gates.ITriggerDirectional; import buildcraft.api.gates.ITriggerParameter; import buildcraft.api.gates.Trigger; import buildcraft.core.DefaultProps; import buildcraft.core.utils.SidedInventoryAdapter; import buildcraft.core.utils.Utils; +import buildcraft.transport.IconItemConstants; public class TriggerInventory extends Trigger implements ITriggerDirectional { @@ -35,20 +40,6 @@ public class TriggerInventory extends Trigger implements ITriggerDirectional { this.state = state; } - @Override - public int getIndexInTexture() { - switch (state) { - case Empty: - return 2 * 16 + 4; - case Contains: - return 2 * 16 + 5; - case Space: - return 2 * 16 + 6; - default: - return 2 * 16 + 7; - } - } - @Override public boolean hasParameter() { if (state == State.Contains || state == State.Space) @@ -134,7 +125,17 @@ public class TriggerInventory extends Trigger implements ITriggerDirectional { } @Override - public String getTexture() { - return DefaultProps.TEXTURE_TRIGGERS; + @SideOnly(Side.CLIENT) + public Icon getTextureIcon() { + switch (state) { + case Empty: + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Trigger_Inventory_Empty]; + case Contains: + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Trigger_Inventory_Contains]; + case Space: + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Trigger_Inventory_Space]; + default: + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Trigger_Inventory_Full]; + } } } diff --git a/common/buildcraft/core/triggers/TriggerLiquidContainer.java b/common/buildcraft/core/triggers/TriggerLiquidContainer.java index f46e5f4f..c767a26c 100644 --- a/common/buildcraft/core/triggers/TriggerLiquidContainer.java +++ b/common/buildcraft/core/triggers/TriggerLiquidContainer.java @@ -9,15 +9,20 @@ package buildcraft.core.triggers; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.Icon; import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.liquids.ILiquidTank; import net.minecraftforge.liquids.ITankContainer; import net.minecraftforge.liquids.LiquidContainerRegistry; import net.minecraftforge.liquids.LiquidStack; +import buildcraft.BuildCraftTransport; import buildcraft.api.gates.ITriggerParameter; import buildcraft.api.gates.Trigger; import buildcraft.core.DefaultProps; +import buildcraft.transport.IconItemConstants; public class TriggerLiquidContainer extends Trigger { @@ -32,20 +37,6 @@ public class TriggerLiquidContainer extends Trigger { this.state = state; } - @Override - public int getIndexInTexture() { - switch (state) { - case Empty: - return 2 * 16 + 0; - case Contains: - return 2 * 16 + 1; - case Space: - return 2 * 16 + 2; - default: - return 2 * 16 + 3; - } - } - @Override public boolean hasParameter() { if (state == State.Contains || state == State.Space) @@ -137,7 +128,17 @@ public class TriggerLiquidContainer extends Trigger { } @Override - public String getTexture() { - return DefaultProps.TEXTURE_TRIGGERS; + @SideOnly(Side.CLIENT) + public Icon getTextureIcon() { + switch (state) { + case Empty: + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Trigger_LiquidContainer_Empty]; + case Contains: + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Trigger_LiquidContainer_Contains]; + case Space: + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Trigger_LiquidContainer_Space]; + default: + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Trigger_LiquidContainer_Full]; + } } } diff --git a/common/buildcraft/core/triggers/TriggerMachine.java b/common/buildcraft/core/triggers/TriggerMachine.java index 2cdc1c74..7bdf92ec 100644 --- a/common/buildcraft/core/triggers/TriggerMachine.java +++ b/common/buildcraft/core/triggers/TriggerMachine.java @@ -9,11 +9,16 @@ package buildcraft.core.triggers; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.Icon; +import buildcraft.BuildCraftTransport; import buildcraft.api.gates.ITriggerParameter; import buildcraft.api.gates.Trigger; import buildcraft.core.DefaultProps; import buildcraft.core.IMachine; +import buildcraft.transport.IconItemConstants; public class TriggerMachine extends Trigger { @@ -25,14 +30,6 @@ public class TriggerMachine extends Trigger { this.active = active; } - @Override - public int getIndexInTexture() { - if (active) - return 4 * 16 + 0; - else - return 4 * 16 + 1; - } - @Override public String getDescription() { if (active) @@ -56,7 +53,11 @@ public class TriggerMachine extends Trigger { } @Override - public String getTexture() { - return DefaultProps.TEXTURE_TRIGGERS; + @SideOnly(Side.CLIENT) + public Icon getTextureIcon() { + if (active) + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Trigger_Machine_Active]; + else + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Trigger_Machine_Inactive]; } } diff --git a/common/buildcraft/energy/TriggerEngineHeat.java b/common/buildcraft/energy/TriggerEngineHeat.java index ad163e8c..4395093a 100644 --- a/common/buildcraft/energy/TriggerEngineHeat.java +++ b/common/buildcraft/energy/TriggerEngineHeat.java @@ -9,10 +9,15 @@ package buildcraft.energy; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.Icon; +import buildcraft.BuildCraftTransport; import buildcraft.api.gates.ITriggerParameter; import buildcraft.api.gates.Trigger; import buildcraft.core.DefaultProps; +import buildcraft.transport.IconItemConstants; public class TriggerEngineHeat extends Trigger { @@ -24,20 +29,6 @@ public class TriggerEngineHeat extends Trigger { this.stage = stage; } - @Override - public int getIndexInTexture() { - switch (stage) { - case Blue: - return 1 * 16 + 0; - case Green: - return 1 * 16 + 1; - case Yellow: - return 1 * 16 + 2; - default: - return 1 * 16 + 3; - } - } - @Override public String getDescription() { switch (stage) { @@ -64,7 +55,17 @@ public class TriggerEngineHeat extends Trigger { } @Override - public String getTexture() { - return DefaultProps.TEXTURE_TRIGGERS; + @SideOnly(Side.CLIENT) + public Icon getTextureIcon() { + switch (stage) { + case Blue: + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Trigger_EngineHeat_Blue]; + case Green: + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Trigger_EngineHeat_Green]; + case Yellow: + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Trigger_EngineHeat_Yellow]; + default: + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Trigger_EngineHeat_Red]; + } } } diff --git a/common/buildcraft/transport/IconItemConstants.java b/common/buildcraft/transport/IconItemConstants.java index 1a14cd8f..50cb8bf0 100644 --- a/common/buildcraft/transport/IconItemConstants.java +++ b/common/buildcraft/transport/IconItemConstants.java @@ -2,22 +2,57 @@ package buildcraft.transport; public class IconItemConstants { - public static final int Gate = 0; - public static final int Gate_Iron_And = 1; - public static final int Gate_Iron_Or = 2; - public static final int Gate_Gold_And = 3; - public static final int Gate_Gold_Or = 4; - public static final int Gate_Diamond_And = 5; - public static final int Gate_Diamond_Or = 6; + public static final int Gate = 0; + public static final int Gate_Iron_And = 1; + public static final int Gate_Iron_Or = 2; + public static final int Gate_Gold_And = 3; + public static final int Gate_Gold_Or = 4; + public static final int Gate_Diamond_And = 5; + public static final int Gate_Diamond_Or = 6; - public static final int Autarchic_Gate = 7; - public static final int Autarchic_Gate_Iron_And = 8; - public static final int Autarchic_Gate_Iron_Or = 9; - public static final int Autarchic_Gate_Gold_And = 10; - public static final int Autarchic_Gate_Gold_Or = 11; - public static final int Autarchic_Gate_Diamond_And = 12; - public static final int Autarchic_Gate_Diamond_Or = 13; + public static final int Autarchic_Gate = 7; + public static final int Autarchic_Gate_Iron_And = 8; + public static final int Autarchic_Gate_Iron_Or = 9; + public static final int Autarchic_Gate_Gold_And = 10; + public static final int Autarchic_Gate_Gold_Or = 11; + public static final int Autarchic_Gate_Diamond_And = 12; + public static final int Autarchic_Gate_Diamond_Or = 13; + + + public static final int Action_MachineControl_On = 14; + public static final int Action_MachineControl_Off = 15; + public static final int Action_MachineControl_Loop = 16; + + public static final int Trigger_EngineHeat_Blue = 18; + public static final int Trigger_EngineHeat_Green = 19; + public static final int Trigger_EngineHeat_Yellow = 20; + public static final int Trigger_EngineHeat_Red = 21; + public static final int Trigger_Inventory_Empty = 22; + public static final int Trigger_Inventory_Contains = 23; + public static final int Trigger_Inventory_Space = 24; + public static final int Trigger_Inventory_Full = 25; + public static final int Trigger_LiquidContainer_Empty = 26; + public static final int Trigger_LiquidContainer_Contains = 27; + public static final int Trigger_LiquidContainer_Space = 28; + public static final int Trigger_LiquidContainer_Full = 29; + public static final int Trigger_Machine_Active = 30; + public static final int Trigger_Machine_Inactive = 31; + public static final int Trigger_PipeContents_Empty = 32; + public static final int Trigger_PipeContents_ContainsItems = 33; + public static final int Trigger_PipeContents_ContainsLiquid = 34; + public static final int Trigger_PipeContents_ContainsEnergy = 35; + public static final int Trigger_PipeSignal_Red_Active = 36; + public static final int Trigger_PipeSignal_Blue_Active = 37; + public static final int Trigger_PipeSignal_Green_Active = 38; + public static final int Trigger_PipeSignal_Yellow_Active = 39; + public static final int Trigger_PipeSignal_Red_Inactive = 40; + public static final int Trigger_PipeSignal_Blue_Inactive = 41; + public static final int Trigger_PipeSignal_Green_Inactive = 42; + public static final int Trigger_PipeSignal_Yellow_Inactive = 43; + public static final int Trigger_RedstoneInput_Active = 44; + public static final int Trigger_RedstoneInput_Inactive = 45; - public static final int MAX = 14; + public static final int MAX = 46; + } diff --git a/common/buildcraft/transport/TransportProxyClient.java b/common/buildcraft/transport/TransportProxyClient.java index 625ff26d..ad9520d1 100644 --- a/common/buildcraft/transport/TransportProxyClient.java +++ b/common/buildcraft/transport/TransportProxyClient.java @@ -168,6 +168,39 @@ public class TransportProxyClient extends TransportProxy { instance.itemIcons[IconItemConstants.Autarchic_Gate_Gold_Or] = itemTextures.func_94245_a("buildcraft:autarchic_gate_gold_or"); instance.itemIcons[IconItemConstants.Autarchic_Gate_Diamond_And] = itemTextures.func_94245_a("buildcraft:autarchic_gate_diamond_and"); instance.itemIcons[IconItemConstants.Autarchic_Gate_Diamond_Or] = itemTextures.func_94245_a("buildcraft:autarchic_gate_diamond_or"); - + + instance.itemIcons[IconItemConstants.Action_MachineControl_On] = itemTextures.func_94245_a("buildcraft:triggers/action_machinecontrol_on"); + instance.itemIcons[IconItemConstants.Action_MachineControl_Off] = itemTextures.func_94245_a("buildcraft:triggers/action_machinecontrol_off"); + instance.itemIcons[IconItemConstants.Action_MachineControl_Loop] = itemTextures.func_94245_a("buildcraft:triggers/action_machinecontrol_loop"); + + instance.itemIcons[IconItemConstants.Trigger_EngineHeat_Blue] = itemTextures.func_94245_a("buildcraft:triggers/trigger_engineheat_blue"); + instance.itemIcons[IconItemConstants.Trigger_EngineHeat_Green] = itemTextures.func_94245_a("buildcraft:triggers/trigger_engineheat_green"); + instance.itemIcons[IconItemConstants.Trigger_EngineHeat_Yellow] = itemTextures.func_94245_a("buildcraft:triggers/trigger_engineheat_yellow"); + instance.itemIcons[IconItemConstants.Trigger_EngineHeat_Red] = itemTextures.func_94245_a("buildcraft:triggers/trigger_engineheat_red"); + instance.itemIcons[IconItemConstants.Trigger_Inventory_Empty] = itemTextures.func_94245_a("buildcraft:triggers/trigger_inventory_empty"); + instance.itemIcons[IconItemConstants.Trigger_Inventory_Contains] = itemTextures.func_94245_a("buildcraft:triggers/trigger_inventory_contains"); + instance.itemIcons[IconItemConstants.Trigger_Inventory_Space] = itemTextures.func_94245_a("buildcraft:triggers/trigger_inventory_space"); + instance.itemIcons[IconItemConstants.Trigger_Inventory_Full] = itemTextures.func_94245_a("buildcraft:triggers/trigger_inventory_full"); + instance.itemIcons[IconItemConstants.Trigger_LiquidContainer_Empty] = itemTextures.func_94245_a("buildcraft:triggers/trigger_liquidcontainer_empty"); + instance.itemIcons[IconItemConstants.Trigger_LiquidContainer_Contains] = itemTextures.func_94245_a("buildcraft:triggers/trigger_liquidcontainer_contains"); + instance.itemIcons[IconItemConstants.Trigger_LiquidContainer_Space] = itemTextures.func_94245_a("buildcraft:triggers/trigger_liquidcontainer_space"); + instance.itemIcons[IconItemConstants.Trigger_LiquidContainer_Full] = itemTextures.func_94245_a("buildcraft:triggers/trigger_liquidcontainer_full"); + instance.itemIcons[IconItemConstants.Trigger_Machine_Active] = itemTextures.func_94245_a("buildcraft:triggers/trigger_machine_active"); + instance.itemIcons[IconItemConstants.Trigger_Machine_Inactive] = itemTextures.func_94245_a("buildcraft:triggers/trigger_machine_inactive"); + instance.itemIcons[IconItemConstants.Trigger_PipeContents_Empty] = itemTextures.func_94245_a("buildcraft:triggers/trigger_pipecontents_empty"); + instance.itemIcons[IconItemConstants.Trigger_PipeContents_ContainsItems] = itemTextures.func_94245_a("buildcraft:triggers/trigger_pipecontents_containsitems"); + instance.itemIcons[IconItemConstants.Trigger_PipeContents_ContainsLiquid] = itemTextures.func_94245_a("buildcraft:triggers/trigger_pipecontents_containsliquid"); + instance.itemIcons[IconItemConstants.Trigger_PipeContents_ContainsEnergy] = itemTextures.func_94245_a("buildcraft:triggers/trigger_pipecontents_containsenergy"); + instance.itemIcons[IconItemConstants.Trigger_PipeSignal_Red_Active] = itemTextures.func_94245_a("buildcraft:triggers/trigger_pipesignal_red_active"); + instance.itemIcons[IconItemConstants.Trigger_PipeSignal_Red_Inactive] = itemTextures.func_94245_a("buildcraft:triggers/trigger_pipesignal_red_inactive"); + instance.itemIcons[IconItemConstants.Trigger_PipeSignal_Blue_Active] = itemTextures.func_94245_a("buildcraft:triggers/trigger_pipesignal_blue_active"); + instance.itemIcons[IconItemConstants.Trigger_PipeSignal_Blue_Inactive] = itemTextures.func_94245_a("buildcraft:triggers/trigger_pipesignal_blue_inactive"); + instance.itemIcons[IconItemConstants.Trigger_PipeSignal_Green_Active] = itemTextures.func_94245_a("buildcraft:triggers/trigger_pipesignal_green_active"); + instance.itemIcons[IconItemConstants.Trigger_PipeSignal_Green_Inactive] = itemTextures.func_94245_a("buildcraft:triggers/trigger_pipesignal_green_inactive"); + instance.itemIcons[IconItemConstants.Trigger_PipeSignal_Yellow_Active] = itemTextures.func_94245_a("buildcraft:triggers/trigger_pipesignal_yellow_active"); + instance.itemIcons[IconItemConstants.Trigger_PipeSignal_Yellow_Inactive] = itemTextures.func_94245_a("buildcraft:triggers/trigger_pipesignal_yellow_inactive"); + instance.itemIcons[IconItemConstants.Trigger_RedstoneInput_Active] = itemTextures.func_94245_a("buildcraft:triggers/trigger_redstoneinput_active"); + instance.itemIcons[IconItemConstants.Trigger_RedstoneInput_Inactive] = itemTextures.func_94245_a("buildcraft:triggers/trigger_redstoneinput_inactive"); + } } diff --git a/common/buildcraft/transport/gui/GuiGateInterface.java b/common/buildcraft/transport/gui/GuiGateInterface.java index 54c45e94..8cb76973 100644 --- a/common/buildcraft/transport/gui/GuiGateInterface.java +++ b/common/buildcraft/transport/gui/GuiGateInterface.java @@ -62,7 +62,7 @@ public class GuiGateInterface extends GuiAdvancedInterface { public Icon getTexture() { ITrigger trigger = pipe.getTrigger(slot); if (trigger != null) - return trigger.getTexture(); + return trigger.getTextureIcon(); else return null; } diff --git a/common/buildcraft/transport/triggers/ActionEnergyPulser.java b/common/buildcraft/transport/triggers/ActionEnergyPulser.java index 380aea0a..870b1e1b 100644 --- a/common/buildcraft/transport/triggers/ActionEnergyPulser.java +++ b/common/buildcraft/transport/triggers/ActionEnergyPulser.java @@ -1,7 +1,12 @@ package buildcraft.transport.triggers; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.util.Icon; +import buildcraft.BuildCraftTransport; import buildcraft.api.gates.Action; import buildcraft.core.DefaultProps; +import buildcraft.transport.IconItemConstants; public class ActionEnergyPulser extends Action { @@ -10,13 +15,9 @@ public class ActionEnergyPulser extends Action { } @Override - public int getIndexInTexture() { - return 4 * 16 + 0; - } - - @Override - public String getTexture() { - return DefaultProps.TEXTURE_TRIGGERS; + @SideOnly(Side.CLIENT) + public Icon getTexture() { + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Trigger_Machine_Active]; } @Override diff --git a/common/buildcraft/transport/triggers/ActionSignalOutput.java b/common/buildcraft/transport/triggers/ActionSignalOutput.java index d401d701..2febaf54 100644 --- a/common/buildcraft/transport/triggers/ActionSignalOutput.java +++ b/common/buildcraft/transport/triggers/ActionSignalOutput.java @@ -9,9 +9,14 @@ package buildcraft.transport.triggers; +import net.minecraft.util.Icon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import buildcraft.BuildCraftTransport; import buildcraft.api.gates.Action; import buildcraft.api.transport.IPipe; import buildcraft.core.DefaultProps; +import buildcraft.transport.IconItemConstants; public class ActionSignalOutput extends Action { @@ -23,22 +28,6 @@ public class ActionSignalOutput extends Action { this.color = color; } - @Override - public int getIndexInTexture() { - switch (color) { - case Red: - return 0 * 16 + 3; - case Blue: - return 0 * 16 + 5; - case Green: - return 0 * 16 + 7; - case Yellow: - return 0 * 16 + 9; - } - - return 0; - } - @Override public String getDescription() { switch (color) { @@ -56,7 +45,19 @@ public class ActionSignalOutput extends Action { } @Override - public String getTexture() { - return DefaultProps.TEXTURE_TRIGGERS; + @SideOnly(Side.CLIENT) + public Icon getTexture() { + switch (color) { + case Red: + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Trigger_PipeSignal_Red_Active]; + case Blue: + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Trigger_PipeSignal_Blue_Active]; + case Green: + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Trigger_PipeSignal_Green_Active]; + case Yellow: + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Trigger_PipeSignal_Yellow_Active]; + } + + return null; } } diff --git a/common/buildcraft/transport/triggers/TriggerPipeContents.java b/common/buildcraft/transport/triggers/TriggerPipeContents.java index 6aa90955..1bd4858e 100644 --- a/common/buildcraft/transport/triggers/TriggerPipeContents.java +++ b/common/buildcraft/transport/triggers/TriggerPipeContents.java @@ -9,15 +9,20 @@ package buildcraft.transport.triggers; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.util.Icon; import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.liquids.ILiquidTank; import net.minecraftforge.liquids.LiquidContainerRegistry; import net.minecraftforge.liquids.LiquidStack; +import buildcraft.BuildCraftTransport; import buildcraft.api.gates.ITriggerParameter; import buildcraft.api.gates.Trigger; import buildcraft.core.DefaultProps; import buildcraft.transport.EntityData; import buildcraft.transport.ITriggerPipe; +import buildcraft.transport.IconItemConstants; import buildcraft.transport.Pipe; import buildcraft.transport.PipeTransportItems; import buildcraft.transport.PipeTransportLiquids; @@ -36,21 +41,6 @@ public class TriggerPipeContents extends Trigger implements ITriggerPipe { this.kind = kind; } - @Override - public int getIndexInTexture() { - switch (kind) { - case Empty: - return 3 * 16 + 0; - case ContainsItems: - return 3 * 16 + 1; - case ContainsLiquids: - return 3 * 16 + 2; - case ContainsEnergy: - return 3 * 16 + 3; - } - return 3 * 16 + 0; - } - @Override public boolean hasParameter() { switch (kind) { @@ -139,8 +129,18 @@ public class TriggerPipeContents extends Trigger implements ITriggerPipe { } @Override - public String getTexture() { - return DefaultProps.TEXTURE_TRIGGERS; + @SideOnly(Side.CLIENT) + public Icon getTextureIcon() { + switch (kind) { + case Empty: + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Trigger_PipeContents_Empty]; + case ContainsItems: + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Trigger_PipeContents_ContainsItems]; + case ContainsLiquids: + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Trigger_PipeContents_ContainsLiquid]; + case ContainsEnergy: + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Trigger_PipeContents_ContainsEnergy]; + } + return null; } - } diff --git a/common/buildcraft/transport/triggers/TriggerPipeSignal.java b/common/buildcraft/transport/triggers/TriggerPipeSignal.java index b007d137..7a167b30 100644 --- a/common/buildcraft/transport/triggers/TriggerPipeSignal.java +++ b/common/buildcraft/transport/triggers/TriggerPipeSignal.java @@ -9,11 +9,16 @@ package buildcraft.transport.triggers; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.util.Icon; +import buildcraft.BuildCraftTransport; import buildcraft.api.gates.ITriggerParameter; import buildcraft.api.gates.Trigger; import buildcraft.api.transport.IPipe; import buildcraft.core.DefaultProps; import buildcraft.transport.ITriggerPipe; +import buildcraft.transport.IconItemConstants; import buildcraft.transport.Pipe; public class TriggerPipeSignal extends Trigger implements ITriggerPipe { @@ -28,35 +33,6 @@ public class TriggerPipeSignal extends Trigger implements ITriggerPipe { this.color = color; } - @Override - public int getIndexInTexture() { - if (active) { - switch (color) { - case Red: - return 0 * 16 + 3; - case Blue: - return 0 * 16 + 5; - case Green: - return 0 * 16 + 7; - case Yellow: - return 0 * 16 + 9; - } - } else { - switch (color) { - case Red: - return 0 * 16 + 2; - case Blue: - return 0 * 16 + 4; - case Green: - return 0 * 16 + 6; - case Yellow: - return 0 * 16 + 8; - } - } - - return 0; - } - @Override public boolean hasParameter() { return false; @@ -100,7 +76,32 @@ public class TriggerPipeSignal extends Trigger implements ITriggerPipe { } @Override - public String getTexture() { - return DefaultProps.TEXTURE_TRIGGERS; + @SideOnly(Side.CLIENT) + public Icon getTextureIcon() { + if (active) { + switch (color) { + case Red: + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Trigger_PipeSignal_Red_Active]; + case Blue: + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Trigger_PipeSignal_Blue_Active]; + case Green: + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Trigger_PipeSignal_Green_Active]; + case Yellow: + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Trigger_PipeSignal_Yellow_Active]; + } + } else { + switch (color) { + case Red: + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Trigger_PipeSignal_Red_Inactive]; + case Blue: + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Trigger_PipeSignal_Blue_Inactive]; + case Green: + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Trigger_PipeSignal_Green_Inactive]; + case Yellow: + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Trigger_PipeSignal_Yellow_Inactive]; + } + } + + return null; } } diff --git a/common/buildcraft/transport/triggers/TriggerRedstoneInput.java b/common/buildcraft/transport/triggers/TriggerRedstoneInput.java index e3d3833b..399af203 100644 --- a/common/buildcraft/transport/triggers/TriggerRedstoneInput.java +++ b/common/buildcraft/transport/triggers/TriggerRedstoneInput.java @@ -9,10 +9,15 @@ package buildcraft.transport.triggers; +import net.minecraft.util.Icon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import buildcraft.BuildCraftTransport; import buildcraft.api.gates.ITriggerParameter; import buildcraft.api.gates.Trigger; import buildcraft.core.DefaultProps; import buildcraft.transport.ITriggerPipe; +import buildcraft.transport.IconItemConstants; import buildcraft.transport.Pipe; public class TriggerRedstoneInput extends Trigger implements ITriggerPipe { @@ -25,14 +30,6 @@ public class TriggerRedstoneInput extends Trigger implements ITriggerPipe { this.active = active; } - @Override - public int getIndexInTexture() { - if (active) - return 0 * 16 + 0; - else - return 0 * 16 + 1; - } - @Override public String getDescription() { if (active) @@ -50,7 +47,11 @@ public class TriggerRedstoneInput extends Trigger implements ITriggerPipe { } @Override - public String getTexture() { - return DefaultProps.TEXTURE_TRIGGERS; + @SideOnly(Side.CLIENT) + public Icon getTextureIcon() { + if (active) + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Trigger_RedstoneInput_Active]; + else + return BuildCraftTransport.instance.itemIcons[IconItemConstants.Trigger_RedstoneInput_Inactive]; } }