aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/gui
diff options
context:
space:
mode:
authorTimeConqueror <timeconqueror999@gmail.com>2021-07-15 02:53:54 +0300
committerTimeConqueror <timeconqueror999@gmail.com>2021-07-15 02:53:54 +0300
commit77f22e029303ba48f9aabad32367e500bdcefee3 (patch)
tree1e8d2753ef86908f64a759e4743a0ef2fa4925e6 /src/main/java/gregtech/api/gui
parent9f7fd2675139d4a575b6a1dc2fa1b472800a0757 (diff)
downloadGT5-Unofficial-77f22e029303ba48f9aabad32367e500bdcefee3.tar.gz
GT5-Unofficial-77f22e029303ba48f9aabad32367e500bdcefee3.tar.bz2
GT5-Unofficial-77f22e029303ba48f9aabad32367e500bdcefee3.zip
Removed useless array creation in most #copy methods by changing them to #copyOrNull variant with single parameter.
Diffstat (limited to 'src/main/java/gregtech/api/gui')
-rw-r--r--src/main/java/gregtech/api/gui/GT_Container.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/gregtech/api/gui/GT_Container.java b/src/main/java/gregtech/api/gui/GT_Container.java
index 608c6015d5..e00759bf24 100644
--- a/src/main/java/gregtech/api/gui/GT_Container.java
+++ b/src/main/java/gregtech/api/gui/GT_Container.java
@@ -142,7 +142,7 @@ public class GT_Container extends Container {
if (aSlot != null && aSlot.canTakeStack(aPlayer)) {
tTempStack = this.transferStackInSlot(aPlayer, aSlotIndex);
if (tTempStack != null) {
- rStack = GT_Utility.copy(tTempStack);
+ rStack = GT_Utility.copyOrNull(tTempStack);
if (aSlot.getStack() != null && aSlot.getStack().getItem() == tTempStack.getItem()) {
slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
}
@@ -157,7 +157,7 @@ public class GT_Container extends Container {
tTempStack = aSlot.getStack();
ItemStack var13 = aPlayerInventory.getItemStack();
if (tTempStack != null) {
- rStack = GT_Utility.copy(tTempStack);
+ rStack = GT_Utility.copyOrNull(tTempStack);
}
if (tTempStack == null) {
if (var13 != null && aSlot.isItemValid(var13)) {
@@ -253,7 +253,7 @@ public class GT_Container extends Container {
} else if (aShifthold == 3 && aPlayer.capabilities.isCreativeMode && aPlayerInventory.getItemStack() == null && aSlotIndex >= 0) {
aSlot = (Slot) this.inventorySlots.get(aSlotIndex);
if (aSlot != null && aSlot.getHasStack()) {
- tTempStack = GT_Utility.copy(aSlot.getStack());
+ tTempStack = GT_Utility.copyOrNull(aSlot.getStack());
tTempStack.stackSize = tTempStack.getMaxStackSize();
aPlayerInventory.setItemStack(tTempStack);
}
@@ -271,7 +271,7 @@ public class GT_Container extends Container {
//null checks and checks if the item can be stacked (maxStackSize > 1)
if (getSlotCount() > 0 && slotObject != null && slotObject.getHasStack() && !(slotObject instanceof GT_Slot_Holo)) {
ItemStack stackInSlot = slotObject.getStack();
- stack = GT_Utility.copy(stackInSlot);
+ stack = GT_Utility.copyOrNull(stackInSlot);
//TileEntity -> Player
if (aSlotIndex < getAllSlotCount()) {