22
33import com .robertx22 .addons .orbs_of_crafting .currency .IItemAsCurrency ;
44import com .robertx22 .library_of_exile .utils .SoundUtils ;
5+ import com .robertx22 .mine_and_slash .a_libraries .curios .CuriosSlots ;
6+ import com .robertx22 .mine_and_slash .a_libraries .curios .MyCuriosUtils ;
57import com .robertx22 .mine_and_slash .capability .player .container .BackpackMenu ;
68import com .robertx22 .mine_and_slash .capability .player .helper .BackpackInventory ;
79import com .robertx22 .mine_and_slash .mmorpg .SlashRef ;
@@ -99,7 +101,7 @@ public BackpackInventory getInv(BackpackType type) {
99101
100102 public boolean tryAutoPickup (Player p , ItemStack stack , boolean shouldPlaySound ) {
101103
102- if (p .getInventory ().countItem (SlashItems .MASTER_BAG .get ()) < 1 ) {
104+ if (p .getInventory ().countItem (SlashItems .MASTER_BAG .get ()) < 1 && ! hasCuriosBackpack ( p ) ) {
103105 return false ;
104106 }
105107 boolean result = false ;
@@ -121,18 +123,18 @@ public boolean tryAutoPickup(Player p, ItemStack stack, boolean shouldPlaySound)
121123
122124 }
123125
126+ private boolean hasCuriosBackpack (Player p ) {
127+ var backpackItem = MyCuriosUtils .get (CuriosSlots .MASTER_BAG .name , p , 0 );
128+ return !backpackItem .isEmpty ();
129+ }
130+
124131 public boolean tryAutoPickup (Player p , ItemStack stack ){
125132 return tryAutoPickup (p , stack , true );
126133 }
127134 // todo every time before you open backpack, it will replace locked slots with blocked slots that cant be clicked on and throw out/give items back
128135
129136 public void openBackpack (BackpackType type , Player p , int rows ) {
130137 if (!p .level ().isClientSide ) {
131-
132- if (!p .getMainHandItem ().is (SlashItems .MASTER_BAG .get ())) {
133- return ;
134- }
135-
136138 BackpackInventory inv = getInv (type );
137139 //inv.throwOutBlockedSlotItems(rows * 9);
138140 p .openMenu (new SimpleMenuProvider ((i , playerInventory , playerEntity ) -> {
0 commit comments