aboutsummaryrefslogtreecommitdiff
path: root/src/Java/miscutil/gregtech/metatileentity/implementations/base
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2016-03-21 02:46:32 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2016-03-21 02:46:32 +1000
commitb6ee1cacc50dec9ee65d30d8d62f0fbe1591bdc7 (patch)
treecb6f45036f4366623a908a2dfdfa809ce5869df8 /src/Java/miscutil/gregtech/metatileentity/implementations/base
parente667f347a505929d34883b5abf595d3d6111f730 (diff)
downloadGT5-Unofficial-b6ee1cacc50dec9ee65d30d8d62f0fbe1591bdc7.tar.gz
GT5-Unofficial-b6ee1cacc50dec9ee65d30d8d62f0fbe1591bdc7.tar.bz2
GT5-Unofficial-b6ee1cacc50dec9ee65d30d8d62f0fbe1591bdc7.zip
Final version of safes for now.
Cleaned up some handler code and left some new classes in for future use. Also, skipped a build and brought a fresh one along.
Diffstat (limited to 'src/Java/miscutil/gregtech/metatileentity/implementations/base')
-rw-r--r--src/Java/miscutil/gregtech/metatileentity/implementations/base/GregtechMetaSafeBlockBase.java28
1 files changed, 23 insertions, 5 deletions
diff --git a/src/Java/miscutil/gregtech/metatileentity/implementations/base/GregtechMetaSafeBlockBase.java b/src/Java/miscutil/gregtech/metatileentity/implementations/base/GregtechMetaSafeBlockBase.java
index 76b87b0b9b..7e6eb1d9cf 100644
--- a/src/Java/miscutil/gregtech/metatileentity/implementations/base/GregtechMetaSafeBlockBase.java
+++ b/src/Java/miscutil/gregtech/metatileentity/implementations/base/GregtechMetaSafeBlockBase.java
@@ -7,6 +7,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Utility;
+import miscutil.core.handler.UnbreakableBlockManager;
import miscutil.core.util.PlayerCache;
import miscutil.core.util.Utils;
import net.minecraft.entity.player.EntityPlayer;
@@ -17,6 +18,8 @@ public abstract class GregtechMetaSafeBlockBase extends GT_MetaTileEntity_Tiered
public boolean bOutput = false, bRedstoneIfFull = false, bInvert = false, bUnbreakable = false;
public int mSuccess = 0, mTargetStackSize = 0;
public String ownerUUID = "";
+ UnbreakableBlockManager Xasda = new UnbreakableBlockManager();
+ private boolean value_last = false, value_current = false;
public GregtechMetaSafeBlockBase(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription) {
super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription);
@@ -198,7 +201,7 @@ public abstract class GregtechMetaSafeBlockBase extends GT_MetaTileEntity_Tiered
Utils.LOG_WARNING("OwnerUUID is Null, let's set it.");
Utils.LOG_WARNING("Accessing Players UUID is: "+tempUUID);
ownerUUID = tempUUID;
- Utils.messagePlayer(aPlayer, "Owner of this safe, now set. Try accessing it again.");
+ //Utils.messagePlayer(aPlayer, "Owner of this safe, now set. Try accessing it again.");
Utils.LOG_WARNING("Block Owner is now set to: "+ownerUUID);
}
Utils.LOG_WARNING("No, it is not.");
@@ -273,13 +276,28 @@ public abstract class GregtechMetaSafeBlockBase extends GT_MetaTileEntity_Tiered
/*if (aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isUniversalEnergyStored(getMinimumStoredEU()) && (aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified() || aTimer % 200 == 0 || mSuccess > 0)) {
*/
if (aBaseMetaTileEntity.isServerSide() && (aBaseMetaTileEntity.hasWorkJustBeenEnabled() || aBaseMetaTileEntity.hasInventoryBeenModified() || aTimer % 200 == 0 || mSuccess > 0)) {
-
- if (bUnbreakable = true){
-
+ value_last = value_current;
+ value_current = bUnbreakable;
+ if (value_last != value_current){
+ Utils.LOG_WARNING("VALUE CHANGE - Ticking for a moment.");
+ if (bUnbreakable == true){
+ //Xasda.setmTileEntity((BaseMetaTileEntity) aBaseMetaTileEntity);
+ //Utils.LOG_ERROR("Safe is Indestructible.");
+ this.getBaseMetaTileEntity().getBlock(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()).setResistance(Float.MAX_VALUE);
+ this.getBaseMetaTileEntity().getBlock(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()).setBlockUnbreakable();
+ }
+ else {
+ //Xasda.setmTileEntity((BaseMetaTileEntity) aBaseMetaTileEntity);
+ //Utils.LOG_ERROR("Safe is not Indestructible.");
+ this.getBaseMetaTileEntity().getBlock(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()).setResistance(1F);
+ this.getBaseMetaTileEntity().getBlock(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()).setHardness(2);
+
+ }
}
else {
-
+
}
+