@@ -59,7 +59,7 @@ abstract class AbstractItemNetwork extends Network {
59
59
private static final int [] TERMINAL_SLOTS = { 0 , 1 , 2 , 3 , 4 , 5 , 6 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 18 , 19 , 20 , 21 , 22 , 23 , 24 , 27 , 28 , 29 , 30 , 31 , 32 , 33 , 36 , 37 , 38 , 39 , 40 , 41 , 42 };
60
60
private static final int TERMINAL_OUT_SLOT = 17 ;
61
61
62
- private final ItemStack terminalPlaceholderItem = new CustomItemStack (Material .BARRIER , "&4No Item cached" );
62
+ private final ItemStack terminalPlaceholderItem = CustomItemStack . create (Material .BARRIER , "&4No Item cached" );
63
63
64
64
protected final Set <Location > terminals = new HashSet <>();
65
65
protected final Set <Location > imports = new HashSet <>();
@@ -175,13 +175,13 @@ private void collectExtractionRequest(Map<Location, Inventory> inventories, Item
175
175
if (stack == null ) {
176
176
stack = is ;
177
177
} else {
178
- stack = new CustomItemStack (stack , stack .getAmount () + is .getAmount ());
178
+ stack = CustomItemStack . create (stack , stack .getAmount () + is .getAmount ());
179
179
}
180
180
181
181
if (is .getAmount () == item .getAmount ()) {
182
182
break ;
183
183
} else {
184
- item = new CustomItemStack (item , item .getAmount () - is .getAmount ());
184
+ item = CustomItemStack . create (item , item .getAmount () - is .getAmount ());
185
185
}
186
186
}
187
187
}
@@ -193,7 +193,7 @@ private void collectExtractionRequest(Map<Location, Inventory> inventories, Item
193
193
if (prev == null ) {
194
194
terminal .replaceExistingItem (slot , stack );
195
195
} else {
196
- terminal .replaceExistingItem (slot , new CustomItemStack (stack , stack .getAmount () + prev .getAmount ()));
196
+ terminal .replaceExistingItem (slot , CustomItemStack . create (stack , stack .getAmount () + prev .getAmount ()));
197
197
}
198
198
}
199
199
@@ -247,7 +247,7 @@ private void collectExportRequests(Map<Location, Inventory> inventories) {
247
247
ItemStack template = menu .getItemInSlot (slot );
248
248
249
249
if (template != null ) {
250
- items .add (new CustomItemStack (template , 1 ));
250
+ items .add (CustomItemStack . create (template , 1 ));
251
251
}
252
252
}
253
253
@@ -387,7 +387,7 @@ private void updateTerminal(Location l, BlockMenu terminal, int slot, int index,
387
387
terminal .replaceExistingItem (slot , stack );
388
388
terminal .addMenuClickHandler (slot , (p , sl , is , action ) -> {
389
389
int amount = item .getInt () > item .getItem ().getMaxStackSize () ? item .getItem ().getMaxStackSize () : item .getInt ();
390
- ItemStack requestedItem = new CustomItemStack (item .getItem (), action .isRightClicked () ? amount : 1 );
390
+ ItemStack requestedItem = CustomItemStack . create (item .getItem (), action .isRightClicked () ? amount : 1 );
391
391
itemRequests .add (new ItemRequest (l , 44 , requestedItem , ItemTransportFlow .WITHDRAW ));
392
392
return false ;
393
393
});
0 commit comments