mirror of
https://github.com/GTNewHorizons/StorageDrawers.git
synced 2026-11-18 19:39:15 +00:00
Remove unused native inventory slots
This commit is contained in:
1 parent
d29d4fa23d
commit
f6042d3138
4 files changed
+4
-28
No files matched your search
@@ -5,9 +5,6 @@ package com.jaquadro.minecraft.storagedrawers.api.inventory;
|
||||
*/
|
||||
public enum SlotType
|
||||
{
|
||||
/** An inventory slot for native StorageDrawers operations; stack sizes exceed 64. */
|
||||
STORAGE,
|
||||
|
||||
/** An inventory slot for input-only operations; stack sizes artificially held low. */
|
||||
INPUT,
|
||||
|
||||
|
||||
@@ -4,11 +4,9 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
public abstract class InventoryStack
|
||||
{
|
||||
private ItemStack nativeStack;
|
||||
private ItemStack inStack;
|
||||
private ItemStack outStack;
|
||||
|
||||
private int nativeCount;
|
||||
private int inCount;
|
||||
private int outCount;
|
||||
|
||||
@@ -17,21 +15,15 @@ public abstract class InventoryStack
|
||||
}
|
||||
|
||||
public void reset () {
|
||||
nativeStack = getNewItemStack();
|
||||
inStack = getNewItemStack();
|
||||
outStack = getNewItemStack();
|
||||
|
||||
nativeCount = 0;
|
||||
inCount = 0;
|
||||
outCount = 0;
|
||||
|
||||
refresh();
|
||||
}
|
||||
|
||||
public ItemStack getNativeStack () {
|
||||
return nativeStack;
|
||||
}
|
||||
|
||||
public ItemStack getInStack () {
|
||||
if (inStack == null || inStack.stackSize == 0)
|
||||
return null;
|
||||
@@ -121,14 +113,10 @@ public abstract class InventoryStack
|
||||
}
|
||||
|
||||
public int getDiff () {
|
||||
if (nativeStack == null)
|
||||
return 0;
|
||||
int diffIn = ((inStack == null) ? 0 : inStack.stackSize) - inCount;
|
||||
int diffOut = ((outStack == null) ? 0 : outStack.stackSize) - outCount;
|
||||
|
||||
int diffNative = nativeStack.stackSize - nativeCount;
|
||||
int diffIn = inStack.stackSize - inCount;
|
||||
int diffOut = outStack.stackSize - outCount;
|
||||
|
||||
return diffNative + diffIn + diffOut;
|
||||
return diffIn + diffOut;
|
||||
}
|
||||
|
||||
protected abstract void applyDiff (int diff);
|
||||
@@ -138,11 +126,6 @@ public abstract class InventoryStack
|
||||
int itemCount = getItemCount();
|
||||
int remainingLimit = getItemCapacity() - itemCount;
|
||||
|
||||
if (nativeStack != null) {
|
||||
nativeCount = itemCount;
|
||||
nativeStack.stackSize = nativeCount;
|
||||
}
|
||||
|
||||
if (inStack != null) {
|
||||
inCount = itemStackLimit - Math.min(itemStackLimit, remainingLimit);
|
||||
inStack.stackSize = inCount;
|
||||
|
||||
@@ -157,7 +157,6 @@ public class StorageInventory implements IDrawerInventory
|
||||
ItemStack stack = drawer.getStoredItemCopy();
|
||||
if (stack.stackSize <= count) {
|
||||
drawer.setStoredItemCount(0);
|
||||
// drawer.setStoredItem(null, 0);
|
||||
}
|
||||
else {
|
||||
stack.stackSize = count;
|
||||
@@ -197,9 +196,6 @@ public class StorageInventory implements IDrawerInventory
|
||||
case OUTPUT:
|
||||
adapter.setOutStack(item);
|
||||
break;
|
||||
case STORAGE:
|
||||
setInventorySlotContents(drawer, item);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ public abstract class BaseDrawerData implements IDrawer, IInventoryAdapter
|
||||
case OUTPUT:
|
||||
return inventoryStack.getOutStack();
|
||||
default:
|
||||
return inventoryStack.getNativeStack();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user