Open Check
Dieser Commit ist enthalten in:
Ursprung
8fbb16557c
Commit
30ffe3e471
@ -42,6 +42,7 @@ public class SWInventory implements Listener {
|
|||||||
final Player player;
|
final Player player;
|
||||||
final Map<Integer, Consumer<InventoryClickEvent>> callbacks = new HashMap<>();
|
final Map<Integer, Consumer<InventoryClickEvent>> callbacks = new HashMap<>();
|
||||||
final Inventory inventory;
|
final Inventory inventory;
|
||||||
|
boolean open = false;
|
||||||
|
|
||||||
public SWInventory(Player p, int size, String t) {
|
public SWInventory(Player p, int size, String t) {
|
||||||
player = p;
|
player = p;
|
||||||
@ -127,11 +128,10 @@ public class SWInventory implements Listener {
|
|||||||
|
|
||||||
public void open() {
|
public void open() {
|
||||||
player.openInventory(inventory);
|
player.openInventory(inventory);
|
||||||
|
if(!open) {
|
||||||
Bukkit.getPluginManager().registerEvents(this, Core.getInstance());
|
Bukkit.getPluginManager().registerEvents(this, Core.getInstance());
|
||||||
|
open = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reOpen() {
|
|
||||||
player.openInventory(inventory);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren