mirror of
https://github.com/JEFF-Media-GbR/ChestSort.git
synced 2025-01-07 08:57:44 +01:00
7.0 release
This commit is contained in:
parent
0bdc56a58c
commit
2acb0ceaec
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>de.jeffclan</groupId>
|
<groupId>de.jeffclan</groupId>
|
||||||
<artifactId>JeffChestSort</artifactId>
|
<artifactId>JeffChestSort</artifactId>
|
||||||
<version>7.0-SNAPSHOT-1</version>
|
<version>7.0</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>JeffChestSort</name>
|
<name>JeffChestSort</name>
|
||||||
|
@ -33,10 +33,10 @@ public class JeffChestSortCommandExecutor implements CommandExecutor {
|
|||||||
if(args.length>0) {
|
if(args.length>0) {
|
||||||
if(args[0].equalsIgnoreCase("hotkey") || args[0].equalsIgnoreCase("hotkeys")) {
|
if(args[0].equalsIgnoreCase("hotkey") || args[0].equalsIgnoreCase("hotkeys")) {
|
||||||
|
|
||||||
if(plugin.hotkeyGUI==false) {
|
// if(plugin.hotkeyGUI==false) {
|
||||||
p.sendMessage(plugin.messages.MSG_ERR_HOTKEYSDISABLED);
|
// p.sendMessage(plugin.messages.MSG_ERR_HOTKEYSDISABLED);
|
||||||
return true;
|
// return true;
|
||||||
}
|
// }
|
||||||
|
|
||||||
plugin.settingsGUI.openGUI(p);
|
plugin.settingsGUI.openGUI(p);
|
||||||
|
|
||||||
|
@ -422,8 +422,7 @@ public class JeffChestSortListener implements Listener {
|
|||||||
if(event.getClickedInventory()==null) {
|
if(event.getClickedInventory()==null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if(!event.getClickedInventory().equals(setting.guiInventory)) {
|
||||||
if(event.getClickedInventory() != setting.guiInventory) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ public class JeffChestSortMessages {
|
|||||||
JeffChestSortPlugin plugin;
|
JeffChestSortPlugin plugin;
|
||||||
|
|
||||||
final String MSG_ACTIVATED, MSG_DEACTIVATED, MSG_COMMANDMESSAGE, MSG_COMMANDMESSAGE2, MSG_PLAYERSONLY,
|
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;
|
final String MSG_GUI_ENABLED, MSG_GUI_DISABLED;
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ public class JeffChestSortMessages {
|
|||||||
MSG_GUI_SHIFTRIGHTCLICK = ChatColor.translateAlternateColorCodes('&', plugin.getConfig()
|
MSG_GUI_SHIFTRIGHTCLICK = ChatColor.translateAlternateColorCodes('&', plugin.getConfig()
|
||||||
.getString("message-gui-shift-right-click","Shift + Right-Click"));
|
.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.";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -235,10 +235,10 @@ public class JeffChestSortPlugin extends JavaPlugin {
|
|||||||
mcMinorVersion = Integer.parseInt(tmpVersion.substring(0,tmpVersion.indexOf("_")));
|
mcMinorVersion = Integer.parseInt(tmpVersion.substring(0,tmpVersion.indexOf("_")));
|
||||||
|
|
||||||
//getLogger().info("Running MC version 1."+mcMinorVersion);
|
//getLogger().info("Running MC version 1."+mcMinorVersion);
|
||||||
if(mcMinorVersion < 14) {
|
// if(mcMinorVersion < 9) {
|
||||||
getLogger().info("You are running a Minecraft version below 1.14. Hotkey GUI will be disabled.");
|
// getLogger().info("You are running a Minecraft version below 1.9. Hotkey GUI will be disabled.");
|
||||||
hotkeyGUI = false;
|
// hotkeyGUI = false;
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Create the config file, including checks for old config versions, and load
|
// Create the config file, including checks for old config versions, and load
|
||||||
// the default values for unset options
|
// the default values for unset options
|
||||||
|
@ -18,6 +18,9 @@ public class JeffChestSortSettingsGUI {
|
|||||||
public static int slotDoubleClick = 5 + 9;
|
public static int slotDoubleClick = 5 + 9;
|
||||||
public static int slotShiftRightClick = 7 + 9;
|
public static int slotShiftRightClick = 7 + 9;
|
||||||
|
|
||||||
|
final static Material red = Material.REDSTONE_BLOCK;
|
||||||
|
final static Material green = Material.EMERALD_BLOCK;
|
||||||
|
|
||||||
enum Hotkey {
|
enum Hotkey {
|
||||||
MiddleClick, ShiftClick, DoubleClick, ShiftRightClick;
|
MiddleClick, ShiftClick, DoubleClick, ShiftRightClick;
|
||||||
}
|
}
|
||||||
@ -29,12 +32,17 @@ public class JeffChestSortSettingsGUI {
|
|||||||
ItemStack getItem(boolean active, Hotkey hotkey) {
|
ItemStack getItem(boolean active, Hotkey hotkey) {
|
||||||
ItemStack is = null;
|
ItemStack is = null;
|
||||||
String suffix;
|
String suffix;
|
||||||
Material green = Material.getMaterial("GREEN_WOOL");
|
//Material green = Material.getMaterial("GREEN_WOOL");
|
||||||
Material red = Material.getMaterial("RED_WOOL");
|
//Material red = Material.getMaterial("RED_WOOL");
|
||||||
|
//Material green = Material.GREEN_WOOL;
|
||||||
|
//Material red = Material.RED_WOOL;
|
||||||
|
|
||||||
if(green==null || red==null) {
|
// if(green==null || red==null) {
|
||||||
return null;
|
// //plugin.getLogger().warning("Using unsupported Minecraft version");
|
||||||
}
|
// green = Material.EMERALD_BLOCK;
|
||||||
|
// red = Material.REDSTONE_BLOCK;
|
||||||
|
// //return null;
|
||||||
|
// }
|
||||||
|
|
||||||
if(active) {
|
if(active) {
|
||||||
is = new ItemStack(green);
|
is = new ItemStack(green);
|
||||||
@ -75,10 +83,10 @@ public class JeffChestSortSettingsGUI {
|
|||||||
JeffChestSortPlayerSetting setting = plugin.PerPlayerSettings.get(player.getUniqueId().toString());
|
JeffChestSortPlayerSetting setting = plugin.PerPlayerSettings.get(player.getUniqueId().toString());
|
||||||
|
|
||||||
// Test if running 1.13 or later
|
// Test if running 1.13 or later
|
||||||
if(Material.getMaterial("GREEN_WOOL") == null) {
|
// if(Material.getMaterial("GREEN_WOOL") == null) {
|
||||||
player.sendMessage(plugin.messages.MSG_ERR_HOTKEYSDISABLED);
|
// player.sendMessage(plugin.messages.MSG_ERR_HOTKEYSDISABLED);
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
inventory.setItem(slotMiddleClick, getItem(setting.middleClick,Hotkey.MiddleClick));
|
inventory.setItem(slotMiddleClick, getItem(setting.middleClick,Hotkey.MiddleClick));
|
||||||
inventory.setItem(slotShiftClick, getItem(setting.shiftClick,Hotkey.ShiftClick));
|
inventory.setItem(slotShiftClick, getItem(setting.shiftClick,Hotkey.ShiftClick));
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
main: de.jeffclan.JeffChestSort.JeffChestSortPlugin
|
main: de.jeffclan.JeffChestSort.JeffChestSortPlugin
|
||||||
name: ChestSort
|
name: ChestSort
|
||||||
version: 7.0-SNAPSHOT-1
|
version: 7.0
|
||||||
api-version: 1.13
|
api-version: 1.13
|
||||||
description: Allows automatic chest sorting
|
description: Allows automatic chest sorting
|
||||||
author: mfnalex
|
author: mfnalex
|
||||||
@ -11,7 +11,7 @@ loadbefore: [InvUnload]
|
|||||||
softdepend: [CrackShot, InventoryPages]
|
softdepend: [CrackShot, InventoryPages]
|
||||||
commands:
|
commands:
|
||||||
chestsort:
|
chestsort:
|
||||||
description: Toggle automatic chest sorting
|
description: Toggle automatic chest sorting.
|
||||||
usage: /<command>
|
usage: /<command>
|
||||||
aliases: sort
|
aliases: sort
|
||||||
permission: chestsort.use
|
permission: chestsort.use
|
||||||
|
Loading…
Reference in New Issue
Block a user