8.17.1-SNAPSHOT

This commit is contained in:
mfnalex 2020-07-18 16:19:40 +02:00
parent c48da61e43
commit 3ee0da41cd
4 changed files with 28 additions and 5 deletions

View File

@ -1,5 +1,8 @@
# Changelog
## 8.17.1-SNAPSHOT
- Added possibility to sort a player's inventory from console using /invsort <player> [toggle|on|off|hotbar|inv|all]
## 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.

View File

@ -9,7 +9,7 @@
<name>ChestSort</name>
<url>https://www.chestsort.de</url>
<description>Automatically sorts your chests!</description>
<version>8.17.0</version>
<version>8.17.1-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>

View File

@ -1,5 +1,6 @@
package de.jeff_media.ChestSort;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
@ -17,6 +18,8 @@ public class ChestSortInvSortCommand implements CommandExecutor {
@Override
public boolean onCommand(@NotNull CommandSender sender, Command command, @NotNull String label, String[] args) {
Player p = null;
// This command toggles automatic chest sorting for the player that runs the command
if (!command.getName().equalsIgnoreCase("invsort")) {
return false;
@ -27,11 +30,28 @@ public class ChestSortInvSortCommand implements CommandExecutor {
}
if (!(sender instanceof Player)) {
sender.sendMessage(plugin.messages.MSG_PLAYERSONLY);
return true;
if(args.length==0) {
sender.sendMessage(plugin.messages.MSG_PLAYERSONLY);
return true;
}
// Console can sort player's inventories
if(Bukkit.getPlayer(args[0]) == null) {
sender.sendMessage("Could not find player "+args[0]);
return true;
}
p = Bukkit.getPlayer(args[0]);
if(args.length>1) {
args = new String[] { args[1] };
}
//sender.sendMessage(plugin.messages.MSG_PLAYERSONLY);
//return true;
}
Player p = (Player) sender;
if(p == null) p = (Player) sender;
int start = 9;
int end = 35;

View File

@ -1,6 +1,6 @@
main: de.jeff_media.ChestSort.ChestSortPlugin
name: ChestSort
version: 8.17.0
version: 8.17.1-SNAPSHOT
api-version: "1.13"
description: Allows automatic chest sorting
author: mfnalex