mirror of
https://github.com/JEFF-Media-GbR/ChestSort.git
synced 2024-12-03 08:03:26 +01:00
10.2.0 release
This commit is contained in:
parent
70522f9fdd
commit
5a251848c5
@ -1,5 +1,8 @@
|
||||
# Changelog
|
||||
|
||||
## 10.2.0
|
||||
- Added config option "allow-commands"
|
||||
|
||||
## 10.1.0
|
||||
- Added config option "prevent-sorting-null-inventories"
|
||||
- Updated Chinese (Traditional) translation
|
||||
|
2
pom.xml
2
pom.xml
@ -9,7 +9,7 @@
|
||||
<name>ChestSort</name>
|
||||
<url>https://www.chestsort.de</url>
|
||||
<description>Allows automatic chest sorting!</description>
|
||||
<version>10.1.0</version>
|
||||
<version>10.2.0</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
|
@ -723,6 +723,7 @@ public class ChestSortPlugin extends JavaPlugin {
|
||||
getConfig().addDefault("additional-hotkeys.right-click", false);
|
||||
getConfig().addDefault("dump", false);
|
||||
getConfig().addDefault("log", false);
|
||||
getConfig().addDefault("allow-commands", true);
|
||||
|
||||
getConfig().addDefault("hook-crackshot", true);
|
||||
getConfig().addDefault("hook-crackshot-prefix", "crackshot_weapon");
|
||||
|
@ -27,6 +27,11 @@ public class ChestSortCommand implements CommandExecutor {
|
||||
if (!command.getName().equalsIgnoreCase("sort")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!plugin.getConfig().getBoolean("allow-commands")) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
// Reload command
|
||||
if(args.length>0 && args[0].equalsIgnoreCase("reload")) {
|
||||
|
@ -24,6 +24,11 @@ public class InvSortCommand implements CommandExecutor {
|
||||
|
||||
Player p = null;
|
||||
|
||||
if(!plugin.getConfig().getBoolean("allow-commands")) {
|
||||
sender.sendMessage(command.getPermissionMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
if(args.length>0 && args[0].equalsIgnoreCase("help")) {
|
||||
return false;
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package de.jeff_media.chestsort.commands;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import de.jeff_media.chestsort.ChestSortPlugin;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@ -11,6 +12,7 @@ public class TabCompleter implements org.bukkit.command.TabCompleter {
|
||||
|
||||
static final String[] chestsortOptions = { "toggle","on","off","hotkeys","help" };
|
||||
static final String[] invsortOptions = { "toggle","on","off","all", "hotbar", "inv","help" };
|
||||
private final ChestSortPlugin plugin = ChestSortPlugin.getInstance();
|
||||
|
||||
private List<String> getMatchingOptions(String entered, String[] options) {
|
||||
List<String> list = new ArrayList<>();
|
||||
@ -25,6 +27,10 @@ public class TabCompleter implements org.bukkit.command.TabCompleter {
|
||||
}
|
||||
|
||||
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, String[] args) {
|
||||
|
||||
if(!plugin.getConfig().getBoolean("allow-commands")) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String entered = "";
|
||||
if(args.length>0) {
|
||||
|
@ -76,6 +76,10 @@ sorting-enabled-by-default: false
|
||||
# once to enable automatic inventory sorting.
|
||||
inv-sorting-enabled-by-default: false
|
||||
|
||||
# You can prevent players from using the /chestsort and /invsort commands by setting
|
||||
# this to false.
|
||||
allow-commands: true
|
||||
|
||||
# when set to true, players with sorting DISABLED will be
|
||||
# shown a message on how to enable automatic chest sorting
|
||||
# when they use a chest for the first time.
|
||||
|
Loading…
Reference in New Issue
Block a user