diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java | 2 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java | 36 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/core/lib/CORE.java | 2 |
3 files changed, 38 insertions, 2 deletions
diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java index 5d3244ff58..90da27914a 100644 --- a/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java +++ b/src/Java/gtPlusPlus/core/item/base/BaseItemComponent.java @@ -25,6 +25,7 @@ public class BaseItemComponent extends Item{ public final String unlocalName; public final ComponentTypes componentType; public final int componentColour; + public Object extraData; public BaseItemComponent(Material material, ComponentTypes componentType) { this.componentMaterial = material; @@ -50,6 +51,7 @@ public class BaseItemComponent extends Item{ this.setUnlocalizedName(unlocalName); this.setMaxStackSize(64); this.componentColour = MathUtils.getRgbAsHex(RGBA); + this.extraData = RGBA; this.setTextureName(CORE.MODID + ":" + "item"+ComponentTypes.CELL.COMPONENT_NAME); GameRegistry.registerItem(this, unlocalName); GT_OreDictUnificator.registerOre(ComponentTypes.CELL.getOreDictName()+unlocalName, ItemUtils.getSimpleStack(this)); diff --git a/src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java b/src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java index 567b9c1ba8..2c3ee38048 100644 --- a/src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java +++ b/src/Java/gtPlusPlus/core/item/base/cell/BaseItemCell.java @@ -14,10 +14,13 @@ public class BaseItemCell extends BaseItemComponent{ private IIcon base; private IIcon overlay; + private final Material cellMaterial; ComponentTypes Cell = ComponentTypes.CELL; public BaseItemCell(Material material) { - super(material, BaseItemComponent.ComponentTypes.CELL); + super(material, BaseItemComponent.ComponentTypes.CELL); + this.cellMaterial = material; + fluidColour = (short[]) ((cellMaterial == null) ? extraData : cellMaterial.getRGBA()); } @Override @@ -30,13 +33,42 @@ public class BaseItemCell extends BaseItemComponent{ public void registerIcons(IIconRegister i) { this.base = i.registerIcon(CORE.MODID + ":" + "item"+Cell.getComponent()); this.overlay = i.registerIcon(CORE.MODID + ":" + "item"+Cell.getComponent()+"_Overlay"); + //this.overlay = cellMaterial.getFluid(1000).getFluid().get } + private int fluidBright = 0; + private int tickValue; + private short fluidColour[]; + boolean upwards = true; + @Override public int getColorFromItemStack(ItemStack stack, int renderPass) { if (renderPass == 0){ return Utils.rgbtoHexValue(230, 230, 230); - } + } + + + /*if (tickValue == 20){ + if (upwards){ + fluidBright++; + } + else { + fluidBright--; + } + if (fluidBright <= 0 || fluidBright >= 20){ + if (fluidBright <= 0) upwards = true; + if (fluidBright >= 20) upwards = false; + } + } + + if (tickValue > 20){ + tickValue=0; + } + else { + tickValue++; + } + + return Utils.rgbtoHexValue(fluidColour[0]+fluidBright, fluidColour[1]+fluidBright, fluidColour[2]+fluidBright);*/ return componentColour; } diff --git a/src/Java/gtPlusPlus/core/lib/CORE.java b/src/Java/gtPlusPlus/core/lib/CORE.java index 7b1a1fe86e..a72e41caa7 100644 --- a/src/Java/gtPlusPlus/core/lib/CORE.java +++ b/src/Java/gtPlusPlus/core/lib/CORE.java @@ -1,5 +1,6 @@ package gtPlusPlus.core.lib; +import gregtech.api.GregTech_API; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.gregtech.recipehandlers.GregtechRecipe; import gtPlusPlus.core.util.networking.NetworkUtils; @@ -27,6 +28,7 @@ public class CORE { public static Map PlayerCache; public static final String[] VOLTAGES = {"ULV","LV","MV","HV","EV","IV","LuV","ZPM","UV","MAX"}; public static final boolean MAIN_GREGTECH_5U_EXPERIMENTAL_FORK = Meta_GT_Proxy.areWeUsingGregtech5uExperimental(); + public static final int GREGTECH_API_VERSION = GregTech_API.VERSION; public static IGregtech_RecipeAdder RA; @Deprecated public static IGregtech_RecipeAdder sRecipeAdder; |