broken-arrow

Untitled

Nov 25th, 2021
606
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. import org.brokenarrow.storage.CustomContainersMainClass;
  3. import org.bukkit.Material;
  4. import org.bukkit.entity.Player;
  5. import org.bukkit.event.inventory.ClickType;
  6. import org.bukkit.inventory.Inventory;
  7. import org.bukkit.inventory.ItemStack;
  8.  
  9. public class testMenu extends MenuHolderTest {
  10.  
  11.     private final MenuButton LinkButton;
  12.     private final MenuButton otherTest;
  13.  
  14.     public testMenu() {
  15.         super(testMenu.class, CustomContainersMainClass.getInstance(), 54);
  16.  
  17.         setTitle("test tittle for menu");
  18.  
  19.         LinkButton = new MenuButton() {
  20.             @Override
  21.             public void onClickInsideMenu(Player player, Inventory menu, ClickType click) {
  22.  
  23.                 System.out.println("send this test for LinkButton menu " + player);
  24.             }
  25.  
  26.             @Override
  27.             public ItemStack getItem() {
  28.                 return new ItemStack(Material.HOPPER);
  29.             }
  30.         };
  31.  
  32.         otherTest = new MenuButton() {
  33.             @Override
  34.             public void onClickInsideMenu(Player player, Inventory menu, ClickType click) {
  35.                 System.out.println("send this test for otherTest menu " + player);
  36.             }
  37.  
  38.             @Override
  39.             public ItemStack getItem() {
  40.                 return new ItemStack(Material.BEACON);
  41.             }
  42.         };
  43.  
  44.     }
  45.  
  46.     @Override
  47.     public ItemStack getItemAt(int slot) {
  48.         if (slot == 5) {
  49.             System.out.println("5 item " + slot + "  " + LinkButton.getItem());
  50.             LinkButton.getItem();
  51.         }
  52.         if (slot == 10)
  53.             otherTest.getItem();
  54.         return null;
  55.     }
  56. }
  57.  
RAW Paste Data