33import com .alpsbte .alpslib .utils .item .Item ;
44import net .buildtheearth .buildteamtools .utils .CustomHeads ;
55import net .buildtheearth .buildteamtools .utils .MenuItems ;
6- import net . daporkchop . lib . common . misc . Tuple ;
6+ import org . apache . commons . lang3 . tuple . MutablePair ;
77import org .bukkit .enchantments .Enchantment ;
88import org .bukkit .entity .Player ;
99import org .bukkit .inventory .ItemStack ;
@@ -26,12 +26,12 @@ public class NameListMenu extends AbstractPaginatedMenu {
2626 public static final int BACK_ITEM_SLOT = 27 ;
2727
2828 protected final List <String > selectedNames ;
29- private final List <Tuple <ItemStack , String >> items ;
29+ private final List <MutablePair <ItemStack , String >> items ;
3030
3131 private final AbstractMenu backMenu ;
3232
3333
34- public NameListMenu (Player player , String invName , List <Tuple <ItemStack , String >> items , AbstractMenu backMenu , boolean autoLoad ) {
34+ public NameListMenu (Player player , String invName , List <MutablePair <ItemStack , String >> items , AbstractMenu backMenu , boolean autoLoad ) {
3535 super (4 , 3 , invName , player , autoLoad );
3636
3737 this .items = items ;
@@ -85,13 +85,13 @@ protected List<?> getSource() {
8585 @ Override
8686 protected void setPaginatedPreviewItems (List <?> source ) {
8787 // Set pagignated items
88- List <Tuple <ItemStack , String >> pagItems = source .stream ().map (l -> (Tuple <ItemStack , String >) l ).toList ();
88+ List <MutablePair <ItemStack , String >> pagItems = source .stream ().map (l -> (MutablePair <ItemStack , String >) l ).toList ();
8989 int slot = 0 ;
90- for (Tuple <ItemStack , String > item : pagItems ) {
91- if (selectedNames .contains (item .getB ()))
92- item .setA (new Item (item .getA ()).setAmount (1 ).addEnchantment (Enchantment .LUCK_OF_THE_SEA , 1 ).hideEnchantments (true ).build ());
90+ for (MutablePair <ItemStack , String > item : pagItems ) {
91+ if (selectedNames .contains (item .getRight ()))
92+ item .setLeft (new Item (item .getLeft ()).setAmount (1 ).addEnchantment (Enchantment .LUCK_OF_THE_SEA , 1 ).hideEnchantments (true ).build ());
9393
94- getMenu ().getSlot (slot ).setItem (item .getA ());
94+ getMenu ().getSlot (slot ).setItem (item .getLeft ());
9595 slot ++;
9696 }
9797 }
@@ -103,12 +103,12 @@ protected void setPaginatedMenuItemsAsync(List<?> source) {
103103
104104 @ Override
105105 protected void setPaginatedItemClickEventsAsync (@ NonNull List <?> source ) {
106- List <Tuple <ItemStack , String >> pagItems = source .stream ().map (l -> (Tuple <ItemStack , String >) l ).toList ();
106+ List <MutablePair <ItemStack , String >> pagItems = source .stream ().map (l -> (MutablePair <ItemStack , String >) l ).toList ();
107107 int slot = 0 ;
108- for (Tuple <ItemStack , String > item : pagItems ) {
108+ for (MutablePair <ItemStack , String > item : pagItems ) {
109109 final int _slot = slot ;
110110 getMenu ().getSlot (_slot ).setClickHandler ((clickPlayer , clickInformation ) -> {
111- String type = (item .getB ().toLowerCase ());
111+ String type = (item .getRight ().toLowerCase ());
112112
113113 if (selectedNames .contains (type ))
114114 selectedNames .remove (type );
0 commit comments