mirror of
https://github.com/JEFF-Media-GbR/ChestSort.git
synced 2024-12-12 04:17:44 +01:00
8.17.0
This commit is contained in:
parent
f0d7c9ed1e
commit
a6f0b72ba5
@ -1,5 +1,8 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 8.17.0
|
||||||
|
- Added option to disable automatic sorting and/or automatic inventory sorting. Hotkeys will still work if enabled. When running /chestsort while automatic sorting is disabled, it will display the hotkeys gui instead.
|
||||||
|
|
||||||
## 8.16.1
|
## 8.16.1
|
||||||
- Allow middle-click hotkey in creative mode when clicked slot is empty
|
- Allow middle-click hotkey in creative mode when clicked slot is empty
|
||||||
|
|
||||||
|
2
pom.xml
2
pom.xml
@ -9,7 +9,7 @@
|
|||||||
<name>ChestSort</name>
|
<name>ChestSort</name>
|
||||||
<url>https://www.chestsort.de</url>
|
<url>https://www.chestsort.de</url>
|
||||||
<description>Automatically sorts your chests!</description>
|
<description>Automatically sorts your chests!</description>
|
||||||
<version>8.16.0</version>
|
<version>8.17.0</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
@ -72,6 +72,8 @@ public class ChestSortChestSortCommand implements CommandExecutor {
|
|||||||
// fix for Spigot's stupid /reload function
|
// fix for Spigot's stupid /reload function
|
||||||
plugin.registerPlayerIfNeeded(p);
|
plugin.registerPlayerIfNeeded(p);
|
||||||
|
|
||||||
|
if(!plugin.getConfig().getBoolean("allow-automatic-sorting")) args=new String[] {"hotkeys"};
|
||||||
|
|
||||||
// Settings GUI
|
// Settings GUI
|
||||||
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")) {
|
||||||
|
@ -38,6 +38,8 @@ public class ChestSortInvSortCommand implements CommandExecutor {
|
|||||||
|
|
||||||
ChestSortPlayerSetting setting = plugin.perPlayerSettings.get(p.getUniqueId().toString());
|
ChestSortPlayerSetting setting = plugin.perPlayerSettings.get(p.getUniqueId().toString());
|
||||||
|
|
||||||
|
if(!plugin.getConfig().getBoolean("allow-automatic-inventory-sorting")) args=new String[]{"inv"};
|
||||||
|
|
||||||
if(args.length>0) {
|
if(args.length>0) {
|
||||||
if(args[0].equalsIgnoreCase("all")) {
|
if(args[0].equalsIgnoreCase("all")) {
|
||||||
start=0;
|
start=0;
|
||||||
|
@ -74,6 +74,7 @@ public class ChestSortListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void onBackPackUse(Inventory inv, Player p) {
|
void onBackPackUse(Inventory inv, Player p) {
|
||||||
|
if(!plugin.getConfig().getBoolean("allow-automatic-sorting")) return; //TODO: Maybe change to allow-automatic-inventory-sorting ?
|
||||||
if (!minepacksHook.isMinepacksBackpack(inv)) return;
|
if (!minepacksHook.isMinepacksBackpack(inv)) return;
|
||||||
if (!p.hasPermission("chestsort.use")) return;
|
if (!p.hasPermission("chestsort.use")) return;
|
||||||
plugin.registerPlayerIfNeeded(p);
|
plugin.registerPlayerIfNeeded(p);
|
||||||
@ -84,6 +85,9 @@ public class ChestSortListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerInventoryClose(InventoryCloseEvent event) {
|
public void onPlayerInventoryClose(InventoryCloseEvent event) {
|
||||||
|
|
||||||
|
if(!plugin.getConfig().getBoolean("allow-automatic-inventory-sorting")) return;
|
||||||
|
|
||||||
if (event.getInventory().getHolder() == null) return;
|
if (event.getInventory().getHolder() == null) return;
|
||||||
// Might be obsolete, because its @NotNull in 1.15, but who knows if thats for 1.8
|
// Might be obsolete, because its @NotNull in 1.15, but who knows if thats for 1.8
|
||||||
if (event.getInventory().getType() == null) return;
|
if (event.getInventory().getType() == null) return;
|
||||||
@ -112,6 +116,8 @@ public class ChestSortListener implements Listener {
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void onChestClose(InventoryCloseEvent event) {
|
public void onChestClose(InventoryCloseEvent event) {
|
||||||
|
|
||||||
|
if(!plugin.getConfig().getBoolean("allow-automatic-sorting")) return;
|
||||||
|
|
||||||
if (!(plugin.getConfig().getString("sort-time").equalsIgnoreCase("close")
|
if (!(plugin.getConfig().getString("sort-time").equalsIgnoreCase("close")
|
||||||
|| plugin.getConfig().getString("sort-time").equalsIgnoreCase("both"))) {
|
|| plugin.getConfig().getString("sort-time").equalsIgnoreCase("both"))) {
|
||||||
return;
|
return;
|
||||||
@ -151,6 +157,8 @@ public class ChestSortListener implements Listener {
|
|||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void onChestOpen(InventoryOpenEvent event) {
|
public void onChestOpen(InventoryOpenEvent event) {
|
||||||
|
|
||||||
|
if(!plugin.getConfig().getBoolean("allow-automatic-sorting")) return;
|
||||||
|
|
||||||
if (!(plugin.getConfig().getString("sort-time").equalsIgnoreCase("open")
|
if (!(plugin.getConfig().getString("sort-time").equalsIgnoreCase("open")
|
||||||
|| plugin.getConfig().getString("sort-time").equalsIgnoreCase("both"))) {
|
|| plugin.getConfig().getString("sort-time").equalsIgnoreCase("both"))) {
|
||||||
return;
|
return;
|
||||||
@ -287,6 +295,8 @@ public class ChestSortListener implements Listener {
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void onEnderChestOpen(InventoryOpenEvent event) {
|
public void onEnderChestOpen(InventoryOpenEvent event) {
|
||||||
|
|
||||||
|
if(!plugin.getConfig().getBoolean("allow-automatic-sorting")) return;
|
||||||
|
|
||||||
if (!(event.getPlayer() instanceof Player)) {
|
if (!(event.getPlayer() instanceof Player)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ public class ChestSortPlugin extends JavaPlugin implements de.jeff_media.ChestSo
|
|||||||
String sortingMethod;
|
String sortingMethod;
|
||||||
ArrayList<String> disabledWorlds;
|
ArrayList<String> disabledWorlds;
|
||||||
ChestSortAPIHandler api;
|
ChestSortAPIHandler api;
|
||||||
final int currentConfigVersion = 40;
|
final int currentConfigVersion = 41;
|
||||||
boolean usingMatchingConfig = true;
|
boolean usingMatchingConfig = true;
|
||||||
protected boolean debug = false;
|
protected boolean debug = false;
|
||||||
boolean verbose = true;
|
boolean verbose = true;
|
||||||
@ -184,6 +184,8 @@ public class ChestSortPlugin extends JavaPlugin implements de.jeff_media.ChestSo
|
|||||||
// for every missing option.
|
// for every missing option.
|
||||||
// By default, sorting is disabled. Every player has to run /chestsort once
|
// By default, sorting is disabled. Every player has to run /chestsort once
|
||||||
getConfig().addDefault("use-permissions", true);
|
getConfig().addDefault("use-permissions", true);
|
||||||
|
getConfig().addDefault("allow-automatic-sorting",true);
|
||||||
|
getConfig().addDefault("allow-automatic-inventory-sorting",true);
|
||||||
getConfig().addDefault("sorting-enabled-by-default", false);
|
getConfig().addDefault("sorting-enabled-by-default", false);
|
||||||
getConfig().addDefault("inv-sorting-enabled-by-default", false);
|
getConfig().addDefault("inv-sorting-enabled-by-default", false);
|
||||||
getConfig().addDefault("show-message-when-using-chest", true);
|
getConfig().addDefault("show-message-when-using-chest", true);
|
||||||
@ -283,6 +285,12 @@ public class ChestSortPlugin extends JavaPlugin implements de.jeff_media.ChestSo
|
|||||||
new Metrics.SimplePie("check_for_updates", () -> getConfig().getString("check-for-updates", "true")));
|
new Metrics.SimplePie("check_for_updates", () -> getConfig().getString("check-for-updates", "true")));
|
||||||
bStats.addCustomChart(
|
bStats.addCustomChart(
|
||||||
new Metrics.SimplePie("update_interval", () -> Long.toString(updateCheckInterval)));
|
new Metrics.SimplePie("update_interval", () -> Long.toString(updateCheckInterval)));
|
||||||
|
|
||||||
|
bStats.addCustomChart(new Metrics.SimplePie("allow_automatic_sorting",
|
||||||
|
() -> Boolean.toString(getConfig().getBoolean("allow-automatic-sorting"))));
|
||||||
|
bStats.addCustomChart(new Metrics.SimplePie("allow_automatic_inv_sorting",
|
||||||
|
() -> Boolean.toString(getConfig().getBoolean("allow-automatic-inventory-sorting"))));
|
||||||
|
|
||||||
bStats.addCustomChart(new Metrics.SimplePie("show_message_when_using_chest",
|
bStats.addCustomChart(new Metrics.SimplePie("show_message_when_using_chest",
|
||||||
() -> Boolean.toString(getConfig().getBoolean("show-message-when-using-chest"))));
|
() -> Boolean.toString(getConfig().getBoolean("show-message-when-using-chest"))));
|
||||||
bStats.addCustomChart(new Metrics.SimplePie("show_message_when_using_chest_and_sorting_is_enabl", () -> Boolean
|
bStats.addCustomChart(new Metrics.SimplePie("show_message_when_using_chest_and_sorting_is_enabl", () -> Boolean
|
||||||
|
@ -28,6 +28,14 @@
|
|||||||
# - chestsort.use.inventory (allow inventory sorting by hotkeys and via /invsort)
|
# - chestsort.use.inventory (allow inventory sorting by hotkeys and via /invsort)
|
||||||
use-permissions: true
|
use-permissions: true
|
||||||
|
|
||||||
|
# when set to false, no player is allowed to enable automatic chest sorting
|
||||||
|
# hotkeys will still work if enabled
|
||||||
|
allow-automatic-sorting: true
|
||||||
|
|
||||||
|
# when set to false, no player is allowed to enable automatic inventory sorting
|
||||||
|
# hotkeys will still work if enabled
|
||||||
|
allow-automatic-inventory-sorting: true
|
||||||
|
|
||||||
# when set to false, new players will have to run /chestsort
|
# when set to false, new players will have to run /chestsort
|
||||||
# once to enable automatic chest sorting.
|
# once to enable automatic chest sorting.
|
||||||
sorting-enabled-by-default: false
|
sorting-enabled-by-default: false
|
||||||
@ -580,4 +588,4 @@ log: false
|
|||||||
|
|
||||||
# Please DO NOT change the following line manually!
|
# Please DO NOT change the following line manually!
|
||||||
# It is used by the automatic config updater.
|
# It is used by the automatic config updater.
|
||||||
config-version: 40
|
config-version: 41
|
@ -1,6 +1,6 @@
|
|||||||
main: de.jeff_media.ChestSort.ChestSortPlugin
|
main: de.jeff_media.ChestSort.ChestSortPlugin
|
||||||
name: ChestSort
|
name: ChestSort
|
||||||
version: 8.16.0
|
version: 8.17.0
|
||||||
api-version: "1.13"
|
api-version: "1.13"
|
||||||
description: Allows automatic chest sorting
|
description: Allows automatic chest sorting
|
||||||
author: mfnalex
|
author: mfnalex
|
||||||
|
Loading…
Reference in New Issue
Block a user