mirror of
https://github.com/HibiscusMC/HMCCosmetics.git
synced 2025-12-30 12:29:16 +00:00
make dye menu slots configurable
This commit is contained in:
@@ -25,6 +25,8 @@ public class Settings {
|
||||
private static final String PARTICLE_COUNT = "particle-count";
|
||||
private static final String DYE_MENU_PATH = "dye-menu";
|
||||
private static final String DYE_MENU_NAME = "title";
|
||||
private static final String DYE_MENU_INPUT_SLOT = "input-slot";
|
||||
private static final String DYE_MENU_OUTPUT_SLOT = "output-slot";
|
||||
private static final String DEBUG_ENABLE_PETH = "debug-mode";
|
||||
private static final String TICK_PERIOD_PATH = "tick-period";
|
||||
private static final String UNAPPLY_DEATH_PATH = "unapply-on-death";
|
||||
@@ -33,6 +35,8 @@ public class Settings {
|
||||
|
||||
private static String defaultMenu;
|
||||
private static String dyeMenuName;
|
||||
private static int dyeMenuInputSlot;
|
||||
private static int dyeMenuOutputSlot;
|
||||
private static int configVersion;
|
||||
private static boolean requireEmptyHelmet;
|
||||
private static boolean requireEmptyOffHand;
|
||||
@@ -85,6 +89,8 @@ public class Settings {
|
||||
ConfigurationNode dyeMenuSettings = source.node(DYE_MENU_PATH);
|
||||
|
||||
dyeMenuName = dyeMenuSettings.node(DYE_MENU_NAME).getString("Dye Menu");
|
||||
dyeMenuInputSlot = dyeMenuSettings.node(DYE_MENU_INPUT_SLOT).getInt(19);
|
||||
dyeMenuOutputSlot = dyeMenuSettings.node(DYE_MENU_OUTPUT_SLOT).getInt(25);
|
||||
}
|
||||
|
||||
private static Vector loadVector(final ConfigurationNode config) {
|
||||
@@ -178,6 +184,8 @@ public class Settings {
|
||||
public static String getDyeMenuName() {
|
||||
return dyeMenuName;
|
||||
}
|
||||
public static int getDyeMenuInputSlot() { return dyeMenuInputSlot; }
|
||||
public static int getDyeMenuOutputSlot() { return dyeMenuOutputSlot; }
|
||||
|
||||
public static boolean isDebugEnabled() {
|
||||
return debugMode;
|
||||
|
||||
@@ -30,10 +30,10 @@ public class DyeMenu {
|
||||
Player player = user.getPlayer();
|
||||
Gui gui = HMCColorApi.INSTANCE.colorMenu();
|
||||
gui.updateTitle(Placeholder.applyPapiPlaceholders(player, Settings.getDyeMenuName()));
|
||||
gui.setItem(19, new GuiItem(originalItem));
|
||||
gui.setItem(Settings.getDyeMenuInputSlot(), new GuiItem(originalItem));
|
||||
gui.setDefaultTopClickAction(event -> {
|
||||
if (event.getSlot() == 25) {
|
||||
ItemStack item = event.getInventory().getItem(25);
|
||||
if (event.getSlot() == Settings.getDyeMenuOutputSlot()) {
|
||||
ItemStack item = event.getInventory().getItem(Settings.getDyeMenuOutputSlot());
|
||||
if (item == null) return;
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
if (meta == null) return;
|
||||
|
||||
Reference in New Issue
Block a user