aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/tileentities
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2019-04-02 15:39:02 +1000
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2019-04-02 15:39:02 +1000
commitf6a126e4467c5bf7ab72249c7fc55df3bc574d94 (patch)
tree3b6d02bdb62185f56360d4a1ff93ce2cd1bcdbe3 /src/Java/gtPlusPlus/core/tileentities
parente8e899fb8ec40fc2a8094e3a1f65527af23b11e4 (diff)
downloadGT5-Unofficial-f6a126e4467c5bf7ab72249c7fc55df3bc574d94.tar.gz
GT5-Unofficial-f6a126e4467c5bf7ab72249c7fc55df3bc574d94.tar.bz2
GT5-Unofficial-f6a126e4467c5bf7ab72249c7fc55df3bc574d94.zip
+ Added TexturePackages.
$ More work on redstone systems.
Diffstat (limited to 'src/Java/gtPlusPlus/core/tileentities')
-rw-r--r--src/Java/gtPlusPlus/core/tileentities/general/redstone/TileEntityRedstoneHandler.java67
1 files changed, 56 insertions, 11 deletions
diff --git a/src/Java/gtPlusPlus/core/tileentities/general/redstone/TileEntityRedstoneHandler.java b/src/Java/gtPlusPlus/core/tileentities/general/redstone/TileEntityRedstoneHandler.java
index fbd5f4280d..163c4453b6 100644
--- a/src/Java/gtPlusPlus/core/tileentities/general/redstone/TileEntityRedstoneHandler.java
+++ b/src/Java/gtPlusPlus/core/tileentities/general/redstone/TileEntityRedstoneHandler.java
@@ -17,7 +17,9 @@ public class TileEntityRedstoneHandler extends TileEntity implements IToolable {
private BlockPos mTilePos;
private boolean mRequiresUpdate = false;
private Long mStartTime;
- private int mLightValue = 0;
+
+ public boolean mLightMode = false;
+ public int mLightValue = 0;
/**
* Sets the Redstone Handler Type.
@@ -30,13 +32,26 @@ public class TileEntityRedstoneHandler extends TileEntity implements IToolable {
public Block getBlock() {
return mTilePos != null ? mTilePos.getBlockAtPos() : Blocks.redstone_block;
}
+
+ public final boolean isLight() {
+ return mLightMode;
+ }
+ public final int getLightBrightness() {
+ if (!isLight()) {
+ return 0;
+ }
+ else {
+ return mLightValue;
+ }
+ }
@Override
public void readFromNBT(NBTTagCompound aNBT) {
mStartTime = aNBT.getLong("mStartTime");
mInvName = aNBT.getString("mInvName");
mLightValue = aNBT.getInteger("mLightValue");
+ mLightMode = aNBT.getBoolean("mLightMode");
super.readFromNBT(aNBT);
}
@@ -46,6 +61,7 @@ public class TileEntityRedstoneHandler extends TileEntity implements IToolable {
aNBT.setLong("mStartTime", mStartTime);
aNBT.setString("mInvName", mInvName);
aNBT.setInteger("mLightValue", mLightValue);
+ aNBT.setBoolean("mLightMode", mLightMode);
super.writeToNBT(aNBT);
}
@@ -250,6 +266,45 @@ public class TileEntityRedstoneHandler extends TileEntity implements IToolable {
}
+ public boolean providesWeakPower() {
+ return isProvidingPower();
+ }
+
+ public boolean providesStrongPower() {
+ return isProvidingPower();
+ }
+
+
+ /**
+ * Returns the amount of week power this block is providing to a side.
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @param side
+ * @return
+ */
+ public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int side) {
+ if (!providesWeakPower()) {
+ return 0;
+ }
+ return getOutputPowerLevel();
+ }
+ /**
+ * Returns the amount of strong power this block is providing to a side.
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @param side
+ * @return
+ */
+ public int isProvidingStrongPower(IBlockAccess world, int x, int y, int z, int side) {
+ if (!providesStrongPower()) {
+ return 0;
+ }
+ return getOutputPowerLevel();
+ }
@@ -379,16 +434,6 @@ public class TileEntityRedstoneHandler extends TileEntity implements IToolable {
public boolean hasCustomInventoryName() {
return (this.mInvName != null) && !this.mInvName.equals("");
}
-
- public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int side) {
- // TODO Auto-generated method stub
- return 0;
- }
-
- public int isProvidingStrongPower(IBlockAccess world, int x, int y, int z, int side) {
- // TODO Auto-generated method stub
- return 0;
- }