mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-17 10:55:06 +00:00
Giant Inventory Refactor 2. Slots will only accept valid items
Moved logic out of Containers, the old filtered slots were not always the same logic as the IInventory. Moved ISidedInventory logic up to TileForestry and use InventoryAdapters to override only the methods we need to. Tested a ton but there will be some new issues given the scope.
This commit is contained in:
1 parent
2b3b590cf4
commit
c54b7c40bb
124 files changed
+2414
-4259
No files matched your search
@@ -85,17 +85,21 @@ public class BackpackDefinition implements IBackpackDefinition {
|
||||
addValidItem(validItem);
|
||||
}
|
||||
|
||||
public ArrayList<ItemStack> getValidItems(EntityPlayer player) {
|
||||
public ArrayList<ItemStack> getValidItems() {
|
||||
return validItems;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidItem(EntityPlayer player, ItemStack itemstack) {
|
||||
for (ItemStack stack : getValidItems(player))
|
||||
return isValidItem(itemstack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidItem(ItemStack itemstack) {
|
||||
for (ItemStack stack : getValidItems())
|
||||
if (StackUtils.isCraftingEquivalent(stack, itemstack, true, false))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user