Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Asintotoo authored Jul 20, 2024
1 parent 2d0c773 commit 60efb4e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.asintoto</groupId>
<artifactId>Basic</artifactId>
<version>1.2.8</version>
<version>1.2.9</version>
<packaging>jar</packaging>

<name>Basic</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ public void onClick(InventoryClickEvent e) {
if(isInventoryClick(slot, rawSlot, menu)) {
return;
}
}

if(!itemData.has(BasicKeys.BUTTON_IS_BUTTON, PersistentDataType.BOOLEAN)) {
return;
if(!itemData.has(BasicKeys.BUTTON_IS_BUTTON, PersistentDataType.BOOLEAN)) {
return;
}
}

boolean isUlnocked = itemData.has(BasicKeys.BUTTON_TYPE_UNLOCKED, PersistentDataType.BOOLEAN);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.asintoto.basic.listeners;

import com.asintoto.basic.menu.Menu;
import com.asintoto.basic.menu.MenuManager;
import com.asintoto.basic.utils.BasicKeys;
import org.bukkit.entity.Player;
Expand All @@ -13,10 +14,12 @@ public class InventoryCloseListener implements Listener {
public void onClose(InventoryCloseEvent e) {
Player p = (Player) e.getPlayer();

/*if(p.getPersistentDataContainer().has(BasicKeys.BASIC_MENU_OPEN, PersistentDataType.BOOLEAN)) {
p.getPersistentDataContainer().remove(BasicKeys.BASIC_MENU_OPEN);
}*/
if(!MenuManager.contains(p)) return;

Menu menu = MenuManager.getPlayerMenu(p);

MenuManager.removePlayer(p);

menu.onClose(p);
}
}
4 changes: 4 additions & 0 deletions src/main/java/com/asintoto/basic/menu/Menu.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,8 @@ public void onClick(Player p, int slot, InventoryAction action) {

}

public void onClose(Player p) {

}

}

0 comments on commit 60efb4e

Please sign in to comment.