aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2022-01-19 14:31:09 +0000
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2022-01-19 14:33:27 +0000
commitc3e70a79b79294f6de6e6e553acd5f700f8898bb (patch)
treed51a36d2eb87162b467fe6f8bb05c6ee30632bf4
parentaa0267acca1030b96b95569472ee8663e5cb34b3 (diff)
downloadGT5-Unofficial-c3e70a79b79294f6de6e6e553acd5f700f8898bb.tar.gz
GT5-Unofficial-c3e70a79b79294f6de6e6e553acd5f700f8898bb.tar.bz2
GT5-Unofficial-c3e70a79b79294f6de6e6e553acd5f700f8898bb.zip
Added textures for Redstone Circuit Block.
Fixed GUI tooltips breaking block lighting. Fixed creative energy buffer not keeping it's tier on world load.
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_GUIContainer_ElectricAutoWorkbench.java5
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GT_GUIContainer_CropHarvestor.java5
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GUI_PollutionCleaner.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_GUIContainer_RedstoneCircuitBlock.java33
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/GUI_FluidReactor.java3
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_GUIContainer_AdvancedWorkbench.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java120
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneCircuitBlock.java143
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java12
9 files changed, 214 insertions, 111 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_GUIContainer_ElectricAutoWorkbench.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_GUIContainer_ElectricAutoWorkbench.java
index 7d381c0e8a..90f8380d14 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_GUIContainer_ElectricAutoWorkbench.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_GUIContainer_ElectricAutoWorkbench.java
@@ -7,6 +7,7 @@ import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.gregtech.api.gui.basic.GT_Container_CropHarvestor;
+import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.entity.player.InventoryPlayer;
public class GT_GUIContainer_ElectricAutoWorkbench extends GT_GUIContainerMetaTile_Machine {
@@ -53,7 +54,9 @@ public class GT_GUIContainer_ElectricAutoWorkbench extends GT_GUIContainerMetaTi
}*/
}
}
- if (!list.isEmpty())
+ if (!list.isEmpty()) {
drawHoveringText(list, x3, y3, fontRendererObj);
+ RenderHelper.enableGUIStandardItemLighting();
+ }
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GT_GUIContainer_CropHarvestor.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GT_GUIContainer_CropHarvestor.java
index ff2894f94a..504ae61b4a 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GT_GUIContainer_CropHarvestor.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GT_GUIContainer_CropHarvestor.java
@@ -7,6 +7,7 @@ import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.common.gui.GT_Container_Boiler;
import gtPlusPlus.core.lib.CORE;
+import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.entity.player.InventoryPlayer;
public class GT_GUIContainer_CropHarvestor extends GT_GUIContainerMetaTile_Machine {
@@ -65,8 +66,10 @@ public class GT_GUIContainer_CropHarvestor extends GT_GUIContainerMetaTile_Machi
list.add("Water: "+aWater+"L / "+((GT_Container_CropHarvestor) mContainer).mTileEntity.getMetaTileEntity().getCapacity()+"L");
}
}
- if (!list.isEmpty())
+ if (!list.isEmpty()) {
drawHoveringText(list, x, y, fontRendererObj);
+ RenderHelper.enableGUIStandardItemLighting();
+ }
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GUI_PollutionCleaner.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GUI_PollutionCleaner.java
index 3b96731f00..96e8e362ef 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GUI_PollutionCleaner.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GUI_PollutionCleaner.java
@@ -6,6 +6,7 @@ import java.util.List;
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gtPlusPlus.core.lib.CORE;
+import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.entity.player.InventoryPlayer;
public class GUI_PollutionCleaner extends GT_GUIContainerMetaTile_Machine {
@@ -52,6 +53,7 @@ public class GUI_PollutionCleaner extends GT_GUIContainerMetaTile_Machine {
}
if (!list.isEmpty()) {
this.drawHoveringText(list, x3, y3, this.fontRendererObj);
+ RenderHelper.enableGUIStandardItemLighting();
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_GUIContainer_RedstoneCircuitBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_GUIContainer_RedstoneCircuitBlock.java
index 89636fbaf2..53d60c3a68 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_GUIContainer_RedstoneCircuitBlock.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_GUIContainer_RedstoneCircuitBlock.java
@@ -1,11 +1,15 @@
package gtPlusPlus.xmod.gregtech.api.gui.computer;
+import java.util.ArrayList;
+import java.util.List;
+
import gregtech.api.GregTech_API;
import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_CircuitryBehavior;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.lib.CORE;
+import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.entity.player.InventoryPlayer;
public class GT_GUIContainer_RedstoneCircuitBlock extends GT_GUIContainerMetaTile_Machine {
@@ -36,6 +40,7 @@ public class GT_GUIContainer_RedstoneCircuitBlock extends GT_GUIContainerMetaTil
tString = tCircuit.getDataDisplay(((GT_Container_RedstoneCircuitBlock) mContainer).mData, 3);
this.fontRendererObj.drawString(tString == null ? GT_Utility.parseNumberToString(((GT_Container_RedstoneCircuitBlock) mContainer).mData[3]) : tString, 99, 66, 16448255);
}
+ this.drawTooltip(par1, par2);
}
@Override
@@ -59,4 +64,32 @@ public class GT_GUIContainer_RedstoneCircuitBlock extends GT_GUIContainerMetaTil
drawTexturedModalRect(x + 140, y + 9, 201, 0, 7, 7);
}
}
+
+ private void drawTooltip(final int x2, final int y2) {
+ final int xStart = (this.width - this.xSize) / 2;
+ final int yStart = (this.height - this.ySize) / 2;
+ final int x3 = x2 - xStart;
+ final int y3 = y2 - yStart + 5;
+ final List<String> list = new ArrayList<String>();
+
+ int y = 10;
+ if (x3 >= 151 && x3 <= 168) {
+ if (y3 >= y && y3 <= (y + 17)) {
+ list.add("Toggle EU Output");
+ }
+ if (y3 >= (y + 18) && y3 <= (y + 35)) {
+ list.add("Toggle Active State");
+ }
+ if (y3 >= (y + 36) && y3 <= (y + 53)) {
+ list.add("Change Redstone Circuit");
+ }
+ }
+
+ if (!list.isEmpty()) {
+ //RenderHelper.enableGUIStandardItemLighting();
+ this.drawHoveringText(list, x3, y3, this.fontRendererObj);
+ RenderHelper.enableGUIStandardItemLighting();
+ }
+ //RenderHelper.enableStandardItemLighting();
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/GUI_FluidReactor.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/GUI_FluidReactor.java
index 1be79b40cc..4d35df251c 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/GUI_FluidReactor.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/GUI_FluidReactor.java
@@ -7,6 +7,8 @@ import gtPlusPlus.core.lib.CORE;
import java.util.ArrayList;
import java.util.List;
+
+import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.entity.player.InventoryPlayer;
public class GUI_FluidReactor extends GT_GUIContainerMetaTile_Machine {
@@ -54,6 +56,7 @@ public class GUI_FluidReactor extends GT_GUIContainerMetaTile_Machine {
if (!list.isEmpty()) {
this.drawHoveringText(list, x, y, this.fontRendererObj);
+ RenderHelper.enableGUIStandardItemLighting();
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_GUIContainer_AdvancedWorkbench.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_GUIContainer_AdvancedWorkbench.java
index fc3041f553..094a7a7eb9 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_GUIContainer_AdvancedWorkbench.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_GUIContainer_AdvancedWorkbench.java
@@ -8,6 +8,7 @@ import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.sys.KeyboardUtils;
+import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.entity.player.InventoryPlayer;
public class GT_GUIContainer_AdvancedWorkbench extends GT_GUIContainerMetaTile_Machine {
@@ -71,6 +72,7 @@ public class GT_GUIContainer_AdvancedWorkbench extends GT_GUIContainerMetaTile_M
}
if (!list.isEmpty()) {
this.drawHoveringText(list, x3, y3, this.fontRendererObj);
+ RenderHelper.enableGUIStandardItemLighting();
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java
index a62a5d16c8..2e4e1ce7dd 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java
@@ -5,18 +5,12 @@ import static gregtech.api.enums.GT_Values.V;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.EnumChatFormatting;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.objects.GT_RenderedTexture;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.math.MathUtils;
@@ -26,34 +20,35 @@ import gtPlusPlus.core.util.sys.KeyboardUtils;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon;
import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GregtechMetaEnergyBuffer;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
*
- * This is the main construct for my Basic Machines such as the Automatic Extractor
- * Extend this class to make a simple Machine
+ * This is the main construct for my Basic Machines such as the Automatic
+ * Extractor Extend this class to make a simple Machine
*/
public class GregtechMetaCreativeEnergyBuffer extends GregtechMetaEnergyBuffer {
-
- public GregtechMetaCreativeEnergyBuffer(final String aName, final int aTier,
- final String aDescription, final ITexture[][][] aTextures, final int aSlotCount) {
+ private int mVoltageTier = 3;
+
+ public GregtechMetaCreativeEnergyBuffer(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures, final int aSlotCount) {
super(aName, aTier, aDescription, aTextures, aSlotCount);
// TODO Auto-generated constructor stub
}
- public GregtechMetaCreativeEnergyBuffer(final int aID, final String aName,
- final String aNameRegional, final int aTier, final String aDescription, final int aSlotCount) {
+ public GregtechMetaCreativeEnergyBuffer(final int aID, final String aName, final String aNameRegional, final int aTier, final String aDescription, final int aSlotCount) {
super(aID, aName, aNameRegional, aTier, aDescription, aSlotCount);
}
@Override
public String[] getDescription() {
- return new String[] {this.mDescription,
- "Use Screwdriver to change voltage",
- "Hold Shift while using Screwdriver to change amperage",
- EnumChatFormatting.GREEN+"CREATIVE MACHINE",
- CORE.GT_Tooltip};
+ return new String[]{this.mDescription, "Use Screwdriver to change voltage", "Hold Shift while using Screwdriver to change amperage", EnumChatFormatting.GREEN
+ + "CREATIVE MACHINE", CORE.GT_Tooltip};
}
/*
@@ -66,27 +61,23 @@ public class GregtechMetaCreativeEnergyBuffer extends GregtechMetaEnergyBuffer {
CustomIcon k;
boolean j = MathUtils.isNumberEven(this.mTier);
final ITexture[][][] rTextures = new ITexture[2][17][];
- k = j ? g : h;
+ k = j ? g : h;
for (byte i = -1; i < 16; i++) {
- rTextures[0][i + 1] = new ITexture[] { new GT_RenderedTexture(k) };
- rTextures[1][i + 1] = new ITexture[] {
- new GT_RenderedTexture(k), this.mInventory.length > 4 ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier]
- : Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] };
+ rTextures[0][i + 1] = new ITexture[]{new GT_RenderedTexture(k)};
+ rTextures[1][i
+ + 1] = new ITexture[]{new GT_RenderedTexture(k), this.mInventory.length > 4 ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] : Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]};
}
return rTextures;
}
@Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity,
- final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive,
- final boolean aRedstone) {
+ public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
return this.mTextures[aSide == aFacing ? 1 : 0][aColorIndex + 1];
}
@Override
public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) {
- return new GregtechMetaCreativeEnergyBuffer(this.mName, this.mTier, this.mDescription,
- this.mTextures, this.mInventory.length);
+ return new GregtechMetaCreativeEnergyBuffer(this.mName, this.mTier, this.mDescription, this.mTextures, this.mInventory.length);
}
@Override
@@ -101,43 +92,49 @@ public class GregtechMetaCreativeEnergyBuffer extends GregtechMetaEnergyBuffer {
@Override
public long maxEUInput() {
- return V[this.mTier];
+ return V[mVoltageTier];
}
@Override
public long maxEUOutput() {
- return V[this.mTier];
+ return V[mVoltageTier];
}
@Override
public long maxAmperesIn() {
- return 16;
+ return aCurrentOutputAmperage;
}
@Override
public long maxAmperesOut() {
- return 16;
+ return aCurrentOutputAmperage;
}
- @Override public int getProgresstime() {return Integer.MAX_VALUE;}
- @Override public int maxProgresstime() {return Integer.MAX_VALUE;}
- @Override public boolean isAccessAllowed(final EntityPlayer aPlayer) {return true;}
+ @Override
+ public int getProgresstime() {
+ return Integer.MAX_VALUE;
+ }
+ @Override
+ public int maxProgresstime() {
+ return Integer.MAX_VALUE;
+ }
+ @Override
+ public boolean isAccessAllowed(final EntityPlayer aPlayer) {
+ return true;
+ }
@Override
- public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
+ public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
return null;
}
@Override
- public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory,
- final IGregTechTileEntity aBaseMetaTileEntity) {
+ public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
return null;
}
@Override
public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
- this.getBaseMetaTileEntity().increaseStoredEnergyUnits(Integer.MAX_VALUE, true);
if (aBaseMetaTileEntity.isServerSide()) {
aBaseMetaTileEntity.increaseStoredEnergyUnits(Integer.MAX_VALUE, true);
}
@@ -156,12 +153,7 @@ public class GregtechMetaCreativeEnergyBuffer extends GregtechMetaEnergyBuffer {
@Override
public String[] getInfoData() {
String[] infoData = super.getInfoData();
- return new String[] {
- infoData[0],
- "THIS IS A CREATIVE ITEM - FOR TESTING | Tier: "+this.mTier,
- infoData[1],
- infoData[2]
- };
+ return new String[]{infoData[0], "THIS IS A CREATIVE ITEM - FOR TESTING | Tier: " + this.mTier, infoData[1], infoData[2]};
}
@Override
@@ -171,59 +163,59 @@ public class GregtechMetaCreativeEnergyBuffer extends GregtechMetaEnergyBuffer {
@Override
public void saveNBTData(NBTTagCompound aNBT) {
- aNBT.setByte("mTier", this.mTier);
+ aNBT.setInteger("mVoltageTier", this.mVoltageTier);
super.saveNBTData(aNBT);
}
@Override
public void loadNBTData(NBTTagCompound aNBT) {
+ this.mVoltageTier = aNBT.getInteger("mVoltageTier");
super.loadNBTData(aNBT);
- this.mTier = aNBT.getByte("mTier");
}
@Override
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
if (KeyboardUtils.isShiftKeyDown()) {
- super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
+ super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ);
}
else {
- if (this.mTier < (CORE.GTNH ? GT_Values.V.length-1 : 9)) {
- this.mTier++;
+ if (this.mVoltageTier < (GT_Values.VN[9].equals("UHV") ? GT_Values.V.length - 1 : 9)) {
+ this.mVoltageTier++;
}
else {
- this.mTier = 0;
+ this.mVoltageTier = 0;
}
this.markDirty();
try {
- Field field = ReflectionUtils.getField(this.getClass(), "mTextures");
+ Field field = ReflectionUtils.getField(this.getClass(), "mTextures");
field.setAccessible(true);
Field modifiersField = Field.class.getDeclaredField("modifiers");
modifiersField.setAccessible(true);
modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL);
ITexture[][][] V = getTextureSet(null);
if (V != null) {
- Logger.REFLECTION("Got Valid Textures.");
+ Logger.REFLECTION("Got Valid Textures.");
if (this.getBaseMetaTileEntity().isClientSide()) {
- Logger.REFLECTION("Clientside Call.");
+ Logger.REFLECTION("Clientside Call.");
Logger.REFLECTION("Refreshing Textures on buffer.");
field.set(this, V);
Logger.REFLECTION("Refreshed Textures on buffer.");
}
else {
- Logger.REFLECTION("Serverside Call.");
+ Logger.REFLECTION("Serverside Call.");
}
}
else {
- Logger.REFLECTION("Bad mTextures setter.");
- }
+ Logger.REFLECTION("Bad mTextures setter.");
+ }
}
catch (Throwable t) {
- //Bad refresh.
+ // Bad refresh.
t.printStackTrace();
Logger.REFLECTION("Bad mTextures setter.");
}
- PlayerUtils.messagePlayer(aPlayer, "Now running at "+GT_Values.VOLTAGE_NAMES[this.mTier]+".");
- }
-
+ PlayerUtils.messagePlayer(aPlayer, "Now running at " + GT_Values.VOLTAGE_NAMES[this.mTier] + ".");
+ }
+
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneCircuitBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneCircuitBlock.java
index e3779d1e9b..180091b2eb 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneCircuitBlock.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneCircuitBlock.java
@@ -3,15 +3,18 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.redstone;
import java.util.*;
import gregtech.api.GregTech_API;
+import gregtech.api.enums.GT_Values;
import gregtech.api.interfaces.IRedstoneCircuitBlock;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.ICoverable;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.objects.GT_ItemStack;
+import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.*;
import gtPlusPlus.xmod.gregtech.api.gui.computer.GT_Container_RedstoneCircuitBlock;
import gtPlusPlus.xmod.gregtech.api.gui.computer.GT_GUIContainer_RedstoneCircuitBlock;
+import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
@@ -25,18 +28,18 @@ public class GT_MetaTileEntity_RedstoneCircuitBlock extends GT_MetaTileEntity_Re
public boolean bOutput = true;
public GT_MetaTileEntity_RedstoneCircuitBlock(int aID) {
- super(aID, "redstone.circuit", "Redstone Circuit Block", 0, 0, "Computes Redstone");
+ super(aID, "redstone.circuit", "Redstone Circuit Block", 1, 5, "Computes Redstone");
}
public GT_MetaTileEntity_RedstoneCircuitBlock(final String aName, String aDescription, final ITexture[][][] aTextures) {
- super(aName, 0, 0, aDescription, aTextures);
+ super(aName, 1, 5, aDescription, aTextures);
}
@Override
public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new GT_MetaTileEntity_RedstoneCircuitBlock(this.mName, mDescription, this.mTextures);
}
-
+
@Override
public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) {
return new GT_Container_RedstoneCircuitBlock(aPlayerInventory, aBaseMetaTileEntity);
@@ -51,50 +54,75 @@ public class GT_MetaTileEntity_RedstoneCircuitBlock extends GT_MetaTileEntity_Re
public boolean hasSidedRedstoneOutputBehavior() {
return true;
}
-
+
@Override
public boolean isEnetInput() {
return true;
}
-
+
@Override
public boolean isEnetOutput() {
return true;
}
-
+
@Override
public boolean isInputFacing(byte aSide) {
- return !isOutputFacing(aSide);
+ return true;
+ }
+
+ @Override
+ public boolean isElectric() {
+ return true;
+ }
+
+ @Override
+ public boolean isPneumatic() {
+ return false;
+ }
+
+ @Override
+ public boolean isSteampowered() {
+ return false;
}
-
+
@Override
public boolean isOutputFacing(byte aSide) {
- return getBaseMetaTileEntity().getBackFacing() == aSide;
+ return true;
}
-
+
@Override
public long getMinimumStoredEU() {
- return 500;
+ return 512;
}
-
+
@Override
public long maxEUInput() {
- return 32;
+ return GT_Values.V[1];
}
-
+
@Override
public long maxEUOutput() {
- return bOutput ? 32 : 0;
+ return bOutput ? GT_Values.V[1] : 0;
}
-
+
+ @Override
+ public long maxAmperesIn() {
+ return 2;
+ }
+
+ @Override
+ public long maxAmperesOut() {
+ return 1;
+ }
+
@Override
public int getSizeInventory() {
return 5;
}
-
+
@Override
public long maxEUStore() {
- return 1000;
+ return GT_Values.V[3] * 1024;
}
@Override
@@ -106,7 +134,6 @@ public class GT_MetaTileEntity_RedstoneCircuitBlock extends GT_MetaTileEntity_Re
return true;
}
-
@Override
public void saveNBTData(NBTTagCompound aNBT) {
aNBT.setInteger("mGate", mGate);
@@ -202,9 +229,9 @@ public class GT_MetaTileEntity_RedstoneCircuitBlock extends GT_MetaTileEntity_Re
try {
tBehaviour.initParameters(mGateData, this);
}
- catch (Throwable e) {
- GT_Log.err.print(e);
- }
+ catch (Throwable e) {
+ GT_Log.err.print(e);
+ }
validateGateData();
}
@@ -214,9 +241,9 @@ public class GT_MetaTileEntity_RedstoneCircuitBlock extends GT_MetaTileEntity_Re
try {
tBehaviour.validateParameters(mGateData, this);
}
- catch (Throwable e) {
- GT_Log.err.print(e);
- }
+ catch (Throwable e) {
+ GT_Log.err.print(e);
+ }
}
@Override
@@ -232,7 +259,7 @@ public class GT_MetaTileEntity_RedstoneCircuitBlock extends GT_MetaTileEntity_Re
getBaseMetaTileEntity().setGenericRedstoneOutput(true);
if (getBaseMetaTileEntity().isAllowedToWork() && getBaseMetaTileEntity().isServerSide()) {
mInventory[0] = mInventory[1] = mInventory[2] = mInventory[3] = mInventory[4] = null;
- if (getBaseMetaTileEntity().getUniversalEnergyStored() > 400) {
+ if (getBaseMetaTileEntity().getUniversalEnergyStored() >= getMinimumStoredEU()) {
if (getBaseMetaTileEntity().isActive()) {
GT_CircuitryBehavior tBehaviour = GregTech_API.sCircuitryBehaviors.get(mGate);
if (tBehaviour != null) {
@@ -257,29 +284,28 @@ public class GT_MetaTileEntity_RedstoneCircuitBlock extends GT_MetaTileEntity_Re
else {
getBaseMetaTileEntity().setErrorDisplayID(1);
}
- }
+ }
}
-
/** The Item List for Covers */
public static final Map<Integer, ItemStack> sCoversItems = new HashMap<Integer, ItemStack>();
-
+
private static void initCovers() {
for (GT_ItemStack aKey : GregTech_API.sCovers.keySet()) {
ItemStack aStack = aKey.toStack().copy();
if (aStack != null) {
- sCoversItems.put(GT_Utility.stackToInt(aStack), aStack);
+ sCoversItems.put(GT_Utility.stackToInt(aStack), aStack);
}
}
}
-
+
public static ItemStack getCoverByID(int aStack) {
if (sCoversItems.isEmpty()) {
initCovers();
}
return sCoversItems.get(Integer.valueOf(aStack));
}
-
+
@Override
public byte getOutputFacing() {
return getBaseMetaTileEntity().getBackFacing();
@@ -378,14 +404,55 @@ public class GT_MetaTileEntity_RedstoneCircuitBlock extends GT_MetaTileEntity_Re
}
@Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- // TODO Auto-generated method stub
- return null;
+ public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ final ITexture[][][] rTextures = new ITexture[10][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = this.getSides(i);
+ rTextures[1][i + 1] = this.getSides(i);
+ rTextures[2][i + 1] = this.getBottom(i);
+ rTextures[3][i + 1] = this.getTop(i);
+ rTextures[4][i + 1] = this.getSides(i);
+ rTextures[5][i + 1] = this.getSidesActive(i);
+ rTextures[6][i + 1] = this.getSidesActive(i);
+ rTextures[7][i + 1] = this.getBottomActive(i);
+ rTextures[8][i + 1] = this.getTopActive(i);
+ rTextures[9][i + 1] = this.getSidesActive(i);
+ }
+ return rTextures;
}
@Override
- public ITexture[][][] getTextureSet(ITexture[] aTextures) {
- // TODO Auto-generated method stub
- return null;
+ public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
+ return this.mTextures[(aActive || hasRedstoneSignal() ? 5 : 0) + (aSide == aFacing ? 0 : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex
+ + 1];
}
+
+ private GT_RenderedTexture getBase() {
+ return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top);
+ }
+
+ public ITexture[] getTop(final byte aColor) {
+ return new ITexture[]{getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Top_Off)};
+ }
+
+ public ITexture[] getTopActive(final byte aColor) {
+ return new ITexture[]{getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Top_On)};
+ }
+
+ public ITexture[] getBottom(final byte aColor) {
+ return new ITexture[]{getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Bottom_Off)};
+ }
+
+ public ITexture[] getBottomActive(final byte aColor) {
+ return new ITexture[]{getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Bottom_On)};
+ }
+
+ public ITexture[] getSides(final byte aColor) {
+ return new ITexture[]{getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_Off)};
+ }
+
+ public ITexture[] getSidesActive(final byte aColor) {
+ return new ITexture[]{getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_On)};
+ }
+
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java
index 320e2175b0..5c7cfed334 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java
@@ -2,12 +2,6 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.storage;
import static gregtech.api.enums.GT_Values.V;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.world.World;
-
import gregtech.api.enums.Textures;
import gregtech.api.gui.GT_Container_1by1;
import gregtech.api.gui.GT_GUIContainer_1by1;
@@ -17,12 +11,16 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.objects.GT_ItemStack;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Utility;
-
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.minecraft.PlayerUtils;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMetaTileEntity;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.world.World;
public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity {