aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2022-01-20 17:17:04 +0000
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2022-01-20 17:17:04 +0000
commitbfbd1eb3123fefeb5dc66f29eb3b8ae18af6bb88 (patch)
tree76bf3e2f76be046a1f2a52f23111af73aab3ff91 /src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone
parent185f91e25a64c3832f8287cf70a3c3a01a1dd90c (diff)
downloadGT5-Unofficial-bfbd1eb3123fefeb5dc66f29eb3b8ae18af6bb88.tar.gz
GT5-Unofficial-bfbd1eb3123fefeb5dc66f29eb3b8ae18af6bb88.tar.bz2
GT5-Unofficial-bfbd1eb3123fefeb5dc66f29eb3b8ae18af6bb88.zip
Fixed Industrial Forge Hammer structure check.
Fixed Creative Energy Buffer some more. Fixed Redstone Circuit Block output. Did a little work on breaker boxes.
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone')
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneBase.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneCircuitBlock.java48
2 files changed, 45 insertions, 5 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneBase.java
index e15b0b6426..9bb2443683 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneBase.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneBase.java
@@ -88,7 +88,7 @@ public abstract class GT_MetaTileEntity_RedstoneBase extends GT_MetaTileEntity_T
mOpenerCount--;
}
- public final boolean hasRedstoneSignal() {
+ public boolean hasRedstoneSignal() {
if (getBaseMetaTileEntity().getStrongestRedstone() > 0) {
return true;
}
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 180091b2eb..379345ec6a 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
@@ -4,6 +4,8 @@ import java.util.*;
import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.Textures;
+import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.IRedstoneCircuitBlock;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.ICoverable;
@@ -67,7 +69,7 @@ public class GT_MetaTileEntity_RedstoneCircuitBlock extends GT_MetaTileEntity_Re
@Override
public boolean isInputFacing(byte aSide) {
- return true;
+ return !this.isOutputFacing(aSide);
}
@Override
@@ -87,7 +89,7 @@ public class GT_MetaTileEntity_RedstoneCircuitBlock extends GT_MetaTileEntity_Re
@Override
public boolean isOutputFacing(byte aSide) {
- return true;
+ return aSide == this.getOutputFacing();
}
@Override
@@ -286,6 +288,36 @@ public class GT_MetaTileEntity_RedstoneCircuitBlock extends GT_MetaTileEntity_Re
}
}
}
+
+ @Override
+ public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+ //Only Calc server-side
+ if (!this.getBaseMetaTileEntity().isServerSide()) {
+ return;
+ }
+ //Emit Redstone
+ for (byte i=0;i<6;i++) {
+ byte aRedstone = getBaseMetaTileEntity().getOutputRedstoneSignal(i);
+ this.getBaseMetaTileEntity().setInternalOutputRedstoneSignal(i, aRedstone);
+ }
+
+ }
+
+ @Override
+ public final boolean hasRedstoneSignal() {
+ for (byte i=0;i<6;i++) {
+ if (getBaseMetaTileEntity().getOutputRedstoneSignal(i) > 0) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean allowGeneralRedstoneOutput() {
+ return true;
+ }
/** The Item List for Covers */
public static final Map<Integer, ItemStack> sCoversItems = new HashMap<Integer, ItemStack>();
@@ -408,12 +440,12 @@ public class GT_MetaTileEntity_RedstoneCircuitBlock extends GT_MetaTileEntity_Re
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[1][i + 1] = this.getBack(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[6][i + 1] = this.getBackActive(i);
rTextures[7][i + 1] = this.getBottomActive(i);
rTextures[8][i + 1] = this.getTopActive(i);
rTextures[9][i + 1] = this.getSidesActive(i);
@@ -438,6 +470,14 @@ public class GT_MetaTileEntity_RedstoneCircuitBlock extends GT_MetaTileEntity_Re
public ITexture[] getTopActive(final byte aColor) {
return new ITexture[]{getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Top_On)};
}
+
+ public ITexture[] getBack(final byte aColor) {
+ return new ITexture[] {getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_Off), new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Red)};
+ }
+
+ public ITexture[] getBackActive(final byte aColor) {
+ return new ITexture[] {getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_On), new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Red_Redstone)};
+ }
public ITexture[] getBottom(final byte aColor) {
return new ITexture[]{getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Bottom_Off)};