9
0
mirror of https://github.com/HibiscusMC/HMCCosmetics.git synced 2025-12-30 12:29:16 +00:00

clean: menu class cleaning

This commit is contained in:
LoJoSho
2023-06-13 11:51:38 -05:00
parent 2e95a9bf58
commit 4e2291d16f

View File

@@ -77,26 +77,21 @@ public class Menu {
gui.setDefaultClickAction(event -> event.setCancelled(true));
// TODO: Redo this whole gui creation process to allow for all items, possibly implement caching
gui = getItems(user, gui);
final Gui finalGui = gui; // Need to make it final for the runtask
Gui finalGui = gui;
// API
PlayerMenuOpenEvent event = new PlayerMenuOpenEvent(user, this);
Bukkit.getScheduler().runTask(HMCCosmeticsPlugin.getInstance(), () -> {
Bukkit.getPluginManager().callEvent(event);
});
if (event.isCancelled()) {
return;
}
if (event.isCancelled()) return;
// Internal
Bukkit.getScheduler().runTask(HMCCosmeticsPlugin.getInstance(), () -> {
finalGui.open(player);
});
//gui.open(player);
}
@Contract("_, _ -> param2")