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:
mezz committed 2014-12-31 04:22:33 -08:00
1 parent 2b3b590cf4
commit c54b7c40bb
124 files changed
+2414 -4259

No files matched your search

@@ -16,6 +16,7 @@ import forestry.api.storage.BackpackResupplyEvent;
import forestry.api.storage.IBackpackDefinition;
import forestry.core.interfaces.IResupplyHandler;
import forestry.core.inventory.ItemInventory;
import forestry.core.inventory.ItemInventoryBackpack;
import forestry.storage.items.ItemBackpack;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ContainerPlayer;
@@ -59,7 +60,7 @@ public class ResupplyHandler implements IResupplyHandler {
// Load their inventory
ItemBackpack packItem = ((ItemBackpack) backpack.getItem());
ItemInventory backpackinventory = new ItemInventory(ItemBackpack.class, packItem.getBackpackSize(), backpack);
ItemInventory backpackinventory = new ItemInventoryBackpack(ItemBackpack.class, packItem.getBackpackSize(), backpack);
Event event = new BackpackResupplyEvent(player, packItem.getDefinition(), backpackinventory);
MinecraftForge.EVENT_BUS.post(event);
if (event.isCanceled())