Merge branch 'master' into 8.16.1

This commit is contained in:
mfnalex 2020-07-24 16:40:25 +02:00 committed by GitHub
commit 029dcee228
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 46 additions and 2 deletions

View File

@ -1,10 +1,16 @@
# Changelog
## 8.17.1-SNAPSHOT
## 8.17.2
- Added possibility to sort a player's inventory from console using /invsort <player> [toggle|on|off|hotbar|inv|all]
- Added placeholders (see new config.yml)
- Added "use permissions" metric
## 8.17.1
- Improved sorting of colored blocks
- White, light gray, gray and black comes first
- Remaining colors are sorted in a rainbow like order
## 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

@ -105,6 +105,44 @@ public class ChestSortOrganizer {
}
static String getColorOrdered(String c) {
switch(c) {
case "white":
return "01_white";
case "light_gray":
return "02_light_gray";
case "gray":
return "03_gray";
case "black":
return "04_black";
case "brown":
return "05_brown";
case "red":
return "06_red";
case "orange":
return "07_orange";
case "yellow":
return "08_yellow";
case "lime":
return "09_lime";
case "green":
return "10_green";
case "cyan":
return "11_cyan";
case "light_blue":
return "12_light_blue";
case "blue":
return "13_blue";
case "magenta":
return "14_magenta";
case "purple":
return "15_purple";
case "pink":
return "16_pink";
}
return "";
}
static int getNumberOfEnchantments(ItemStack is) {
int totalEnchants = 0;
@ -214,7 +252,7 @@ public class ChestSortOrganizer {
for (String color : colors) {
if (typeName.startsWith(color)) {
typeName = typeName.replaceFirst(color + "_", "");
myColor = color;
myColor = getColorOrdered(color);
}
}
// Same for wood, but the wood name can also be in the middle of the item name,