diff --git a/pom.xml b/pom.xml index 5bab183..e67c104 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ de.jeffclan JeffChestSort - 7.0-SNAPSHOT-1 + 7.0 jar JeffChestSort diff --git a/src/main/java/de/jeffclan/JeffChestSort/JeffChestSortCommandExecutor.java b/src/main/java/de/jeffclan/JeffChestSort/JeffChestSortCommandExecutor.java index 6663c41..02bdf22 100644 --- a/src/main/java/de/jeffclan/JeffChestSort/JeffChestSortCommandExecutor.java +++ b/src/main/java/de/jeffclan/JeffChestSort/JeffChestSortCommandExecutor.java @@ -33,10 +33,10 @@ public class JeffChestSortCommandExecutor implements CommandExecutor { if(args.length>0) { if(args[0].equalsIgnoreCase("hotkey") || args[0].equalsIgnoreCase("hotkeys")) { - if(plugin.hotkeyGUI==false) { - p.sendMessage(plugin.messages.MSG_ERR_HOTKEYSDISABLED); - return true; - } +// if(plugin.hotkeyGUI==false) { +// p.sendMessage(plugin.messages.MSG_ERR_HOTKEYSDISABLED); +// return true; +// } plugin.settingsGUI.openGUI(p); diff --git a/src/main/java/de/jeffclan/JeffChestSort/JeffChestSortListener.java b/src/main/java/de/jeffclan/JeffChestSort/JeffChestSortListener.java index 3f8a1a1..964ea1e 100644 --- a/src/main/java/de/jeffclan/JeffChestSort/JeffChestSortListener.java +++ b/src/main/java/de/jeffclan/JeffChestSort/JeffChestSortListener.java @@ -422,8 +422,7 @@ public class JeffChestSortListener implements Listener { if(event.getClickedInventory()==null) { return; } - - if(event.getClickedInventory() != setting.guiInventory) { + if(!event.getClickedInventory().equals(setting.guiInventory)) { return; } diff --git a/src/main/java/de/jeffclan/JeffChestSort/JeffChestSortMessages.java b/src/main/java/de/jeffclan/JeffChestSort/JeffChestSortMessages.java index df67e80..98ff629 100644 --- a/src/main/java/de/jeffclan/JeffChestSort/JeffChestSortMessages.java +++ b/src/main/java/de/jeffclan/JeffChestSort/JeffChestSortMessages.java @@ -14,7 +14,7 @@ public class JeffChestSortMessages { JeffChestSortPlugin plugin; final String MSG_ACTIVATED, MSG_DEACTIVATED, MSG_COMMANDMESSAGE, MSG_COMMANDMESSAGE2, MSG_PLAYERSONLY, - MSG_PLAYERINVSORTED, MSG_INVALIDOPTIONS, MSG_ERR_HOTKEYSDISABLED; + MSG_PLAYERINVSORTED, MSG_INVALIDOPTIONS; final String MSG_GUI_ENABLED, MSG_GUI_DISABLED; @@ -62,7 +62,7 @@ public class JeffChestSortMessages { MSG_GUI_SHIFTRIGHTCLICK = ChatColor.translateAlternateColorCodes('&', plugin.getConfig() .getString("message-gui-shift-right-click","Shift + Right-Click")); - MSG_ERR_HOTKEYSDISABLED = ChatColor.RED + "[ChestSort] Hotkey settings are only available for Minecraft 1.14 and later."; + //MSG_ERR_HOTKEYSDISABLED = ChatColor.RED + "[ChestSort] Hotkeys are only available for Minecraft 1.9 and later."; } } diff --git a/src/main/java/de/jeffclan/JeffChestSort/JeffChestSortPlugin.java b/src/main/java/de/jeffclan/JeffChestSort/JeffChestSortPlugin.java index cd7ebdf..4faf59d 100644 --- a/src/main/java/de/jeffclan/JeffChestSort/JeffChestSortPlugin.java +++ b/src/main/java/de/jeffclan/JeffChestSort/JeffChestSortPlugin.java @@ -235,10 +235,10 @@ public class JeffChestSortPlugin extends JavaPlugin { mcMinorVersion = Integer.parseInt(tmpVersion.substring(0,tmpVersion.indexOf("_"))); //getLogger().info("Running MC version 1."+mcMinorVersion); - if(mcMinorVersion < 14) { - getLogger().info("You are running a Minecraft version below 1.14. Hotkey GUI will be disabled."); - hotkeyGUI = false; - } +// if(mcMinorVersion < 9) { +// getLogger().info("You are running a Minecraft version below 1.9. Hotkey GUI will be disabled."); +// hotkeyGUI = false; +// } // Create the config file, including checks for old config versions, and load // the default values for unset options diff --git a/src/main/java/de/jeffclan/JeffChestSort/JeffChestSortSettingsGUI.java b/src/main/java/de/jeffclan/JeffChestSort/JeffChestSortSettingsGUI.java index be05cba..487eeb7 100644 --- a/src/main/java/de/jeffclan/JeffChestSort/JeffChestSortSettingsGUI.java +++ b/src/main/java/de/jeffclan/JeffChestSort/JeffChestSortSettingsGUI.java @@ -18,6 +18,9 @@ public class JeffChestSortSettingsGUI { public static int slotDoubleClick = 5 + 9; public static int slotShiftRightClick = 7 + 9; + final static Material red = Material.REDSTONE_BLOCK; + final static Material green = Material.EMERALD_BLOCK; + enum Hotkey { MiddleClick, ShiftClick, DoubleClick, ShiftRightClick; } @@ -29,12 +32,17 @@ public class JeffChestSortSettingsGUI { ItemStack getItem(boolean active, Hotkey hotkey) { ItemStack is = null; String suffix; - Material green = Material.getMaterial("GREEN_WOOL"); - Material red = Material.getMaterial("RED_WOOL"); + //Material green = Material.getMaterial("GREEN_WOOL"); + //Material red = Material.getMaterial("RED_WOOL"); + //Material green = Material.GREEN_WOOL; + //Material red = Material.RED_WOOL; - if(green==null || red==null) { - return null; - } +// if(green==null || red==null) { +// //plugin.getLogger().warning("Using unsupported Minecraft version"); +// green = Material.EMERALD_BLOCK; +// red = Material.REDSTONE_BLOCK; +// //return null; +// } if(active) { is = new ItemStack(green); @@ -75,10 +83,10 @@ public class JeffChestSortSettingsGUI { JeffChestSortPlayerSetting setting = plugin.PerPlayerSettings.get(player.getUniqueId().toString()); // Test if running 1.13 or later - if(Material.getMaterial("GREEN_WOOL") == null) { - player.sendMessage(plugin.messages.MSG_ERR_HOTKEYSDISABLED); - return; - } +// if(Material.getMaterial("GREEN_WOOL") == null) { +// player.sendMessage(plugin.messages.MSG_ERR_HOTKEYSDISABLED); +// return; +// } inventory.setItem(slotMiddleClick, getItem(setting.middleClick,Hotkey.MiddleClick)); inventory.setItem(slotShiftClick, getItem(setting.shiftClick,Hotkey.ShiftClick)); diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index cde6a8c..2668ec6 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ main: de.jeffclan.JeffChestSort.JeffChestSortPlugin name: ChestSort -version: 7.0-SNAPSHOT-1 +version: 7.0 api-version: 1.13 description: Allows automatic chest sorting author: mfnalex @@ -11,7 +11,7 @@ loadbefore: [InvUnload] softdepend: [CrackShot, InventoryPages] commands: chestsort: - description: Toggle automatic chest sorting + description: Toggle automatic chest sorting. usage: / aliases: sort permission: chestsort.use