Fixed Action/Trigger textures

This commit is contained in:
Krapht 2013-03-09 19:43:33 +01:00
parent 04726b05c1
commit 52b7ce7d36
47 changed files with 262 additions and 184 deletions

View file

@ -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

View file

@ -47,7 +47,7 @@ public abstract class Trigger implements ITrigger {
*/
@SideOnly(Side.CLIENT)
@Override
public abstract Icon getTexture();
public abstract Icon getTextureIcon();
/*
* (non-Javadoc)

View file

@ -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;
}
}
}

View file

@ -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];
}
}

View file

@ -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];
}
}
}

View file

@ -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];
}
}
}

View file

@ -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];
}
}

View file

@ -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];
}
}
}

View file

@ -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;
}

View file

@ -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");
}
}

View file

@ -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;
}

View file

@ -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

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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];
}
}