mirror of
https://github.com/JEFF-Media-GbR/ChestSort.git
synced 2024-12-03 08:03:26 +01:00
8.13.0-SNAPSHOT
This commit is contained in:
parent
3870e63a1e
commit
40147f0d0d
@ -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
|
||||
|
@ -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) {
|
||||
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
|
||||
}
|
||||
}
|
@ -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) {
|
||||
|
@ -4,7 +4,7 @@ public class TypeMatchPositionPair {
|
||||
|
||||
final String typeMatch;
|
||||
final String formattedPosition;
|
||||
boolean sticky;
|
||||
final boolean sticky;
|
||||
|
||||
public String getTypeMatch() {
|
||||
return typeMatch;
|
||||
|
Loading…
Reference in New Issue
Block a user