7.0 release

This commit is contained in:
mfnalex 2019-08-01 18:50:22 +02:00
parent 0bdc56a58c
commit 2acb0ceaec
7 changed files with 31 additions and 24 deletions

View File

@ -6,7 +6,7 @@
<groupId>de.jeffclan</groupId>
<artifactId>JeffChestSort</artifactId>
<version>7.0-SNAPSHOT-1</version>
<version>7.0</version>
<packaging>jar</packaging>
<name>JeffChestSort</name>

View File

@ -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);

View File

@ -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;
}

View File

@ -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.";
}
}

View File

@ -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

View File

@ -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));

View File

@ -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: /<command>
aliases: sort
permission: chestsort.use