mirror of
https://github.com/arcadiadevs/hubcore.git
synced 2025-02-19 18:31:26 +01:00
Fixed known bug where glass pane would always be white and made the GUI little nicer
This commit is contained in:
parent
37540f3c4b
commit
05b1b0f8f6
@ -69,7 +69,6 @@ public class PSHubCore extends JavaPlugin {
|
||||
// Create ServerCache refreshing task
|
||||
ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
|
||||
executor.scheduleAtFixedRate(serverCache, 1, getConfig().getInt("cache-time"), TimeUnit.SECONDS);
|
||||
System.out.println(getConfig().getInt("cache-time"));
|
||||
}
|
||||
|
||||
private void createMultiNodeConfig() throws IOException {
|
||||
|
@ -178,6 +178,13 @@ public class GUIUtils {
|
||||
stopConfirmationMenu.setButton(0, 15, new SGButton(itemStopQuestionNo).withListener(listener2 -> {
|
||||
player.closeInventory();
|
||||
}));
|
||||
|
||||
for (int i = 0; i < 9 * 4; i++) {
|
||||
if (stopConfirmationMenu.getButton(i) == null) {
|
||||
stopConfirmationMenu.setButton(i, new SGButton(new ItemBuilder(XMaterial.GRAY_STAINED_GLASS_PANE.parseItem()).name(" ").build()));
|
||||
}
|
||||
}
|
||||
|
||||
player.openInventory(stopConfirmationMenu.getInventory());
|
||||
}));
|
||||
}
|
||||
@ -199,15 +206,22 @@ public class GUIUtils {
|
||||
deleteConfirmationMenu.setButton(0, 15, new SGButton(itemDeleteQuestionNo).withListener(listener2 -> {
|
||||
player.closeInventory();
|
||||
}));
|
||||
|
||||
for (int i = 0; i < 9 * 4; i++) {
|
||||
if (deleteConfirmationMenu.getButton(i) == null) {
|
||||
deleteConfirmationMenu.setButton(i, new SGButton(new ItemBuilder(XMaterial.GRAY_STAINED_GLASS_PANE.parseItem()).name(" ").build()));
|
||||
}
|
||||
}
|
||||
|
||||
player.openInventory(deleteConfirmationMenu.getInventory());
|
||||
}));
|
||||
|
||||
menu.setButton(0, 4, new SGButton(itemPlayer));
|
||||
|
||||
// Fill all empty slots with glass pane
|
||||
for (int i = 0; i < 9; i++) {
|
||||
for (int i = 0; i < 9 * 4; i++) {
|
||||
if (menu.getButton(i) == null) {
|
||||
menu.setButton(i, new SGButton(new ItemBuilder(XMaterial.LIME_STAINED_GLASS_PANE.parseMaterial()).build()));
|
||||
menu.setButton(i, new SGButton(new ItemBuilder(XMaterial.GRAY_STAINED_GLASS_PANE.parseItem()).name(" ").build()));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user