aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/common/container/Container_ItemProxyEndpoint.java
diff options
context:
space:
mode:
authormiozune <miozune@gmail.com>2022-10-09 18:10:02 +0900
committermiozune <miozune@gmail.com>2022-10-09 18:10:02 +0900
commita265085bd7742ebf1e2e95e4bf7397ba5bea01dc (patch)
tree92d6b48c083729e8952f0d02372682393145792e /src/main/java/common/container/Container_ItemProxyEndpoint.java
parent46bafc67d318bbe7c5ffbb34d857958ebe72a6e5 (diff)
downloadGT5-Unofficial-a265085bd7742ebf1e2e95e4bf7397ba5bea01dc.tar.gz
GT5-Unofficial-a265085bd7742ebf1e2e95e4bf7397ba5bea01dc.tar.bz2
GT5-Unofficial-a265085bd7742ebf1e2e95e4bf7397ba5bea01dc.zip
updateBuildScript & spotlessApply
Diffstat (limited to 'src/main/java/common/container/Container_ItemProxyEndpoint.java')
-rw-r--r--src/main/java/common/container/Container_ItemProxyEndpoint.java86
1 files changed, 42 insertions, 44 deletions
diff --git a/src/main/java/common/container/Container_ItemProxyEndpoint.java b/src/main/java/common/container/Container_ItemProxyEndpoint.java
index 63f836e001..8f509e789c 100644
--- a/src/main/java/common/container/Container_ItemProxyEndpoint.java
+++ b/src/main/java/common/container/Container_ItemProxyEndpoint.java
@@ -8,20 +8,20 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
public class Container_ItemProxyEndpoint extends Container {
-
- private final IInventory teInventory;
-
- private int slotID = 0;
-
- public Container_ItemProxyEndpoint(TileEntity te, EntityPlayer player) {
- this.teInventory = (IInventory) te;
-
- // Source Slot
- addSlotToContainer(new Slot(teInventory, slotID++, 80, 35));
- // Config slot
- addSlotToContainer(new Slot(teInventory, slotID++, 100, 35));
-
- //Inventory
+
+ private final IInventory teInventory;
+
+ private int slotID = 0;
+
+ public Container_ItemProxyEndpoint(TileEntity te, EntityPlayer player) {
+ this.teInventory = (IInventory) te;
+
+ // Source Slot
+ addSlotToContainer(new Slot(teInventory, slotID++, 80, 35));
+ // Config slot
+ addSlotToContainer(new Slot(teInventory, slotID++, 100, 35));
+
+ // Inventory
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 9; j++) {
addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
@@ -31,38 +31,36 @@ public class Container_ItemProxyEndpoint extends Container {
for (int i = 0; i < 9; i++) {
addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142));
}
- }
-
- @Override
- public ItemStack transferStackInSlot(EntityPlayer player, int slotRaw) {
- ItemStack stack = null;
- final Slot slot = (Slot) inventorySlots.get(slotRaw);
+ }
- if (slot != null && slot.getHasStack()) {
- final ItemStack stackInSlot = slot.getStack();
- stack = stackInSlot.copy();
+ @Override
+ public ItemStack transferStackInSlot(EntityPlayer player, int slotRaw) {
+ ItemStack stack = null;
+ final Slot slot = (Slot) inventorySlots.get(slotRaw);
- if (slotRaw < 3 * 9) {
- if (!mergeItemStack(stackInSlot, 3 * 9, inventorySlots.size(), true)) {
- return null;
- }
- } else if (!mergeItemStack(stackInSlot, 0, 3 * 9, false)) {
- return null;
- }
+ if (slot != null && slot.getHasStack()) {
+ final ItemStack stackInSlot = slot.getStack();
+ stack = stackInSlot.copy();
- if (stackInSlot.stackSize == 0) {
- slot.putStack((ItemStack) null);
- } else {
- slot.onSlotChanged();
- }
- }
- return stack;
- }
-
- @Override
- public boolean canInteractWith(EntityPlayer player) {
- return teInventory.isUseableByPlayer(player);
- }
+ if (slotRaw < 3 * 9) {
+ if (!mergeItemStack(stackInSlot, 3 * 9, inventorySlots.size(), true)) {
+ return null;
+ }
+ } else if (!mergeItemStack(stackInSlot, 0, 3 * 9, false)) {
+ return null;
+ }
-}
+ if (stackInSlot.stackSize == 0) {
+ slot.putStack((ItemStack) null);
+ } else {
+ slot.onSlotChanged();
+ }
+ }
+ return stack;
+ }
+ @Override
+ public boolean canInteractWith(EntityPlayer player) {
+ return teInventory.isUseableByPlayer(player);
+ }
+}