mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-18 19:29:17 +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
@@ -44,7 +44,7 @@ public class GuiHandlerMail extends GuiHandlerBase {
|
||||
|
||||
switch (GuiId.values()[id]) {
|
||||
case CatalogueGUI:
|
||||
ItemStack cata = getEquippedItem(player);
|
||||
ItemStack cata = player.getCurrentEquippedItem();
|
||||
if (cata == null)
|
||||
return null;
|
||||
|
||||
@@ -54,7 +54,7 @@ public class GuiHandlerMail extends GuiHandlerBase {
|
||||
return null;
|
||||
|
||||
case LetterGUI:
|
||||
ItemStack equipped = getEquippedItem(player);
|
||||
ItemStack equipped = player.getCurrentEquippedItem();
|
||||
if (equipped == null)
|
||||
return null;
|
||||
|
||||
@@ -85,7 +85,7 @@ public class GuiHandlerMail extends GuiHandlerBase {
|
||||
|
||||
switch (GuiId.values()[id]) {
|
||||
case CatalogueGUI:
|
||||
ItemStack cata = getEquippedItem(player);
|
||||
ItemStack cata = player.getCurrentEquippedItem();
|
||||
if (cata == null)
|
||||
return null;
|
||||
|
||||
@@ -95,12 +95,12 @@ public class GuiHandlerMail extends GuiHandlerBase {
|
||||
return null;
|
||||
|
||||
case LetterGUI:
|
||||
ItemStack equipped = getEquippedItem(player);
|
||||
ItemStack equipped = player.getCurrentEquippedItem();
|
||||
if (equipped == null)
|
||||
return null;
|
||||
|
||||
if (equipped.getItem() instanceof ItemLetter)
|
||||
return new ContainerLetter(player, new LetterInventory(getEquippedItem(player)));
|
||||
return new ContainerLetter(player, new LetterInventory(equipped));
|
||||
else
|
||||
return null;
|
||||
|
||||
|
||||
Reference in new issue
Block a user