This commit is contained in:
mfnalex 2021-05-19 15:16:24 +02:00
parent 1bda6e51e4
commit 295b616669
37 changed files with 91 additions and 76 deletions

View File

@ -1,5 +1,11 @@
# Changelog # Changelog
## 10.0.0
- API update - some weird Spigot update broke casting the Plugin instance to its interface.
- Plugins depending on ChestSort or using its API must be updated too.
- API is now accessed simply via de.jeff_media.chestsort.ChestSortAPI
- Added "isChestSortInstalled" method
## 9.7.2 ## 9.7.2
- Updated Turkish translation - Updated Turkish translation

14
pom.xml
View File

@ -9,7 +9,7 @@
<name>ChestSort</name> <name>ChestSort</name>
<url>https://www.chestsort.de</url> <url>https://www.chestsort.de</url>
<description>Automatically sorts your chests!</description> <description>Automatically sorts your chests!</description>
<version>9.7.2</version> <version>10.0.0</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<properties> <properties>
@ -45,23 +45,23 @@
<relocations> <relocations>
<relocation> <relocation>
<pattern>de.jeff_media.jefflib</pattern> <pattern>de.jeff_media.jefflib</pattern>
<shadedPattern>de.jeff_media.ChestSort.jefflib</shadedPattern> <shadedPattern>de.jeff_media.chestsort.jefflib</shadedPattern>
</relocation> </relocation>
<relocation> <relocation>
<pattern>org.apache.maven.artifact</pattern> <pattern>org.apache.maven.artifact</pattern>
<shadedPattern>de.jeff_media.ChestSort.jefflib.thirdparty.org.apache.maven.artifact</shadedPattern> <shadedPattern>de.jeff_media.chestsort.jefflib.thirdparty.org.apache.maven.artifact</shadedPattern>
</relocation> </relocation>
<relocation> <relocation>
<pattern>de.jeff_media.updatechecker</pattern> <pattern>de.jeff_media.updatechecker</pattern>
<shadedPattern>de.jeff_media.ChestSort.updatechecker</shadedPattern> <shadedPattern>de.jeff_media.chestsort.updatechecker</shadedPattern>
</relocation> </relocation>
<relocation> <relocation>
<pattern>org.bstats</pattern> <pattern>org.bstats</pattern>
<shadedPattern>de.jeff_media.ChestSort</shadedPattern> <shadedPattern>de.jeff_media.chestsort</shadedPattern>
</relocation> </relocation>
<relocation> <relocation>
<pattern>io.papermc.lib</pattern> <pattern>io.papermc.lib</pattern>
<shadedPattern>de.jeff_media.ChestSort.paperlib</shadedPattern> <!-- Replace this --> <shadedPattern>de.jeff_media.chestsort.paperlib</shadedPattern> <!-- Replace this -->
</relocation> </relocation>
</relocations> </relocations>
<artifactSet> <artifactSet>
@ -149,7 +149,7 @@
<dependency> <dependency>
<groupId>de.jeff_media</groupId> <groupId>de.jeff_media</groupId>
<artifactId>ChestSortAPI</artifactId> <artifactId>ChestSortAPI</artifactId>
<version>2.0.0</version> <version>3.0.0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -1,9 +1,12 @@
package de.jeff_media.ChestSort; package de.jeff_media.chestsort;
import de.jeff_media.ChestSortAPI.ChestSortAPI; import de.jeff_media.ChestSortAPI.ChestSortAPI;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory; import org.bukkit.inventory.Inventory;
/**
* This isn't used anymore
*/
public class ChestSortAPIHandler implements ChestSortAPI { public class ChestSortAPIHandler implements ChestSortAPI {
final ChestSortPlugin plugin; final ChestSortPlugin plugin;

View File

@ -1,4 +1,4 @@
package de.jeff_media.ChestSort; package de.jeff_media.chestsort;
import de.jeff_media.jefflib.NBTAPI; import de.jeff_media.jefflib.NBTAPI;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;

View File

@ -1,6 +1,6 @@
package de.jeff_media.ChestSort; package de.jeff_media.chestsort;
import de.jeff_media.ChestSort.utils.TypeMatchPositionPair; import de.jeff_media.chestsort.utils.TypeMatchPositionPair;
public class ChestSortCategory implements Comparable<ChestSortCategory>{ public class ChestSortCategory implements Comparable<ChestSortCategory>{

View File

@ -1,4 +1,4 @@
package de.jeff_media.ChestSort; package de.jeff_media.chestsort;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandExecutor;

View File

@ -1,4 +1,4 @@
package de.jeff_media.ChestSort; package de.jeff_media.chestsort;
import java.io.*; import java.io.*;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
@ -11,7 +11,7 @@ import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.configuration.file.YamlConfiguration;
import de.jeff_media.ChestSort.utils.Utils; import de.jeff_media.chestsort.utils.Utils;
public class ChestSortConfigUpdater { public class ChestSortConfigUpdater {

View File

@ -1,4 +1,4 @@
package de.jeff_media.ChestSort; package de.jeff_media.chestsort;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;

View File

@ -1,4 +1,4 @@
package de.jeff_media.ChestSort; package de.jeff_media.chestsort;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.command.Command; import org.bukkit.command.Command;

View File

@ -1,8 +1,7 @@
package de.jeff_media.ChestSort; package de.jeff_media.chestsort;
import de.jeff_media.ChestSort.hooks.*; import de.jeff_media.chestsort.hooks.*;
import de.jeff_media.ChestSort.utils.LlamaUtils; import de.jeff_media.chestsort.utils.LlamaUtils;
import de.jeff_media.ChestSortAPI.ChestSortAPI;
import de.jeff_media.ChestSortAPI.ChestSortEvent; import de.jeff_media.ChestSortAPI.ChestSortEvent;
import de.jeff_media.ChestSortAPI.ISortable; import de.jeff_media.ChestSortAPI.ISortable;
import net.md_5.bungee.api.ChatMessageType; import net.md_5.bungee.api.ChatMessageType;

View File

@ -1,4 +1,4 @@
package de.jeff_media.ChestSort; package de.jeff_media.chestsort;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;

View File

@ -1,4 +1,4 @@
package de.jeff_media.ChestSort; package de.jeff_media.chestsort;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;

View File

@ -1,11 +1,11 @@
package de.jeff_media.ChestSort; package de.jeff_media.chestsort;
import de.jeff_media.ChestSort.hooks.CrackShotHook; import de.jeff_media.chestsort.hooks.CrackShotHook;
import de.jeff_media.ChestSort.hooks.InventoryPagesHook; import de.jeff_media.chestsort.hooks.InventoryPagesHook;
import de.jeff_media.ChestSort.hooks.SlimeFunHook; import de.jeff_media.chestsort.hooks.SlimeFunHook;
import de.jeff_media.ChestSort.utils.CategoryLinePair; import de.jeff_media.chestsort.utils.CategoryLinePair;
import de.jeff_media.ChestSort.utils.TypeMatchPositionPair; import de.jeff_media.chestsort.utils.TypeMatchPositionPair;
import de.jeff_media.ChestSort.utils.Utils; import de.jeff_media.chestsort.utils.Utils;
import de.jeff_media.ChestSortAPI.ChestSortEvent; import de.jeff_media.ChestSortAPI.ChestSortEvent;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Material; import org.bukkit.Material;
@ -453,12 +453,12 @@ public class ChestSortOrganizer {
} }
// Sort a complete inventory // Sort a complete inventory
void sortInventory(Inventory inv) { public void sortInventory(Inventory inv) {
sortInventory(inv, 0, inv.getSize() - 1); sortInventory(inv, 0, inv.getSize() - 1);
} }
// Sort an inventory only between startSlot and endSlot // Sort an inventory only between startSlot and endSlot
void sortInventory(@NotNull Inventory inv, int startSlot, int endSlot) { public void sortInventory(@NotNull Inventory inv, int startSlot, int endSlot) {
if(inv==null) return; if(inv==null) return;
plugin.debug("Attempting to sort an Inventory and calling ChestSortEvent."); plugin.debug("Attempting to sort an Inventory and calling ChestSortEvent.");
Class<? extends Inventory> invClass = inv.getClass(); Class<? extends Inventory> invClass = inv.getClass();

View File

@ -1,4 +1,4 @@
package de.jeff_media.ChestSort; package de.jeff_media.chestsort;
import java.util.HashMap; import java.util.HashMap;
import java.util.UUID; import java.util.UUID;

View File

@ -1,4 +1,4 @@
package de.jeff_media.ChestSort; package de.jeff_media.chestsort;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.inventory.Inventory; import org.bukkit.inventory.Inventory;

View File

@ -25,15 +25,15 @@
*/ */
package de.jeff_media.ChestSort; package de.jeff_media.chestsort;
import at.pcgamingfreaks.Minepacks.Bukkit.API.MinepacksPlugin; import at.pcgamingfreaks.Minepacks.Bukkit.API.MinepacksPlugin;
import de.jeff_media.ChestSort.config.Config; import de.jeff_media.chestsort.config.Config;
import de.jeff_media.ChestSort.hooks.EnderContainersHook; import de.jeff_media.chestsort.hooks.EnderContainersHook;
import de.jeff_media.ChestSort.hooks.GenericGUIHook; import de.jeff_media.chestsort.hooks.GenericGUIHook;
import de.jeff_media.ChestSort.hooks.PlayerVaultsHook; import de.jeff_media.chestsort.hooks.PlayerVaultsHook;
import de.jeff_media.ChestSort.placeholders.ChestSortPlaceholders; import de.jeff_media.chestsort.placeholders.ChestSortPlaceholders;
import de.jeff_media.ChestSort.utils.Utils; import de.jeff_media.chestsort.utils.Utils;
import de.jeff_media.jefflib.JeffLib; import de.jeff_media.jefflib.JeffLib;
import de.jeff_media.jefflib.NBTAPI; import de.jeff_media.jefflib.NBTAPI;
import de.jeff_media.jefflib.VersionUtil; import de.jeff_media.jefflib.VersionUtil;
@ -74,7 +74,7 @@ public class ChestSortPlugin extends JavaPlugin implements de.jeff_media.ChestSo
int mcMinorVersion; // 14 for 1.14, 13 for 1.13, ... int mcMinorVersion; // 14 for 1.14, 13 for 1.13, ...
String mcVersion; // 1.13.2 = 1_13_R2 String mcVersion; // 1.13.2 = 1_13_R2
ChestSortMessages messages; ChestSortMessages messages;
ChestSortOrganizer organizer; public ChestSortOrganizer organizer;
Map<String, ChestSortPlayerSetting> perPlayerSettings = new HashMap<>(); Map<String, ChestSortPlayerSetting> perPlayerSettings = new HashMap<>();
ChestSortPermissionsHandler permissionsHandler; ChestSortPermissionsHandler permissionsHandler;
ChestSortSettingsGUI settingsGUI; ChestSortSettingsGUI settingsGUI;
@ -82,6 +82,11 @@ public class ChestSortPlugin extends JavaPlugin implements de.jeff_media.ChestSo
UpdateChecker updateChecker; UpdateChecker updateChecker;
boolean usingMatchingConfig = true; boolean usingMatchingConfig = true;
boolean verbose = true; boolean verbose = true;
private static ChestSortPlugin instance;
public static ChestSortPlugin getInstance() {
return instance;
}
// Creates the default configuration file // Creates the default configuration file
// Also checks the config-version of an already existing file. If the existing // Also checks the config-version of an already existing file. If the existing
@ -206,7 +211,7 @@ public class ChestSortPlugin extends JavaPlugin implements de.jeff_media.ChestSo
return difference <= cooldown; return difference <= cooldown;
} }
boolean isSortingEnabled(Player p) { public boolean isSortingEnabled(Player p) {
if (perPlayerSettings == null) { if (perPlayerSettings == null) {
perPlayerSettings = new HashMap<>(); perPlayerSettings = new HashMap<>();
} }
@ -352,6 +357,8 @@ public class ChestSortPlugin extends JavaPlugin implements de.jeff_media.ChestSo
@Override @Override
public void onEnable() { public void onEnable() {
instance = this;
JeffLib.init(this); JeffLib.init(this);
String tmpVersion = getServer().getClass().getPackage().getName(); String tmpVersion = getServer().getClass().getPackage().getName();

View File

@ -1,4 +1,4 @@
package de.jeff_media.ChestSort; package de.jeff_media.chestsort;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;

View File

@ -1,4 +1,4 @@
package de.jeff_media.ChestSort; package de.jeff_media.chestsort;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;

View File

@ -1,6 +1,6 @@
package de.jeff_media.ChestSort.config; package de.jeff_media.chestsort.config;
import de.jeff_media.ChestSort.ChestSortPlugin; import de.jeff_media.chestsort.ChestSortPlugin;
public class Config { public class Config {
public static final String HOTKEY_COOLDOWN = "hotkey-cooldown"; public static final String HOTKEY_COOLDOWN = "hotkey-cooldown";

View File

@ -1,10 +1,10 @@
package de.jeff_media.ChestSort.hooks; package de.jeff_media.chestsort.hooks;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import com.shampaggon.crackshot.CSUtility; import com.shampaggon.crackshot.CSUtility;
import de.jeff_media.ChestSort.ChestSortPlugin; import de.jeff_media.chestsort.ChestSortPlugin;
public class CrackShotHook { public class CrackShotHook {

View File

@ -1,6 +1,6 @@
package de.jeff_media.ChestSort.hooks; package de.jeff_media.chestsort.hooks;
import de.jeff_media.ChestSort.ChestSortPlugin; import de.jeff_media.chestsort.ChestSortPlugin;
import org.bukkit.inventory.Inventory; import org.bukkit.inventory.Inventory;
public class CrateReloadedHook { public class CrateReloadedHook {

View File

@ -1,4 +1,4 @@
package de.jeff_media.ChestSort.hooks; package de.jeff_media.chestsort.hooks;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;

View File

@ -1,6 +1,6 @@
package de.jeff_media.ChestSort.hooks; package de.jeff_media.chestsort.hooks;
import de.jeff_media.ChestSort.ChestSortPlugin; import de.jeff_media.chestsort.ChestSortPlugin;
import org.bukkit.inventory.Inventory; import org.bukkit.inventory.Inventory;
public class EnderContainersHook { public class EnderContainersHook {

View File

@ -1,6 +1,6 @@
package de.jeff_media.ChestSort.hooks; package de.jeff_media.chestsort.hooks;
import de.jeff_media.ChestSort.ChestSortPlugin; import de.jeff_media.chestsort.ChestSortPlugin;
import org.bukkit.inventory.Inventory; import org.bukkit.inventory.Inventory;
public class GenericGUIHook { public class GenericGUIHook {

View File

@ -1,6 +1,6 @@
package de.jeff_media.ChestSort.hooks; package de.jeff_media.chestsort.hooks;
import de.jeff_media.ChestSort.ChestSortPlugin; import de.jeff_media.chestsort.ChestSortPlugin;
import org.bukkit.inventory.Inventory; import org.bukkit.inventory.Inventory;
public class GoldenCratesHook { public class GoldenCratesHook {

View File

@ -1,6 +1,6 @@
package de.jeff_media.ChestSort.hooks; package de.jeff_media.chestsort.hooks;
import de.jeff_media.ChestSort.ChestSortPlugin; import de.jeff_media.chestsort.ChestSortPlugin;
import org.bukkit.inventory.Inventory; import org.bukkit.inventory.Inventory;
public class HeadDatabaseHook { public class HeadDatabaseHook {

View File

@ -1,4 +1,4 @@
package de.jeff_media.ChestSort.hooks; package de.jeff_media.chestsort.hooks;
import java.io.File; import java.io.File;
@ -9,7 +9,7 @@ import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory; import org.bukkit.inventory.PlayerInventory;
import de.jeff_media.ChestSort.ChestSortPlugin; import de.jeff_media.chestsort.ChestSortPlugin;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
public class InventoryPagesHook { public class InventoryPagesHook {

View File

@ -1,4 +1,4 @@
package de.jeff_media.ChestSort.hooks; package de.jeff_media.chestsort.hooks;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.inventory.Inventory; import org.bukkit.inventory.Inventory;
@ -7,7 +7,7 @@ import org.bukkit.plugin.Plugin;
import at.pcgamingfreaks.Minepacks.Bukkit.API.Backpack; import at.pcgamingfreaks.Minepacks.Bukkit.API.Backpack;
import at.pcgamingfreaks.Minepacks.Bukkit.API.MinepacksPlugin; import at.pcgamingfreaks.Minepacks.Bukkit.API.MinepacksPlugin;
import de.jeff_media.ChestSort.ChestSortPlugin; import de.jeff_media.chestsort.ChestSortPlugin;
public class MinepacksHook { public class MinepacksHook {

View File

@ -1,6 +1,6 @@
package de.jeff_media.ChestSort.hooks; package de.jeff_media.chestsort.hooks;
import de.jeff_media.ChestSort.ChestSortPlugin; import de.jeff_media.chestsort.ChestSortPlugin;
import org.bukkit.inventory.Inventory; import org.bukkit.inventory.Inventory;
public class PlayerVaultsHook { public class PlayerVaultsHook {

View File

@ -1,4 +1,4 @@
package de.jeff_media.ChestSort.hooks; package de.jeff_media.chestsort.hooks;
import io.github.thebusybiscuit.slimefun4.implementation.items.backpacks.SlimefunBackpack; import io.github.thebusybiscuit.slimefun4.implementation.items.backpacks.SlimefunBackpack;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;

View File

@ -1,6 +1,6 @@
package de.jeff_media.ChestSort.placeholders; package de.jeff_media.chestsort.placeholders;
import de.jeff_media.ChestSort.ChestSortPlugin; import de.jeff_media.chestsort.ChestSortPlugin;
import me.clip.placeholderapi.expansion.PlaceholderExpansion; import me.clip.placeholderapi.expansion.PlaceholderExpansion;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;

View File

@ -1,6 +1,6 @@
package de.jeff_media.ChestSort.test; package de.jeff_media.chestsort.test;
import de.jeff_media.ChestSort.ChestSortPlugin; import de.jeff_media.chestsort.ChestSortPlugin;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
public class APIDeprecation { public class APIDeprecation {

View File

@ -1,4 +1,4 @@
package de.jeff_media.ChestSort.utils; package de.jeff_media.chestsort.utils;
public class CategoryLinePair { public class CategoryLinePair {

View File

@ -1,4 +1,4 @@
package de.jeff_media.ChestSort.utils; package de.jeff_media.chestsort.utils;
import org.bukkit.entity.ChestedHorse; import org.bukkit.entity.ChestedHorse;
import org.bukkit.entity.Donkey; import org.bukkit.entity.Donkey;

View File

@ -1,4 +1,4 @@
package de.jeff_media.ChestSort.utils; package de.jeff_media.chestsort.utils;
public class TypeMatchPositionPair { public class TypeMatchPositionPair {

View File

@ -1,4 +1,4 @@
package de.jeff_media.ChestSort.utils; package de.jeff_media.chestsort.utils;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
@ -6,7 +6,7 @@ import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import de.jeff_media.ChestSort.ChestSortPlugin; import de.jeff_media.chestsort.ChestSortPlugin;
import org.bukkit.inventory.Inventory; import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;

View File

@ -1,4 +1,4 @@
main: de.jeff_media.ChestSort.ChestSortPlugin main: de.jeff_media.chestsort.ChestSortPlugin
name: ChestSort name: ChestSort
version: 9.7.1 version: 9.7.1
api-version: "1.13" api-version: "1.13"