8.13.0-SNAPSHOT

This commit is contained in:
mfnalex 2020-07-04 16:09:06 +02:00
parent 3870e63a1e
commit 40147f0d0d
6 changed files with 24 additions and 3 deletions

View File

@ -2,6 +2,8 @@
## 8.13.0-SNAPSHOT
- Updated Chinese (Traditional) translation
- Added option to log ChestSort actions in a log file (default: false)
- Print console warnings when 3rd party plugins use deprecated ChestSort API methods
- Small code cleanup
## 8.12.2
- Fixes NullPointerException when using EssentialsX' /ec command in Minecraft 1.12

View File

@ -37,7 +37,7 @@ public class ChestSortConfigUpdater {
try {
Files.deleteIfExists(new File(plugin.getDataFolder().getAbsolutePath()+File.separator+"config.old.yml").toPath());
} catch (IOException e) {
} catch (IOException ignored) {
}

View File

@ -92,18 +92,24 @@ public class ChestSortPlugin extends JavaPlugin {
// Public API method to sort any given inventory
@Deprecated
public void sortInventory(Inventory inv) {
StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace();
getLogger().warning(String.format("%s has performed a call to a deprecated ChestSort API method. This is NOT a ChestSort error.",stackTraceElements[2]));
api.sortInventory(inv);
}
// Public API method to sort any given inventory inbetween startSlot and endSlot
@Deprecated
public void sortInventory(Inventory inv, int startSlot, int endSlot) {
StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace();
getLogger().warning(String.format("%s has performed a call to a deprecated ChestSort API method. This is NOT a ChestSort error.",stackTraceElements[2]));
api.sortInventory(inv, startSlot, endSlot);
}
// Public API method to check if player has automatic chest sorting enabled
@Deprecated
public boolean sortingEnabled(Player p) {
StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace();
getLogger().warning(String.format("%s has performed a call to a deprecated ChestSort API method. This is NOT a ChestSort error.",stackTraceElements[2]));
return isSortingEnabled(p);
}

View File

@ -0,0 +1,13 @@
package de.jeff_media.ChestSort.test;
import de.jeff_media.ChestSort.ChestSortPlugin;
import org.bukkit.entity.Player;
public class APIDeprecation {
public static void sortInventoryDeprecated(Player p, ChestSortPlugin plugin) {
plugin.sortInventory(p.getInventory());
}
}

View File

@ -4,7 +4,7 @@ package de.jeff_media.ChestSort.utils;
public class CategoryLinePair {
final String categoryName;
final String formattedPosition;
boolean sticky;
final boolean sticky;
final short position;
public CategoryLinePair(String categoryName,short position) {

View File

@ -4,7 +4,7 @@ public class TypeMatchPositionPair {
final String typeMatch;
final String formattedPosition;
boolean sticky;
final boolean sticky;
public String getTypeMatch() {
return typeMatch;