aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/gui
diff options
context:
space:
mode:
authorRaven Szewczyk <git@eigenraven.me>2022-08-27 10:19:57 +0100
committerGitHub <noreply@github.com>2022-08-27 11:19:57 +0200
commit6f31720697bcc351421a4d86ba3bf749375dd12c (patch)
tree3adf8f318f22c892d74cd7c9d30b6dd3f11f11bd /src/main/java/gregtech/common/gui
parentc3eac50decd33ee2be8703dfb2ecf9cdc31c2b67 (diff)
downloadGT5-Unofficial-6f31720697bcc351421a4d86ba3bf749375dd12c.tar.gz
GT5-Unofficial-6f31720697bcc351421a4d86ba3bf749375dd12c.tar.bz2
GT5-Unofficial-6f31720697bcc351421a4d86ba3bf749375dd12c.zip
Update buildscript & apply spotless (#1306)
* Update dependencies * Update buildscript, apply spotless
Diffstat (limited to 'src/main/java/gregtech/common/gui')
-rw-r--r--src/main/java/gregtech/common/gui/GT_Container_Boiler.java21
-rw-r--r--src/main/java/gregtech/common/gui/GT_Container_ChestBuffer.java36
-rw-r--r--src/main/java/gregtech/common/gui/GT_Container_Filter.java44
-rw-r--r--src/main/java/gregtech/common/gui/GT_Container_IndustrialApiary.java116
-rw-r--r--src/main/java/gregtech/common/gui/GT_Container_InputBus_ME.java58
-rw-r--r--src/main/java/gregtech/common/gui/GT_Container_ItemDistributor.java21
-rw-r--r--src/main/java/gregtech/common/gui/GT_Container_MicrowaveEnergyTransmitter.java54
-rw-r--r--src/main/java/gregtech/common/gui/GT_Container_OutputHatch.java14
-rw-r--r--src/main/java/gregtech/common/gui/GT_Container_PrimitiveBlastFurnace.java3
-rw-r--r--src/main/java/gregtech/common/gui/GT_Container_Regulator.java14
-rw-r--r--src/main/java/gregtech/common/gui/GT_Container_SuperBuffer.java36
-rw-r--r--src/main/java/gregtech/common/gui/GT_Container_Teleporter.java57
-rw-r--r--src/main/java/gregtech/common/gui/GT_GUIContainerVolumetricFlask.java36
-rw-r--r--src/main/java/gregtech/common/gui/GT_GUIContainer_Boiler.java3
-rw-r--r--src/main/java/gregtech/common/gui/GT_GUIContainer_BronzeBlastFurnace.java24
-rw-r--r--src/main/java/gregtech/common/gui/GT_GUIContainer_FusionReactor.java39
-rw-r--r--src/main/java/gregtech/common/gui/GT_GUIContainer_IndustrialApiary.java157
-rw-r--r--src/main/java/gregtech/common/gui/GT_GUIContainer_InputBus_ME.java48
-rw-r--r--src/main/java/gregtech/common/gui/GT_GUIContainer_ItemDistributor.java4
-rw-r--r--src/main/java/gregtech/common/gui/GT_GUIContainer_MicrowaveEnergyTransmitter.java60
-rw-r--r--src/main/java/gregtech/common/gui/GT_GUIContainer_OutputHatch.java37
-rw-r--r--src/main/java/gregtech/common/gui/GT_GUIContainer_PrimitiveBlastFurnace.java31
-rw-r--r--src/main/java/gregtech/common/gui/GT_GUIContainer_QuantumChest.java24
-rw-r--r--src/main/java/gregtech/common/gui/GT_GUIContainer_RecipeFilter.java18
-rw-r--r--src/main/java/gregtech/common/gui/GT_GUIContainer_Regulator.java27
-rw-r--r--src/main/java/gregtech/common/gui/GT_GUIContainer_Teleporter.java44
26 files changed, 620 insertions, 406 deletions
diff --git a/src/main/java/gregtech/common/gui/GT_Container_Boiler.java b/src/main/java/gregtech/common/gui/GT_Container_Boiler.java
index d534c2e8ba..a29e732f07 100644
--- a/src/main/java/gregtech/common/gui/GT_Container_Boiler.java
+++ b/src/main/java/gregtech/common/gui/GT_Container_Boiler.java
@@ -14,6 +14,7 @@ public class GT_Container_Boiler extends GT_ContainerMetaTile_Machine {
public int mSteamAmount = 0;
public int mProcessingEnergy = 0;
public int mTemperature = 2;
+
public GT_Container_Boiler(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
super(aInventoryPlayer, aTileEntity);
}
@@ -48,13 +49,25 @@ public class GT_Container_Boiler extends GT_ContainerMetaTile_Machine {
this.mTemperature = ((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).mTemperature;
this.mProcessingEnergy = ((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).mProcessingEnergy;
- this.mSteamAmount = (((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).mSteam == null ? 0 : ((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).mSteam.amount);
- this.mWaterAmount = (((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).mFluid == null ? 0 : ((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).mFluid.amount);
+ this.mSteamAmount = (((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).mSteam == null
+ ? 0
+ : ((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).mSteam.amount);
+ this.mWaterAmount = (((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).mFluid == null
+ ? 0
+ : ((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).mFluid.amount);
- this.mTemperature = Math.min(54, Math.max(0, this.mTemperature * 54 / (((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).maxProgresstime() - 10)));
+ this.mTemperature = Math.min(
+ 54,
+ Math.max(
+ 0,
+ this.mTemperature
+ * 54
+ / (((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).maxProgresstime()
+ - 10)));
this.mSteamAmount = Math.min(54, Math.max(0, this.mSteamAmount * 54 / (capacity - 100)));
this.mWaterAmount = Math.min(54, Math.max(0, this.mWaterAmount * 54 / (capacity - 100)));
- this.mProcessingEnergy = Math.min(14, Math.max(this.mProcessingEnergy > 0 ? 1 : 0, this.mProcessingEnergy * 14 / 1000));
+ this.mProcessingEnergy =
+ Math.min(14, Math.max(this.mProcessingEnergy > 0 ? 1 : 0, this.mProcessingEnergy * 14 / 1000));
for (Object crafter : this.crafters) {
ICrafting player = (ICrafting) crafter;
diff --git a/src/main/java/gregtech/common/gui/GT_Container_ChestBuffer.java b/src/main/java/gregtech/common/gui/GT_Container_ChestBuffer.java
index 827a7d2d10..afa22a738b 100644
--- a/src/main/java/gregtech/common/gui/GT_Container_ChestBuffer.java
+++ b/src/main/java/gregtech/common/gui/GT_Container_ChestBuffer.java
@@ -39,38 +39,50 @@ public class GT_Container_ChestBuffer extends GT_ContainerMetaTile_Machine {
return null;
}
if (aSlotIndex == 27) {
- ((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bOutput = (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bOutput);
+ ((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bOutput =
+ (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bOutput);
if (((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bOutput) {
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("116","Emit Energy to Outputside"));
+ GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("116", "Emit Energy to Outputside"));
} else {
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("117","Don't emit Energy"));
+ GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("117", "Don't emit Energy"));
}
return null;
}
if (aSlotIndex == 28) {
- ((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull = (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull);
+ ((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull =
+ (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull);
if (((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull) {
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("118","Emit Redstone if no Slot is free"));
+ GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("118", "Emit Redstone if no Slot is free"));
} else {
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("119","Don't emit Redstone"));
+ GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("119", "Don't emit Redstone"));
}
return null;
}
if (aSlotIndex == 29) {
- ((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bInvert = (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bInvert);
+ ((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bInvert =
+ (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bInvert);
if (((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bInvert) {
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("120","Invert Redstone"));
+ GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("120", "Invert Redstone"));
} else {
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("121","Don't invert Redstone"));
+ GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("121", "Don't invert Redstone"));
}
return null;
}
if (aSlotIndex == 30) {
- ((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bStockingMode = (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bStockingMode);
+ ((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bStockingMode =
+ (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bStockingMode);
if (((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bStockingMode) {
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("217","Stocking mode. Keeps this many items in destination input slots. This mode can be server unfriendly."));
+ GT_Utility.sendChatToPlayer(
+ aPlayer,
+ GT_Utility.trans(
+ "217",
+ "Stocking mode. Keeps this many items in destination input slots. This mode can be server unfriendly."));
} else {
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("218", "Transfer size mode. Add exactly this many items in destination input slots as long as there is room."));
+ GT_Utility.sendChatToPlayer(
+ aPlayer,
+ GT_Utility.trans(
+ "218",
+ "Transfer size mode. Add exactly this many items in destination input slots as long as there is room."));
}
return null;
}
diff --git a/src/main/java/gregtech/common/gui/GT_Container_Filter.java b/src/main/java/gregtech/common/gui/GT_Container_Filter.java
index 7ca72b8e3a..d4aabe0cb4 100644
--- a/src/main/java/gregtech/common/gui/GT_Container_Filter.java
+++ b/src/main/java/gregtech/common/gui/GT_Container_Filter.java
@@ -61,56 +61,64 @@ public class GT_Container_Filter extends GT_ContainerMetaTile_Machine {
if (aMouseclick == 0) {
tSlot.putStack(null);
} else if (tStack != null) {
- tStack = GT_Utility.copyAmountAndMetaData(tStack.stackSize, 32767, tStack);
- if(GT_Utility.isStackInvalid(tStack)){tStack=null;}
+ tStack = GT_Utility.copyAmountAndMetaData(tStack.stackSize, 32767, tStack);
+ if (GT_Utility.isStackInvalid(tStack)) {
+ tStack = null;
+ }
}
} else {
- tSlot.putStack(GT_Utility.copyAmount(1L, new Object[]{tStack}));
+ tSlot.putStack(GT_Utility.copyAmount(1L, new Object[] {tStack}));
}
return null;
}
if (aSlotIndex == 18) {
- ((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bOutput = (!((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bOutput);
+ ((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bOutput =
+ (!((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bOutput);
if (((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bOutput) {
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("116","Emit Energy to Outputside"));
+ GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("116", "Emit Energy to Outputside"));
} else {
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("117","Don't emit Energy"));
+ GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("117", "Don't emit Energy"));
}
return null;
}
if (aSlotIndex == 19) {
- ((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull = (!((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull);
+ ((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull =
+ (!((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull);
if (((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull) {
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("122","Emit Redstone if slots contain something"));
+ GT_Utility.sendChatToPlayer(
+ aPlayer, GT_Utility.trans("122", "Emit Redstone if slots contain something"));
} else {
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("123","Don't emit Redstone"));
+ GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("123", "Don't emit Redstone"));
}
return null;
}
if (aSlotIndex == 20) {
- ((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bInvert = (!((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bInvert);
+ ((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bInvert =
+ (!((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bInvert);
if (((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bInvert) {
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("120","Invert Redstone"));
+ GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("120", "Invert Redstone"));
} else {
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("121","Don't invert Redstone"));
+ GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("121", "Don't invert Redstone"));
}
return null;
}
if (aSlotIndex == 21) {
- ((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bInvertFilter = (!((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bInvertFilter);
+ ((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bInvertFilter =
+ (!((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bInvertFilter);
if (((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bInvertFilter) {
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("124","Invert Filter"));
+ GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("124", "Invert Filter"));
} else {
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("125","Don't invert Filter"));
+ GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("125", "Don't invert Filter"));
}
return null;
}
if (aSlotIndex == 22) {
- ((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bIgnoreNBT = (!((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bIgnoreNBT);
+ ((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bIgnoreNBT =
+ (!((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bIgnoreNBT);
if (((GT_MetaTileEntity_Filter) this.mTileEntity.getMetaTileEntity()).bIgnoreNBT) {
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("126","Ignore NBT"));
+ GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("126", "Ignore NBT"));
} else {
- GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("127","NBT has to match"));
+ GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("127", "NBT has to match"));
}
return null;
}
diff --git a/src/main/java/gregtech/common/gui/GT_Container_IndustrialApiary.java b/src/main/java/gregtech/common/gui/GT_Container_IndustrialApiary.java
index 26170a9478..b2a2c4cae1 100644
--- a/src/main/java/gregtech/common/gui/GT_Container_IndustrialApiary.java
+++ b/src/main/java/gregtech/common/gui/GT_Container_IndustrialApiary.java
@@ -11,6 +11,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_ApiaryUpgrade;
import gregtech.api.util.GT_Utility;
import gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_IndustrialApiary;
+import java.util.ArrayList;
import net.bdew.gendustry.api.items.IApiaryUpgrade;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
@@ -21,8 +22,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
-import java.util.ArrayList;
-
public class GT_Container_IndustrialApiary extends GT_ContainerMetaTile_Machine {
GT_Slot_Holo slotItemTransferToggle;
@@ -60,13 +59,12 @@ public class GT_Container_IndustrialApiary extends GT_ContainerMetaTile_Machine
slotUpgrade.add(addSlotToContainer(new ApiarySlot(this.mTileEntity, tStartIndex++, 62, 42)));
slotUpgrade.add(addSlotToContainer(new ApiarySlot(this.mTileEntity, tStartIndex++, 80, 42)));
- for(int i = 107; i <= 143; i += 18)
- for(int j = 6; j <= 42; j += 18)
+ for (int i = 107; i <= 143; i += 18)
+ for (int j = 6; j <= 42; j += 18)
addSlotToContainer(new GT_Slot_Output(this.mTileEntity, tStartIndex++, i, j));
addSlotToContainer(slotBattery = new Slot(mTileEntity, 1, 80, 63));
addSlotToContainer(slotSpecial = new Slot(mTileEntity, 3, 125, 63));
-
}
@Override
@@ -79,24 +77,18 @@ public class GT_Container_IndustrialApiary extends GT_ContainerMetaTile_Machine
machine.mItemTransfer = !machine.mItemTransfer;
return null;
case 1:
- if(aMouseclick == 0) {
- if(machine.mLockedSpeed)
- return null;
- if(aShifthold == 0) {
+ if (aMouseclick == 0) {
+ if (machine.mLockedSpeed) return null;
+ if (aShifthold == 0) {
machine.mSpeed++;
if (machine.mSpeed > machine.getMaxSpeed()) machine.mSpeed = 0;
- }
- else if(aShifthold == 1)
- {
+ } else if (aShifthold == 1) {
machine.mSpeed--;
if (machine.mSpeed < 0) machine.mSpeed = machine.getMaxSpeed();
}
- }
- else if(aMouseclick == 1)
- {
+ } else if (aMouseclick == 1) {
machine.mLockedSpeed = !machine.mLockedSpeed;
- if(machine.mLockedSpeed)
- machine.mSpeed = machine.getMaxSpeed();
+ if (machine.mLockedSpeed) machine.mSpeed = machine.getMaxSpeed();
}
return null;
case 2:
@@ -105,39 +97,28 @@ public class GT_Container_IndustrialApiary extends GT_ContainerMetaTile_Machine
return null;
}
- if(!(aSlotNumber >= getSlotStartIndex()+2 && aSlotNumber < getSlotStartIndex()+2+4))
- return super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer);
- if(aShifthold == 5)
- return null;
- if(aShifthold != 0)
- return super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer);
- if(aMouseclick > 1)
+ if (!(aSlotNumber >= getSlotStartIndex() + 2 && aSlotNumber < getSlotStartIndex() + 2 + 4))
return super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer);
+ if (aShifthold == 5) return null;
+ if (aShifthold != 0) return super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer);
+ if (aMouseclick > 1) return super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer);
ItemStack s = aPlayer.inventory.getItemStack();
- if(s == null)
- return super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer);
+ if (s == null) return super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer);
Slot slot = getSlot(aSlotNumber);
ItemStack slotstack = slot.getStack();
- if(slotstack != null && !GT_Utility.areStacksEqual(slotstack, s))
- return null; // super would replace item
- if(slotstack == null && !slot.isItemValid(s))
+ if (slotstack != null && !GT_Utility.areStacksEqual(slotstack, s)) return null; // super would replace item
+ if (slotstack == null && !slot.isItemValid(s))
return super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer);
- if(!(s.getItem() instanceof IApiaryUpgrade) && !GT_ApiaryUpgrade.isUpgrade(s))
+ if (!(s.getItem() instanceof IApiaryUpgrade) && !GT_ApiaryUpgrade.isUpgrade(s))
return super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer);
int max = 1;
- if (s.getItem() instanceof IApiaryUpgrade)
- max = ((IApiaryUpgrade) s.getItem()).getMaxNumber(s);
- else
- max = GT_ApiaryUpgrade.getUpgrade(s).getMaxNumber();
- if(slotstack != null)
- max = Math.max(0, max - slotstack.stackSize);
+ if (s.getItem() instanceof IApiaryUpgrade) max = ((IApiaryUpgrade) s.getItem()).getMaxNumber(s);
+ else max = GT_ApiaryUpgrade.getUpgrade(s).getMaxNumber();
+ if (slotstack != null) max = Math.max(0, max - slotstack.stackSize);
max = Math.min(max, s.stackSize);
- if(max == 0)
- return null;
- if(aMouseclick == 1)
- max = 1;
- if(max == s.stackSize)
- return super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer);
+ if (max == 0) return null;
+ if (aMouseclick == 1) max = 1;
+ if (max == s.stackSize) return super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer);
ItemStack newstack = s.splitStack(s.stackSize - max);
ItemStack result = super.slotClick(aSlotNumber, aMouseclick, aShifthold, aPlayer);
aPlayer.inventory.setItemStack(newstack);
@@ -151,7 +132,7 @@ public class GT_Container_IndustrialApiary extends GT_ContainerMetaTile_Machine
@Override
public int getSlotCount() {
- return 6+9+2;
+ return 6 + 9 + 2;
}
@Override
@@ -176,8 +157,7 @@ public class GT_Container_IndustrialApiary extends GT_ContainerMetaTile_Machine
var1.sendProgressBarUpdate(this, 100, this.mSpeed);
var1.sendProgressBarUpdate(this, 101, this.mItemTransfer ? 1 : 0);
var1.sendProgressBarUpdate(this, 102, 0);
- for(IErrorState s : getMachine().mErrorStates)
- var1.sendProgressBarUpdate(this, 103, s.getID());
+ for (IErrorState s : getMachine().mErrorStates) var1.sendProgressBarUpdate(this, 103, s.getID());
var1.sendProgressBarUpdate(this, 104, this.mStuttering ? 1 : 0);
var1.sendProgressBarUpdate(this, 105, this.mLockedSpeed ? 1 : 0);
}
@@ -198,7 +178,11 @@ public class GT_Container_IndustrialApiary extends GT_ContainerMetaTile_Machine
this.mErrorStates.clear();
break;
case 103:
- this.mErrorStates.add(EnumChatFormatting.RED + StatCollector.translateToLocal("for." + ForestryAPI.errorStateRegistry.getErrorState((short) par2).getDescription()));
+ this.mErrorStates.add(EnumChatFormatting.RED
+ + StatCollector.translateToLocal("for."
+ + ForestryAPI.errorStateRegistry
+ .getErrorState((short) par2)
+ .getDescription()));
break;
case 104:
this.mStuttering = par2 == 1;
@@ -216,33 +200,24 @@ public class GT_Container_IndustrialApiary extends GT_ContainerMetaTile_Machine
@Override
public ItemStack transferStackInSlot(EntityPlayer aPlayer, int aSlotIndex) {
Slot s = getSlot(aSlotIndex);
- if(s == null)
- return super.transferStackInSlot(aPlayer, aSlotIndex);
- if(!(s.inventory instanceof InventoryPlayer))
- return super.transferStackInSlot(aPlayer, aSlotIndex);
+ if (s == null) return super.transferStackInSlot(aPlayer, aSlotIndex);
+ if (!(s.inventory instanceof InventoryPlayer)) return super.transferStackInSlot(aPlayer, aSlotIndex);
ItemStack aStack = s.getStack();
- if(aStack == null)
+ if (aStack == null) return super.transferStackInSlot(aPlayer, aSlotIndex);
+ if (!(aStack.getItem() instanceof IApiaryUpgrade) && !GT_ApiaryUpgrade.isUpgrade(aStack))
return super.transferStackInSlot(aPlayer, aSlotIndex);
- if(!(aStack.getItem() instanceof IApiaryUpgrade) && !GT_ApiaryUpgrade.isUpgrade(aStack))
- return super.transferStackInSlot(aPlayer, aSlotIndex);
- for(int i = getSlotStartIndex()+2; i < getSlotStartIndex()+2+4; i++) {
+ for (int i = getSlotStartIndex() + 2; i < getSlotStartIndex() + 2 + 4; i++) {
Slot iSlot = getSlot(i);
ItemStack iStack = iSlot.getStack();
- if(iStack == null)
- {
- if(!iSlot.isItemValid(aStack))
- continue;
- }
- else
- {
- if(!GT_Utility.areStacksEqual(aStack, iStack))
- continue;
+ if (iStack == null) {
+ if (!iSlot.isItemValid(aStack)) continue;
+ } else {
+ if (!GT_Utility.areStacksEqual(aStack, iStack)) continue;
}
int max = 1;
if (aStack.getItem() instanceof IApiaryUpgrade)
max = ((IApiaryUpgrade) aStack.getItem()).getMaxNumber(aStack);
- else
- max = GT_ApiaryUpgrade.getUpgrade(aStack).getMaxNumber();
+ else max = GT_ApiaryUpgrade.getUpgrade(aStack).getMaxNumber();
if (iStack == null) {
max = Math.min(max, aStack.stackSize);
ItemStack newstack = aStack.splitStack(max);
@@ -254,16 +229,14 @@ public class GT_Container_IndustrialApiary extends GT_ContainerMetaTile_Machine
aStack.stackSize -= max;
iSlot.onSlotChanged();
}
- if (aStack.stackSize == 0)
- s.putStack(null);
- else
- s.onSlotChanged();
+ if (aStack.stackSize == 0) s.putStack(null);
+ else s.onSlotChanged();
break;
}
return null;
}
- private static class ApiarySlot extends Slot{
+ private static class ApiarySlot extends Slot {
public ApiarySlot(IInventory p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_) {
super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_);
@@ -277,7 +250,8 @@ public class GT_Container_IndustrialApiary extends GT_ContainerMetaTile_Machine
@Override
public void onSlotChanged() {
super.onSlotChanged();
- ((GT_MetaTileEntity_IndustrialApiary)((IGregTechTileEntity)this.inventory).getMetaTileEntity()).onInventoryUpdate(this.getSlotIndex());
+ ((GT_MetaTileEntity_IndustrialApiary) ((IGregTechTileEntity) this.inventory).getMetaTileEntity())
+ .onInventoryUpdate(this.getSlotIndex());
}
}
}
diff --git a/src/main/java/gregtech/common/gui/GT_Container_InputBus_ME.java b/src/main/java/gregtech/common/gui/GT_Container_InputBus_ME.java
index 0f7b26eea7..58aff9ad08 100644
--- a/src/main/java/gregtech/common/gui/GT_Container_InputBus_ME.java
+++ b/src/main/java/gregtech/common/gui/GT_Container_InputBus_ME.java
@@ -1,11 +1,5 @@
package gregtech.common.gui;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.ICrafting;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.gui.GT_ContainerMetaTile_Machine;
@@ -14,25 +8,43 @@ import gregtech.api.gui.GT_Slot_Holo_ME;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_Utility;
import gregtech.common.tileentities.machines.GT_MetaTileEntity_Hatch_InputBus_ME;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.ICrafting;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
public class GT_Container_InputBus_ME extends GT_ContainerMetaTile_Machine {
private static final int LEFT_OFFSET = 8;
private static final int TOP_OFFSET = 10;
private static final int SLOT_SIZE = 18;
public static final int CIRCUIT_SLOT = 32;
+
public GT_Container_InputBus_ME(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
super(aInventoryPlayer, aTileEntity);
}
+
@Override
public void addSlots(InventoryPlayer aInventoryPlayer) {
for (int y = 0; y < 4; ++y)
for (int x = 0; x < 4; ++x)
- addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, x + y * 4,
- LEFT_OFFSET + x * SLOT_SIZE, TOP_OFFSET + y * SLOT_SIZE, false, true, 1));
+ addSlotToContainer(new GT_Slot_Holo(
+ this.mTileEntity,
+ x + y * 4,
+ LEFT_OFFSET + x * SLOT_SIZE,
+ TOP_OFFSET + y * SLOT_SIZE,
+ false,
+ true,
+ 1));
for (int y = 0; y < 4; ++y)
for (int x = 0; x < 4; ++x) {
- GT_Slot_Holo_ME slot = new GT_Slot_Holo_ME(this.mTileEntity, x + y * 4 + 16,
- LEFT_OFFSET + x * SLOT_SIZE + 90, TOP_OFFSET + y * SLOT_SIZE, false, true);
+ GT_Slot_Holo_ME slot = new GT_Slot_Holo_ME(
+ this.mTileEntity,
+ x + y * 4 + 16,
+ LEFT_OFFSET + x * SLOT_SIZE + 90,
+ TOP_OFFSET + y * SLOT_SIZE,
+ false,
+ true);
addSlotToContainer(slot);
}
super.addSlots(aInventoryPlayer);
@@ -41,25 +53,22 @@ public class GT_Container_InputBus_ME extends GT_ContainerMetaTile_Machine {
private boolean containsSuchStack(ItemStack tStack) {
for (int i = 0; i < 16; ++i) {
Slot tSlot = (Slot) this.inventorySlots.get(i);
- if (tSlot != null && GT_Utility.areStacksEqual(tSlot.getStack(), tStack, false))
- return true;
+ if (tSlot != null && GT_Utility.areStacksEqual(tSlot.getStack(), tStack, false)) return true;
}
return false;
}
- private final static int PROGRESS_PACKET_INDEX_OFFSET = 200;
+ private static final int PROGRESS_PACKET_INDEX_OFFSET = 200;
@Override
public void detectAndSendChanges() {
super.detectAndSendChanges();
- if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null)
- return;
+ if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) return;
for (Object crafter : this.crafters) {
ICrafting player = (ICrafting) crafter;
for (int i = 0; i < 16; ++i) {
ItemStack s = ((Slot) this.inventorySlots.get(i + 16)).getStack();
- if (s == null)
- continue;
+ if (s == null) continue;
player.sendProgressBarUpdate(this, PROGRESS_PACKET_INDEX_OFFSET + 2 * i, s.stackSize & 65535);
player.sendProgressBarUpdate(this, PROGRESS_PACKET_INDEX_OFFSET + 2 * i + 1, s.stackSize >>> 16);
}
@@ -77,8 +86,7 @@ public class GT_Container_InputBus_ME extends GT_ContainerMetaTile_Machine {
if ((id - PROGRESS_PACKET_INDEX_OFFSET) % 2 == 0) {
s.stackSize &= 0xFFFF0000;
s.stackSize += (value & 0xFFFF);
- }
- else {
+ } else {
s.stackSize &= 0xFFFF;
s.stackSize += value << 16;
}
@@ -91,19 +99,17 @@ public class GT_Container_InputBu