aboutsummaryrefslogtreecommitdiff
path: root/src/Java/miscutil/gregtech/gui/CONTAINER_SafeBlock.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/miscutil/gregtech/gui/CONTAINER_SafeBlock.java')
-rw-r--r--src/Java/miscutil/gregtech/gui/CONTAINER_SafeBlock.java136
1 files changed, 82 insertions, 54 deletions
diff --git a/src/Java/miscutil/gregtech/gui/CONTAINER_SafeBlock.java b/src/Java/miscutil/gregtech/gui/CONTAINER_SafeBlock.java
index 62985e6988..eff42eb4d5 100644
--- a/src/Java/miscutil/gregtech/gui/CONTAINER_SafeBlock.java
+++ b/src/Java/miscutil/gregtech/gui/CONTAINER_SafeBlock.java
@@ -5,56 +5,69 @@ import gregtech.api.gui.GT_Slot_Holo;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.BaseMetaTileEntity;
import gregtech.api.util.GT_Utility;
+import miscutil.core.handler.UnbreakableBlockManager;
import miscutil.core.util.Utils;
import miscutil.gregtech.metatileentity.implementations.GregtechMetaSafeBlock;
import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
+import org.lwjgl.Sys;
+
public class CONTAINER_SafeBlock
- extends GT_ContainerMetaTile_Machine {
- public CONTAINER_SafeBlock(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
- super(aInventoryPlayer, aTileEntity);
- }
-
- public String UUID = ((BaseMetaTileEntity)mTileEntity).getMetaTileEntity().getBaseMetaTileEntity().getOwnerName();
- public String ownerUUID = ((GregtechMetaSafeBlock)this.mTileEntity.getMetaTileEntity()).ownerUUID;
- public boolean blockStatus = ((GregtechMetaSafeBlock)this.mTileEntity.getMetaTileEntity()).bUnbreakable;
+extends GT_ContainerMetaTile_Machine {
+ public CONTAINER_SafeBlock(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ //public String UUID = ((BaseMetaTileEntity)mTileEntity).getMetaTileEntity().getBaseMetaTileEntity().getOwnerName();
+ public String ownerUUID = ((GregtechMetaSafeBlock)this.mTileEntity.getMetaTileEntity()).ownerUUID;
+ public boolean blockStatus = ((GregtechMetaSafeBlock)this.mTileEntity.getMetaTileEntity()).bUnbreakable;
- @Override
+ @Override
public void addSlots(InventoryPlayer aInventoryPlayer) {
- for (int y = 0; y < 3; y++) {
- for (int x = 0; x < 9; x++) {
- addSlotToContainer(new Slot(this.mTileEntity, x + y * 9, 8 + x * 18, 5 + y * 18));
- }
- }
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 27, 8, 63, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 27, 26, 63, false, true, 1));
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 27, 44, 63, false, true, 1));
- }
+ for (int y = 0; y < 3; y++) {
+ for (int x = 0; x < 9; x++) {
+ addSlotToContainer(new Slot(this.mTileEntity, x + y * 9, 8 + x * 18, 5 + y * 18));
+ }
+ }
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 27, 8, 63, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 27, 26, 63, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 27, 44, 63, false, true, 1));
+ }
- @Override
+ @Override
public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
- if (aSlotIndex < 27) {
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- }
- Slot tSlot = (Slot) this.inventorySlots.get(aSlotIndex);
- if (tSlot != null) {
- if (this.mTileEntity.getMetaTileEntity() == null) {
- return null;
- }
- /* if (aSlotIndex == 27) {
+ int runs = 0;
+ if (aSlotIndex < 27) {
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
+ Slot tSlot = (Slot) this.inventorySlots.get(aSlotIndex);
+ if (tSlot != null) {
+ if (this.mTileEntity.getMetaTileEntity() == null) {
+ return null;
+ }
+ if (aSlotIndex == 27) {
+
+
((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bOutput = (!((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bOutput);
if (((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bOutput) {
+ if (aPlayer != null && aPlayer instanceof EntityPlayerMP && (((GregtechMetaSafeBlock)this.mTileEntity.getMetaTileEntity()).bOutput != false)) {
+
+ Utils.LOG_INFO(String.valueOf(Sys.is64Bit()));
+ Utils.messagePlayer(aPlayer, "Salmon");
+ }
+
GT_Utility.sendChatToPlayer(aPlayer, "Emit Energy to Outputside");
} else {
GT_Utility.sendChatToPlayer(aPlayer, "Don't emit Energy");
}
return null;
- }
- if (aSlotIndex == 28) {
- ((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull = (!((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull);
+ }
+ if (aSlotIndex == 28) {}
+ /* ((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull = (!((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull);
if (((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull) {
GT_Utility.sendChatToPlayer(aPlayer, "Emit Redstone if no Slot is free");
} else {
@@ -62,31 +75,46 @@ public class CONTAINER_SafeBlock
}
return null;
}*/
- if (aSlotIndex == 29) {
- ((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bUnbreakable = (!((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bUnbreakable);
- if (((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bUnbreakable) {
- GT_Utility.sendChatToPlayer(aPlayer, "Block is now unbreakable.");
- // World world;
- //world.markBlockForUpdate(x, y, z);
- //this.updateProgressBar(par1, par2);
- //PlayerCache.appendParamChanges(aPlayer.getDisplayName(), aPlayer.getUniqueID().toString());
- } else {
- GT_Utility.sendChatToPlayer(aPlayer, "Block is now breakable.");
- Utils.LOG_WARNING("Owner Name - From GT Values: "+UUID);
- }
- return null;
- }
- }
- return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
- }
+ if (aSlotIndex == 29) /*{
+ if (((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bUnbreakable) {
+ if (((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bUnbreakable) {
+ makeIndestructible(aPlayer);
+ }
+ else {
- @Override
+ }
+ } else {
+ makeIndestructible(aPlayer);
+ }
+ return null;
+ }*/
+
+ {
+ ((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bUnbreakable = (!((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity()).bUnbreakable);
+ if (aPlayer != null && aPlayer instanceof EntityPlayerMP && (((GregtechMetaSafeBlock)this.mTileEntity.getMetaTileEntity()).bUnbreakable != false)) {
+ UnbreakableBlockManager Xasda = new UnbreakableBlockManager();
+ Xasda.setmTileEntity((BaseMetaTileEntity) mTileEntity, aPlayer);
+ }
+ else {
+ UnbreakableBlockManager Xasda = new UnbreakableBlockManager();
+ Xasda.setmTileEntity((BaseMetaTileEntity) mTileEntity, aPlayer);
+ }
+ return null;
+ }
+
+
+ }
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
+
+ @Override
public int getSlotCount() {
- return 27;
- }
+ return 27;
+ }
- @Override
+ @Override
public int getShiftClickSlotCount() {
- return 27;
- }
+ return 27;
+ }
+
}