mirror of
https://github.com/JEFF-Media-GbR/ChestSort.git
synced 2024-12-02 15:43:22 +01:00
Merge branch 'master' into 8.16.1
This commit is contained in:
commit
029dcee228
@ -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.
|
||||
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user