diff --git a/Minepacks-API-Extended/src/at/pcgamingfreaks/Minepacks/Bukkit/ExtendedAPI/BackpackExtended.java b/Minepacks-API-Extended/src/at/pcgamingfreaks/Minepacks/Bukkit/ExtendedAPI/Backpack.java similarity index 89% rename from Minepacks-API-Extended/src/at/pcgamingfreaks/Minepacks/Bukkit/ExtendedAPI/BackpackExtended.java rename to Minepacks-API-Extended/src/at/pcgamingfreaks/Minepacks/Bukkit/ExtendedAPI/Backpack.java index cc354b3..9b2bda2 100644 --- a/Minepacks-API-Extended/src/at/pcgamingfreaks/Minepacks/Bukkit/ExtendedAPI/BackpackExtended.java +++ b/Minepacks-API-Extended/src/at/pcgamingfreaks/Minepacks/Bukkit/ExtendedAPI/Backpack.java @@ -18,16 +18,15 @@ package at.pcgamingfreaks.Minepacks.Bukkit.ExtendedAPI; import at.pcgamingfreaks.Bukkit.Message.Message; -import at.pcgamingfreaks.Minepacks.Bukkit.API.Backpack; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -public interface BackpackExtended extends Backpack +public interface Backpack extends at.pcgamingfreaks.Minepacks.Bukkit.API.Backpack { @Override - @NotNull MinepacksPlayerExtended getOwner(); + @NotNull MinepacksPlayer getOwner(); /** * Let a given player open this backpack. diff --git a/Minepacks-API-Extended/src/at/pcgamingfreaks/Minepacks/Bukkit/ExtendedAPI/MinepacksCommand.java b/Minepacks-API-Extended/src/at/pcgamingfreaks/Minepacks/Bukkit/ExtendedAPI/MinepacksCommand.java index 6ea2707..85d4c28 100644 --- a/Minepacks-API-Extended/src/at/pcgamingfreaks/Minepacks/Bukkit/ExtendedAPI/MinepacksCommand.java +++ b/Minepacks-API-Extended/src/at/pcgamingfreaks/Minepacks/Bukkit/ExtendedAPI/MinepacksCommand.java @@ -37,7 +37,7 @@ */ public abstract class MinepacksCommand extends SubCommand { - private static MinepacksPluginExtended minepacksPlugin = null; + private static MinepacksPlugin minepacksPlugin = null; private static Method showHelp = null; private static Message messageNoPermission = new Message(ChatColor.RED + "You don't have the permission to do that."); private static Message messageNotFromConsole = new Message(ChatColor.RED + "This command can't be used from console!"); @@ -95,7 +95,7 @@ public MinepacksCommand(@NotNull JavaPlugin plugin, @NotNull String name, @NotNu * * @return The instance of the marriage master plugin. */ - protected @NotNull MinepacksPluginExtended getMinepacksPlugin() + protected @NotNull MinepacksPlugin getMinepacksPlugin() { return minepacksPlugin; } diff --git a/Minepacks-API-Extended/src/at/pcgamingfreaks/Minepacks/Bukkit/ExtendedAPI/MinepacksPlayerExtended.java b/Minepacks-API-Extended/src/at/pcgamingfreaks/Minepacks/Bukkit/ExtendedAPI/MinepacksPlayer.java similarity index 86% rename from Minepacks-API-Extended/src/at/pcgamingfreaks/Minepacks/Bukkit/ExtendedAPI/MinepacksPlayerExtended.java rename to Minepacks-API-Extended/src/at/pcgamingfreaks/Minepacks/Bukkit/ExtendedAPI/MinepacksPlayer.java index 24f5ce4..e71a1d7 100644 --- a/Minepacks-API-Extended/src/at/pcgamingfreaks/Minepacks/Bukkit/ExtendedAPI/MinepacksPlayerExtended.java +++ b/Minepacks-API-Extended/src/at/pcgamingfreaks/Minepacks/Bukkit/ExtendedAPI/MinepacksPlayer.java @@ -18,15 +18,14 @@ package at.pcgamingfreaks.Minepacks.Bukkit.ExtendedAPI; import at.pcgamingfreaks.Bukkit.Message.IMessage; -import at.pcgamingfreaks.Minepacks.Bukkit.API.MinepacksPlayer; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -public interface MinepacksPlayerExtended extends MinepacksPlayer +public interface MinepacksPlayer extends at.pcgamingfreaks.Minepacks.Bukkit.API.MinepacksPlayer { @Override - BackpackExtended getBackpack(); + Backpack getBackpack(); void send(@NotNull IMessage message, @Nullable Object... args); diff --git a/Minepacks-API-Extended/src/at/pcgamingfreaks/Minepacks/Bukkit/ExtendedAPI/MinepacksPluginExtended.java b/Minepacks-API-Extended/src/at/pcgamingfreaks/Minepacks/Bukkit/ExtendedAPI/MinepacksPlugin.java similarity index 81% rename from Minepacks-API-Extended/src/at/pcgamingfreaks/Minepacks/Bukkit/ExtendedAPI/MinepacksPluginExtended.java rename to Minepacks-API-Extended/src/at/pcgamingfreaks/Minepacks/Bukkit/ExtendedAPI/MinepacksPlugin.java index cea27c5..b794808 100644 --- a/Minepacks-API-Extended/src/at/pcgamingfreaks/Minepacks/Bukkit/ExtendedAPI/MinepacksPluginExtended.java +++ b/Minepacks-API-Extended/src/at/pcgamingfreaks/Minepacks/Bukkit/ExtendedAPI/MinepacksPlugin.java @@ -17,16 +17,13 @@ package at.pcgamingfreaks.Minepacks.Bukkit.ExtendedAPI; -import at.pcgamingfreaks.Minepacks.Bukkit.API.Backpack; -import at.pcgamingfreaks.Minepacks.Bukkit.API.Callback; -import at.pcgamingfreaks.Minepacks.Bukkit.API.MinepacksPlugin; import at.pcgamingfreaks.Version; import org.bukkit.OfflinePlayer; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -public interface MinepacksPluginExtended extends MinepacksPlugin +public interface MinepacksPlugin extends at.pcgamingfreaks.Minepacks.Bukkit.API.MinepacksPlugin { /** * Gets the command manager of the Minepacks plugin. @@ -43,7 +40,7 @@ public interface MinepacksPluginExtended extends MinepacksPlugin * @return The backpack of the given player. null if the backpack is not loaded. */ @Override - @Nullable BackpackExtended getBackpackLoadedOnly(final @NotNull OfflinePlayer owner); + @Nullable Backpack getBackpackLoadedOnly(final @NotNull OfflinePlayer owner); @NotNull Version getVersion(); } \ No newline at end of file diff --git a/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Backpack.java b/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Backpack.java index e00d1df..be23bbd 100644 --- a/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Backpack.java +++ b/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Backpack.java @@ -23,7 +23,6 @@ import at.pcgamingfreaks.Minepacks.Bukkit.Database.Enums.ShrinkApproach; import at.pcgamingfreaks.Minepacks.Bukkit.Database.Helper.InventoryCompressor; import at.pcgamingfreaks.Minepacks.Bukkit.Database.MinepacksPlayerData; -import at.pcgamingfreaks.Minepacks.Bukkit.ExtendedAPI.BackpackExtended; import at.pcgamingfreaks.StringUtils; import org.bukkit.Bukkit; @@ -43,7 +42,7 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -public class Backpack implements BackpackExtended +public class Backpack implements at.pcgamingfreaks.Minepacks.Bukkit.ExtendedAPI.Backpack { @Setter(AccessLevel.PACKAGE) private static ShrinkApproach shrinkApproach = ShrinkApproach.COMPRESS; private static Object titleOwn; diff --git a/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Command/ClearCommand.java b/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Command/ClearCommand.java index cdf81eb..4a1e2e2 100644 --- a/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Command/ClearCommand.java +++ b/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Command/ClearCommand.java @@ -20,9 +20,9 @@ import at.pcgamingfreaks.Bukkit.Message.Message; import at.pcgamingfreaks.Bukkit.Util.Utils; import at.pcgamingfreaks.Command.HelpData; -import at.pcgamingfreaks.Minepacks.Bukkit.ExtendedAPI.BackpackExtended; +import at.pcgamingfreaks.Minepacks.Bukkit.ExtendedAPI.Backpack; import at.pcgamingfreaks.Minepacks.Bukkit.ExtendedAPI.MinepacksCommand; -import at.pcgamingfreaks.Minepacks.Bukkit.ExtendedAPI.MinepacksPlayerExtended; +import at.pcgamingfreaks.Minepacks.Bukkit.ExtendedAPI.MinepacksPlayer; import at.pcgamingfreaks.Minepacks.Bukkit.Minepacks; import at.pcgamingfreaks.Minepacks.Bukkit.Permissions; @@ -72,7 +72,7 @@ public void execute(final @NotNull CommandSender commandSender, final @NotNull S { if(backpack.getOwner().isOnline()) { - MinepacksPlayerExtended owner = ((BackpackExtended)backpack).getOwner(); + MinepacksPlayer owner = ((Backpack)backpack).getOwner(); messageClearedOther.send(commandSender, backpack.getOwner().getName(), owner.getDisplayName()); owner.sendMessage(messageClearedBy, commandSender.getName(), (commandSender instanceof Player) ? ((Player) commandSender).getDisplayName() : ChatColor.GRAY + commandSender.getName()); } diff --git a/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Command/OpenCommand.java b/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Command/OpenCommand.java index 4022b28..d98a60e 100644 --- a/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Command/OpenCommand.java +++ b/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Command/OpenCommand.java @@ -23,7 +23,7 @@ import at.pcgamingfreaks.Command.HelpData; import at.pcgamingfreaks.Message.MessageClickEvent; import at.pcgamingfreaks.Minepacks.Bukkit.ExtendedAPI.MinepacksCommand; -import at.pcgamingfreaks.Minepacks.Bukkit.ExtendedAPI.MinepacksPlayerExtended; +import at.pcgamingfreaks.Minepacks.Bukkit.ExtendedAPI.MinepacksPlayer; import at.pcgamingfreaks.Minepacks.Bukkit.Minepacks; import at.pcgamingfreaks.Minepacks.Bukkit.Permissions; @@ -73,7 +73,7 @@ public void execute(final @NotNull CommandSender sender, final @NotNull String m { if(getMinepacksPlugin().isPlayerGameModeAllowed((Player) sender)) { - MinepacksPlayerExtended minepacksPlayer = plugin.getMinepacksPlayer((Player) sender); + MinepacksPlayer minepacksPlayer = plugin.getMinepacksPlayer((Player) sender); if(plugin.getCooldownManager() != null && !player.hasPermission(Permissions.NO_COOLDOWN)) { long cd = plugin.getCooldownManager().getRemainingCooldown(minepacksPlayer); diff --git a/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/Database.java b/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/Database.java index 9a6d5b9..70dfd44 100644 --- a/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/Database.java +++ b/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/Database.java @@ -28,7 +28,7 @@ import at.pcgamingfreaks.Minepacks.Bukkit.Database.Backend.MySQL; import at.pcgamingfreaks.Minepacks.Bukkit.Database.Backend.SQLite; import at.pcgamingfreaks.Minepacks.Bukkit.Database.Enums.DatabaseType; -import at.pcgamingfreaks.Minepacks.Bukkit.ExtendedAPI.MinepacksPlayerExtended; +import at.pcgamingfreaks.Minepacks.Bukkit.ExtendedAPI.MinepacksPlayer; import at.pcgamingfreaks.Minepacks.Bukkit.Minepacks; import org.bukkit.Bukkit; @@ -182,7 +182,7 @@ public void onPlayerLoginEvent(final @NotNull PlayerJoinEvent event) return player; } - public @Nullable MinepacksPlayerExtended getPlayerCached(final @NotNull OfflinePlayer offlinePlayer) + public @Nullable MinepacksPlayer getPlayerCached(final @NotNull OfflinePlayer offlinePlayer) { return cache.getCachedPlayer(offlinePlayer.getUniqueId()); } diff --git a/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/MinepacksPlayerData.java b/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/MinepacksPlayerData.java index 23b70ca..8f3f61a 100644 --- a/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/MinepacksPlayerData.java +++ b/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/MinepacksPlayerData.java @@ -20,9 +20,8 @@ import at.pcgamingfreaks.Bukkit.Message.IMessage; import at.pcgamingfreaks.Database.Cache.ICacheablePlayer; import at.pcgamingfreaks.Minepacks.Bukkit.API.Callback; -import at.pcgamingfreaks.Minepacks.Bukkit.API.MinepacksPlayer; import at.pcgamingfreaks.Minepacks.Bukkit.Backpack; -import at.pcgamingfreaks.Minepacks.Bukkit.ExtendedAPI.MinepacksPlayerExtended; +import at.pcgamingfreaks.Minepacks.Bukkit.ExtendedAPI.MinepacksPlayer; import at.pcgamingfreaks.Minepacks.Bukkit.Item.ItemConfig; import at.pcgamingfreaks.Minepacks.Bukkit.MagicValues; import at.pcgamingfreaks.Minepacks.Bukkit.Minepacks; @@ -43,7 +42,7 @@ import java.util.UUID; import java.util.concurrent.ConcurrentLinkedQueue; -public class MinepacksPlayerData implements MinepacksPlayerExtended, ICacheablePlayer +public class MinepacksPlayerData implements MinepacksPlayer, ICacheablePlayer { @Getter @Setter private @NotNull String name; private final @NotNull UUID uuid; @@ -58,7 +57,7 @@ public class MinepacksPlayerData implements MinepacksPlayerExtended, ICacheableP @Getter @Setter private Object databaseKey = null; private final Queue> backpackLoadedQueue = new ConcurrentLinkedQueue<>(); - private final Queue> playerLoadedQueue = new ConcurrentLinkedQueue<>(); + private final Queue> playerLoadedQueue = new ConcurrentLinkedQueue<>(); public MinepacksPlayerData(final @Nullable UUID uuid, final @NotNull String name) { @@ -202,7 +201,7 @@ public boolean isLoaded() } @Override - public void notifyOnLoad(final @NotNull Callback callback) + public void notifyOnLoad(final @NotNull Callback callback) { if(isLoaded()) callback.onResult(this); else playerLoadedQueue.add(callback); diff --git a/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Minepacks.java b/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Minepacks.java index 79d9b1e..20ae4e7 100644 --- a/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Minepacks.java +++ b/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Minepacks.java @@ -22,18 +22,16 @@ import at.pcgamingfreaks.Bukkit.Message.Message; import at.pcgamingfreaks.Bukkit.Util.Utils; import at.pcgamingfreaks.ConsoleColor; -import at.pcgamingfreaks.Minepacks.Bukkit.API.Backpack; import at.pcgamingfreaks.Minepacks.Bukkit.API.Callback; -import at.pcgamingfreaks.Minepacks.Bukkit.API.MinepacksPlayer; import at.pcgamingfreaks.Minepacks.Bukkit.API.WorldBlacklistMode; import at.pcgamingfreaks.Minepacks.Bukkit.Command.CommandManager; import at.pcgamingfreaks.Minepacks.Bukkit.Command.InventoryClearCommand; import at.pcgamingfreaks.Minepacks.Bukkit.Command.ShortcutCommand; import at.pcgamingfreaks.Minepacks.Bukkit.Database.*; -import at.pcgamingfreaks.Minepacks.Bukkit.ExtendedAPI.BackpackExtended; +import at.pcgamingfreaks.Minepacks.Bukkit.ExtendedAPI.Backpack; import at.pcgamingfreaks.Minepacks.Bukkit.ExtendedAPI.MinepacksCommandManager; -import at.pcgamingfreaks.Minepacks.Bukkit.ExtendedAPI.MinepacksPlayerExtended; -import at.pcgamingfreaks.Minepacks.Bukkit.ExtendedAPI.MinepacksPluginExtended; +import at.pcgamingfreaks.Minepacks.Bukkit.ExtendedAPI.MinepacksPlayer; +import at.pcgamingfreaks.Minepacks.Bukkit.ExtendedAPI.MinepacksPlugin; import at.pcgamingfreaks.Minepacks.Bukkit.Item.ItemConfig; import at.pcgamingfreaks.Minepacks.Bukkit.Listener.*; import at.pcgamingfreaks.Minepacks.Bukkit.SpecialInfoWorker.NoDatabaseWorker; @@ -61,7 +59,7 @@ import java.util.Locale; import java.util.Set; -public class Minepacks extends JavaPlugin implements MinepacksPluginExtended +public class Minepacks extends JavaPlugin implements MinepacksPlugin { @Getter private static Minepacks instance = null; @@ -269,13 +267,13 @@ public void reload() } @Override - public void openBackpack(final @NotNull Player opener, final @NotNull MinepacksPlayer owner, final boolean editable, final @Nullable String title) + public void openBackpack(final @NotNull Player opener, final @NotNull at.pcgamingfreaks.Minepacks.Bukkit.API.MinepacksPlayer owner, final boolean editable, final @Nullable String title) { owner.getBackpack(backpack -> openBackpack(opener, backpack, editable, title)); } @Override - public void openBackpack(final @NotNull Player opener, final @NotNull Backpack backpack, final boolean editable, final @Nullable String title) + public void openBackpack(final @NotNull Player opener, final @NotNull at.pcgamingfreaks.Minepacks.Bukkit.API.Backpack backpack, final boolean editable, final @Nullable String title) { WorldBlacklistMode disabled = isDisabled(opener); if(disabled != WorldBlacklistMode.None) @@ -297,14 +295,14 @@ public void openBackpack(final @NotNull Player opener, final @NotNull Backpack b } @Override - public @Nullable BackpackExtended getBackpackLoadedOnly(@NotNull OfflinePlayer owner) + public @Nullable Backpack getBackpackLoadedOnly(@NotNull OfflinePlayer owner) { - MinepacksPlayerExtended minepacksPlayer = getMinepacksPlayerLoadedOnly(owner); + MinepacksPlayer minepacksPlayer = getMinepacksPlayerLoadedOnly(owner); return (minepacksPlayer != null) ? minepacksPlayer.getBackpack() : null; } @Override - public void getBackpack(final @NotNull OfflinePlayer owner, final @NotNull Callback callback) + public void getBackpack(final @NotNull OfflinePlayer owner, final @NotNull Callback callback) { getMinepacksPlayer(owner).getBackpack(callback); } @@ -316,15 +314,15 @@ public void getBackpack(final @NotNull OfflinePlayer owner, final @NotNull Callb } @Override - public void getMinepacksPlayer(final @NotNull OfflinePlayer player, final @NotNull Callback callback) + public void getMinepacksPlayer(final @NotNull OfflinePlayer player, final @NotNull Callback callback) { getMinepacksPlayer(player).notifyOnLoad(callback); } @Override - public @Nullable MinepacksPlayerExtended getMinepacksPlayerLoadedOnly(@NotNull OfflinePlayer player) + public @Nullable MinepacksPlayer getMinepacksPlayerLoadedOnly(@NotNull OfflinePlayer player) { - MinepacksPlayerExtended mpPlayer = database.getPlayerCached(player); + MinepacksPlayer mpPlayer = database.getPlayerCached(player); if(mpPlayer != null && mpPlayer.isLoaded()) return mpPlayer; return null; }