From 549187b4501b4db82654d2a0eee78528da9e4f26 Mon Sep 17 00:00:00 2001 From: Paldiu Date: Thu, 25 Feb 2021 23:35:46 -0600 Subject: [PATCH] BLEEDING-EDGE v1.3_01 - Removed some static abuse - Moved TimeValues to their own class - Renamed package to simplexdev from paldiu - Moved interface classes to a respective api package - Removed Lisp --- .../simplexcore/concurrent/TaskFactory.java | 4 - .../paldiu/simplexcore/utils/Constants.java | 96 ------------------- .../ban => simplexdev/api}/IBan.java | 4 +- .../config => simplexdev/api}/IConfig.java | 3 +- .../gui => simplexdev/api}/IGUI.java | 3 +- .../api}/IParticleEffect.java | 2 +- .../api}/IPotionEffect.java | 2 +- .../api}/IStructure.java | 4 +- .../sign => simplexdev/api}/IUsableSign.java | 2 +- .../api/annotations}/CommandInfo.java | 2 +- .../gui => simplexdev/api/func}/Action.java | 2 +- .../api/func}/Guard.java | 2 +- .../config => simplexdev/api/func}/Path.java | 2 +- .../api/func}/Validate.java | 2 +- .../simplexcore/CoreState.java | 4 +- .../simplexcore/SimplexCorePlugin.java | 54 +++++++---- .../simplexcore/ban/Ban.java | 20 ++-- .../simplexcore/ban/BanFactory.java | 18 ++-- .../simplexcore/ban/BanType.java | 2 +- .../simplexcore/chat/ChatUtils.java | 4 +- .../simplexcore/chat/Messages.java | 2 +- .../chat/TextComponentFactory.java | 2 +- .../simplexcore/command/CommandLoader.java | 7 +- .../simplexcore/command/SimplexCommand.java | 6 +- .../command/defaults/Command_info.java | 6 +- .../command/defaults/DefaultCommand.java | 6 +- .../simplexcore/concurrent/Announcer.java | 6 +- .../simplexcore/concurrent/SimplexTask.java | 10 +- .../simplexcore/concurrent/TaskFactory.java | 4 + .../simplexcore/config/Json.java | 4 +- .../simplexcore/config/JsonFactory.java | 2 +- .../simplexcore/config/Yaml.java | 8 +- .../simplexcore/config/YamlFactory.java | 6 +- .../simplexcore/gui/AbstractGUI.java | 5 +- .../simplexcore/gui/GUIHandler.java | 4 +- .../listener/DependencyListener.java | 6 +- .../simplexcore/listener/SimplexListener.java | 6 +- .../simplexcore/math/Cuboid.java | 6 +- .../simplexcore/math/Pyramid.java | 4 +- .../simplexcore/math/Size.java | 2 +- .../simplexcore/plugin/AddonManager.java | 4 +- .../simplexcore/plugin/AddonRegistry.java | 2 +- .../plugin/DependencyManagement.java | 2 +- .../simplexcore/plugin/SimplexAddon.java | 2 +- .../simplexcore/potion/PotionsFactory.java | 5 +- .../simplexcore/structures/Structure.java | 2 +- .../simplexcore/utils/Bean.java | 2 +- .../simplexcore/utils/Constants.java | 43 +++++++++ .../simplexcore/utils/Instances.java | 33 +++++++ .../simplexcore/utils/TimeValues.java | 27 ++++++ .../simplexcore/utils/Trio.java | 2 +- .../simplexcore/utils/Utilities.java | 7 +- .../simplexcore/utils/UtilitiesTest.java | 4 +- 53 files changed, 252 insertions(+), 217 deletions(-) delete mode 100644 src/main/java/io/github/paldiu/simplexcore/concurrent/TaskFactory.java delete mode 100644 src/main/java/io/github/paldiu/simplexcore/utils/Constants.java rename src/main/java/io/github/{paldiu/simplexcore/ban => simplexdev/api}/IBan.java (74%) rename src/main/java/io/github/{paldiu/simplexcore/config => simplexdev/api}/IConfig.java (91%) rename src/main/java/io/github/{paldiu/simplexcore/gui => simplexdev/api}/IGUI.java (90%) rename src/main/java/io/github/{paldiu/simplexcore/particle => simplexdev/api}/IParticleEffect.java (81%) rename src/main/java/io/github/{paldiu/simplexcore/potion => simplexdev/api}/IPotionEffect.java (93%) rename src/main/java/io/github/{paldiu/simplexcore/structures => simplexdev/api}/IStructure.java (84%) rename src/main/java/io/github/{paldiu/simplexcore/sign => simplexdev/api}/IUsableSign.java (86%) rename src/main/java/io/github/{paldiu/simplexcore/command => simplexdev/api/annotations}/CommandInfo.java (91%) rename src/main/java/io/github/{paldiu/simplexcore/gui => simplexdev/api/func}/Action.java (73%) rename src/main/java/io/github/{paldiu/simplexcore/functional => simplexdev/api/func}/Guard.java (76%) rename src/main/java/io/github/{paldiu/simplexcore/config => simplexdev/api/func}/Path.java (60%) rename src/main/java/io/github/{paldiu/simplexcore/functional => simplexdev/api/func}/Validate.java (60%) rename src/main/java/io/github/{paldiu => simplexdev}/simplexcore/CoreState.java (92%) rename src/main/java/io/github/{paldiu => simplexdev}/simplexcore/SimplexCorePlugin.java (56%) rename src/main/java/io/github/{paldiu => simplexdev}/simplexcore/ban/Ban.java (77%) rename src/main/java/io/github/{paldiu => simplexdev}/simplexcore/ban/BanFactory.java (82%) rename src/main/java/io/github/{paldiu => simplexdev}/simplexcore/ban/BanType.java (91%) rename src/main/java/io/github/{paldiu => simplexdev}/simplexcore/chat/ChatUtils.java (91%) rename src/main/java/io/github/{paldiu => simplexdev}/simplexcore/chat/Messages.java (90%) rename src/main/java/io/github/{paldiu => simplexdev}/simplexcore/chat/TextComponentFactory.java (98%) rename src/main/java/io/github/{paldiu => simplexdev}/simplexcore/command/CommandLoader.java (96%) rename src/main/java/io/github/{paldiu => simplexdev}/simplexcore/command/SimplexCommand.java (90%) rename src/main/java/io/github/{paldiu => simplexdev}/simplexcore/command/defaults/Command_info.java (74%) rename src/main/java/io/github/{paldiu => simplexdev}/simplexcore/command/defaults/DefaultCommand.java (76%) rename src/main/java/io/github/{paldiu => simplexdev}/simplexcore/concurrent/Announcer.java (81%) rename src/main/java/io/github/{paldiu => simplexdev}/simplexcore/concurrent/SimplexTask.java (77%) create mode 100644 src/main/java/io/github/simplexdev/simplexcore/concurrent/TaskFactory.java rename src/main/java/io/github/{paldiu => simplexdev}/simplexcore/config/Json.java (92%) rename src/main/java/io/github/{paldiu => simplexdev}/simplexcore/config/JsonFactory.java (61%) rename src/main/java/io/github/{paldiu => simplexdev}/simplexcore/config/Yaml.java (94%) rename src/main/java/io/github/{paldiu => simplexdev}/simplexcore/config/YamlFactory.java (82%) rename src/main/java/io/github/{paldiu => simplexdev}/simplexcore/gui/AbstractGUI.java (96%) rename src/main/java/io/github/{paldiu => simplexdev}/simplexcore/gui/GUIHandler.java (90%) rename src/main/java/io/github/{paldiu => simplexdev}/simplexcore/listener/DependencyListener.java (88%) rename src/main/java/io/github/{paldiu => simplexdev}/simplexcore/listener/SimplexListener.java (90%) rename src/main/java/io/github/{paldiu => simplexdev}/simplexcore/math/Cuboid.java (86%) rename src/main/java/io/github/{paldiu => simplexdev}/simplexcore/math/Pyramid.java (97%) rename src/main/java/io/github/{paldiu => simplexdev}/simplexcore/math/Size.java (90%) rename src/main/java/io/github/{paldiu => simplexdev}/simplexcore/plugin/AddonManager.java (80%) rename src/main/java/io/github/{paldiu => simplexdev}/simplexcore/plugin/AddonRegistry.java (91%) rename src/main/java/io/github/{paldiu => simplexdev}/simplexcore/plugin/DependencyManagement.java (94%) rename src/main/java/io/github/{paldiu => simplexdev}/simplexcore/plugin/SimplexAddon.java (93%) rename src/main/java/io/github/{paldiu => simplexdev}/simplexcore/potion/PotionsFactory.java (79%) rename src/main/java/io/github/{paldiu => simplexdev}/simplexcore/structures/Structure.java (59%) rename src/main/java/io/github/{paldiu => simplexdev}/simplexcore/utils/Bean.java (94%) create mode 100644 src/main/java/io/github/simplexdev/simplexcore/utils/Constants.java create mode 100644 src/main/java/io/github/simplexdev/simplexcore/utils/Instances.java create mode 100644 src/main/java/io/github/simplexdev/simplexcore/utils/TimeValues.java rename src/main/java/io/github/{paldiu => simplexdev}/simplexcore/utils/Trio.java (96%) rename src/main/java/io/github/{paldiu => simplexdev}/simplexcore/utils/Utilities.java (92%) rename src/test/java/io/github/{paldiu => simplexdev}/simplexcore/utils/UtilitiesTest.java (65%) diff --git a/src/main/java/io/github/paldiu/simplexcore/concurrent/TaskFactory.java b/src/main/java/io/github/paldiu/simplexcore/concurrent/TaskFactory.java deleted file mode 100644 index f5e3cb5..0000000 --- a/src/main/java/io/github/paldiu/simplexcore/concurrent/TaskFactory.java +++ /dev/null @@ -1,4 +0,0 @@ -package io.github.paldiu.simplexcore.concurrent; - -public final class TaskFactory { -} diff --git a/src/main/java/io/github/paldiu/simplexcore/utils/Constants.java b/src/main/java/io/github/paldiu/simplexcore/utils/Constants.java deleted file mode 100644 index 9d4a80c..0000000 --- a/src/main/java/io/github/paldiu/simplexcore/utils/Constants.java +++ /dev/null @@ -1,96 +0,0 @@ -package io.github.paldiu.simplexcore.utils; - -import io.github.paldiu.simplexcore.SimplexCorePlugin; -import io.github.paldiu.simplexcore.command.CommandLoader; -import io.github.paldiu.simplexcore.config.Yaml; -import io.github.paldiu.simplexcore.config.YamlFactory; -import io.github.paldiu.simplexcore.plugin.AddonRegistry; -import io.github.paldiu.simplexcore.plugin.DependencyManagement; -import org.bukkit.Server; -import org.bukkit.plugin.PluginManager; -import org.bukkit.plugin.java.JavaPlugin; -import org.bukkit.scheduler.BukkitScheduler; - -import java.util.logging.Logger; - -public final class Constants { - private static final SimplexCorePlugin plugin = JavaPlugin.getPlugin(SimplexCorePlugin.class); - private static final Server server = plugin.getServer(); - private static final Logger logger = plugin.getLogger(); - private static final PluginManager manager = server.getPluginManager(); - private static final BukkitScheduler scheduler = server.getScheduler(); - private static final DependencyManagement dpm = new DependencyManagement(); - private static final Yaml config = new YamlFactory(plugin).setDefaultPathways(); - private static final TimeValues time = new TimeValues(); - // Utility class should not be instantiated. - private Constants() { - throw new AssertionError(); - } - - public static SimplexCorePlugin getPlugin() { - return plugin; - } - - public static Server getServer() { - return server; - } - - public static Logger getLogger() { - return logger; - } - - public static PluginManager getManager() { - return manager; - } - - public static BukkitScheduler getScheduler() { - return scheduler; - } - - public static synchronized AddonRegistry getRegistry() { - return AddonRegistry.getInstance(); - } - - public static synchronized CommandLoader getCommandLoader() { - return CommandLoader.getInstance(); - } - - public static DependencyManagement getDependencyManager() { - return dpm; - } - - public static TimeValues getTimeValues() { - return time; - } - - public static Yaml getConfig() { - return config; - } - - public static class TimeValues { - public long SECOND() { - return 20L; - } - - public long MINUTE() { - return 1200L; - } - - public long HOUR() { - return 72000L; - } - - public long DAY() { - return 1728000L; - } - - public long MONTH() { - return 51840000L; - } - - public long YEAR() { - return 622080000L; - } - } -} - diff --git a/src/main/java/io/github/paldiu/simplexcore/ban/IBan.java b/src/main/java/io/github/simplexdev/api/IBan.java similarity index 74% rename from src/main/java/io/github/paldiu/simplexcore/ban/IBan.java rename to src/main/java/io/github/simplexdev/api/IBan.java index 6896cde..01eab24 100644 --- a/src/main/java/io/github/paldiu/simplexcore/ban/IBan.java +++ b/src/main/java/io/github/simplexdev/api/IBan.java @@ -1,4 +1,6 @@ -package io.github.paldiu.simplexcore.ban; +package io.github.simplexdev.api; + +import io.github.simplexdev.simplexcore.ban.BanType; import java.util.Date; import java.util.UUID; diff --git a/src/main/java/io/github/paldiu/simplexcore/config/IConfig.java b/src/main/java/io/github/simplexdev/api/IConfig.java similarity index 91% rename from src/main/java/io/github/paldiu/simplexcore/config/IConfig.java rename to src/main/java/io/github/simplexdev/api/IConfig.java index 04aa275..d366ce6 100644 --- a/src/main/java/io/github/paldiu/simplexcore/config/IConfig.java +++ b/src/main/java/io/github/simplexdev/api/IConfig.java @@ -1,5 +1,6 @@ -package io.github.paldiu.simplexcore.config; +package io.github.simplexdev.api; +import io.github.simplexdev.api.func.Path; import org.bukkit.configuration.ConfigurationSection; import java.util.List; diff --git a/src/main/java/io/github/paldiu/simplexcore/gui/IGUI.java b/src/main/java/io/github/simplexdev/api/IGUI.java similarity index 90% rename from src/main/java/io/github/paldiu/simplexcore/gui/IGUI.java rename to src/main/java/io/github/simplexdev/api/IGUI.java index bd6d64e..7aa9f1e 100644 --- a/src/main/java/io/github/paldiu/simplexcore/gui/IGUI.java +++ b/src/main/java/io/github/simplexdev/api/IGUI.java @@ -1,5 +1,6 @@ -package io.github.paldiu.simplexcore.gui; +package io.github.simplexdev.api; +import io.github.simplexdev.api.func.Action; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.Inventory; diff --git a/src/main/java/io/github/paldiu/simplexcore/particle/IParticleEffect.java b/src/main/java/io/github/simplexdev/api/IParticleEffect.java similarity index 81% rename from src/main/java/io/github/paldiu/simplexcore/particle/IParticleEffect.java rename to src/main/java/io/github/simplexdev/api/IParticleEffect.java index 87af799..463c6af 100644 --- a/src/main/java/io/github/paldiu/simplexcore/particle/IParticleEffect.java +++ b/src/main/java/io/github/simplexdev/api/IParticleEffect.java @@ -1,4 +1,4 @@ -package io.github.paldiu.simplexcore.particle; +package io.github.simplexdev.api; import org.bukkit.Color; import org.bukkit.Particle; diff --git a/src/main/java/io/github/paldiu/simplexcore/potion/IPotionEffect.java b/src/main/java/io/github/simplexdev/api/IPotionEffect.java similarity index 93% rename from src/main/java/io/github/paldiu/simplexcore/potion/IPotionEffect.java rename to src/main/java/io/github/simplexdev/api/IPotionEffect.java index 134e865..dd27cce 100644 --- a/src/main/java/io/github/paldiu/simplexcore/potion/IPotionEffect.java +++ b/src/main/java/io/github/simplexdev/api/IPotionEffect.java @@ -1,4 +1,4 @@ -package io.github.paldiu.simplexcore.potion; +package io.github.simplexdev.api; import org.bukkit.Color; import org.bukkit.NamespacedKey; diff --git a/src/main/java/io/github/paldiu/simplexcore/structures/IStructure.java b/src/main/java/io/github/simplexdev/api/IStructure.java similarity index 84% rename from src/main/java/io/github/paldiu/simplexcore/structures/IStructure.java rename to src/main/java/io/github/simplexdev/api/IStructure.java index fb32415..b483ccb 100644 --- a/src/main/java/io/github/paldiu/simplexcore/structures/IStructure.java +++ b/src/main/java/io/github/simplexdev/api/IStructure.java @@ -1,6 +1,6 @@ -package io.github.paldiu.simplexcore.structures; +package io.github.simplexdev.api; -import io.github.paldiu.simplexcore.math.Size; +import io.github.simplexdev.simplexcore.math.Size; import org.bukkit.Location; import org.bukkit.NamespacedKey; import org.bukkit.World; diff --git a/src/main/java/io/github/paldiu/simplexcore/sign/IUsableSign.java b/src/main/java/io/github/simplexdev/api/IUsableSign.java similarity index 86% rename from src/main/java/io/github/paldiu/simplexcore/sign/IUsableSign.java rename to src/main/java/io/github/simplexdev/api/IUsableSign.java index ff4f9e7..dc85814 100644 --- a/src/main/java/io/github/paldiu/simplexcore/sign/IUsableSign.java +++ b/src/main/java/io/github/simplexdev/api/IUsableSign.java @@ -1,4 +1,4 @@ -package io.github.paldiu.simplexcore.sign; +package io.github.simplexdev.api; import org.bukkit.Location; import org.bukkit.World; diff --git a/src/main/java/io/github/paldiu/simplexcore/command/CommandInfo.java b/src/main/java/io/github/simplexdev/api/annotations/CommandInfo.java similarity index 91% rename from src/main/java/io/github/paldiu/simplexcore/command/CommandInfo.java rename to src/main/java/io/github/simplexdev/api/annotations/CommandInfo.java index 4ad3f5a..fb51fc7 100644 --- a/src/main/java/io/github/paldiu/simplexcore/command/CommandInfo.java +++ b/src/main/java/io/github/simplexdev/api/annotations/CommandInfo.java @@ -1,4 +1,4 @@ -package io.github.paldiu.simplexcore.command; +package io.github.simplexdev.api.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/src/main/java/io/github/paldiu/simplexcore/gui/Action.java b/src/main/java/io/github/simplexdev/api/func/Action.java similarity index 73% rename from src/main/java/io/github/paldiu/simplexcore/gui/Action.java rename to src/main/java/io/github/simplexdev/api/func/Action.java index 2d87fd6..44bfe1f 100644 --- a/src/main/java/io/github/paldiu/simplexcore/gui/Action.java +++ b/src/main/java/io/github/simplexdev/api/func/Action.java @@ -1,4 +1,4 @@ -package io.github.paldiu.simplexcore.gui; +package io.github.simplexdev.api.func; import org.bukkit.entity.Player; diff --git a/src/main/java/io/github/paldiu/simplexcore/functional/Guard.java b/src/main/java/io/github/simplexdev/api/func/Guard.java similarity index 76% rename from src/main/java/io/github/paldiu/simplexcore/functional/Guard.java rename to src/main/java/io/github/simplexdev/api/func/Guard.java index 83e2fc6..03eacd7 100644 --- a/src/main/java/io/github/paldiu/simplexcore/functional/Guard.java +++ b/src/main/java/io/github/simplexdev/api/func/Guard.java @@ -1,4 +1,4 @@ -package io.github.paldiu.simplexcore.functional; +package io.github.simplexdev.api.func; @FunctionalInterface public interface Guard { diff --git a/src/main/java/io/github/paldiu/simplexcore/config/Path.java b/src/main/java/io/github/simplexdev/api/func/Path.java similarity index 60% rename from src/main/java/io/github/paldiu/simplexcore/config/Path.java rename to src/main/java/io/github/simplexdev/api/func/Path.java index ea08ec1..938d479 100644 --- a/src/main/java/io/github/paldiu/simplexcore/config/Path.java +++ b/src/main/java/io/github/simplexdev/api/func/Path.java @@ -1,4 +1,4 @@ -package io.github.paldiu.simplexcore.config; +package io.github.simplexdev.api.func; @FunctionalInterface public interface Path { diff --git a/src/main/java/io/github/paldiu/simplexcore/functional/Validate.java b/src/main/java/io/github/simplexdev/api/func/Validate.java similarity index 60% rename from src/main/java/io/github/paldiu/simplexcore/functional/Validate.java rename to src/main/java/io/github/simplexdev/api/func/Validate.java index 213bde4..309cf2e 100644 --- a/src/main/java/io/github/paldiu/simplexcore/functional/Validate.java +++ b/src/main/java/io/github/simplexdev/api/func/Validate.java @@ -1,4 +1,4 @@ -package io.github.paldiu.simplexcore.functional; +package io.github.simplexdev.api.func; @FunctionalInterface public interface Validate { diff --git a/src/main/java/io/github/paldiu/simplexcore/CoreState.java b/src/main/java/io/github/simplexdev/simplexcore/CoreState.java similarity index 92% rename from src/main/java/io/github/paldiu/simplexcore/CoreState.java rename to src/main/java/io/github/simplexdev/simplexcore/CoreState.java index 290547f..f624451 100644 --- a/src/main/java/io/github/paldiu/simplexcore/CoreState.java +++ b/src/main/java/io/github/simplexdev/simplexcore/CoreState.java @@ -1,6 +1,6 @@ -package io.github.paldiu.simplexcore; +package io.github.simplexdev.simplexcore; -import io.github.paldiu.simplexcore.utils.Constants; +import io.github.simplexdev.simplexcore.utils.Constants; public class CoreState { String message; diff --git a/src/main/java/io/github/paldiu/simplexcore/SimplexCorePlugin.java b/src/main/java/io/github/simplexdev/simplexcore/SimplexCorePlugin.java similarity index 56% rename from src/main/java/io/github/paldiu/simplexcore/SimplexCorePlugin.java rename to src/main/java/io/github/simplexdev/simplexcore/SimplexCorePlugin.java index cb35426..c00b72a 100644 --- a/src/main/java/io/github/paldiu/simplexcore/SimplexCorePlugin.java +++ b/src/main/java/io/github/simplexdev/simplexcore/SimplexCorePlugin.java @@ -1,11 +1,12 @@ -package io.github.paldiu.simplexcore; +package io.github.simplexdev.simplexcore; -import io.github.paldiu.simplexcore.command.defaults.Command_info; -import io.github.paldiu.simplexcore.concurrent.Announcer; -import io.github.paldiu.simplexcore.listener.DependencyListener; -import io.github.paldiu.simplexcore.listener.SimplexListener; -import io.github.paldiu.simplexcore.plugin.SimplexAddon; -import io.github.paldiu.simplexcore.utils.Constants; +import io.github.simplexdev.simplexcore.command.defaults.Command_info; +import io.github.simplexdev.simplexcore.concurrent.Announcer; +import io.github.simplexdev.simplexcore.listener.DependencyListener; +import io.github.simplexdev.simplexcore.listener.SimplexListener; +import io.github.simplexdev.simplexcore.plugin.SimplexAddon; +import io.github.simplexdev.simplexcore.utils.Constants; +import io.github.simplexdev.simplexcore.utils.Instances; // This comment was added to force a test on Jenkins AutoBuild // https://jenkins.coomware.dev/job/SimplexCore @@ -13,29 +14,24 @@ public final class SimplexCorePlugin extends SimplexAddon { protected static boolean debug = false; protected static boolean suspended = false; - public static boolean isDebug() { - return debug; - } - - public static void setDebug(boolean enable) { - debug = enable; - } - - public static boolean isSuspended() { - return suspended; - } + protected Instances instances; @Override public SimplexCorePlugin getPlugin() { return this; } + @Override + public void init() { + instances = new Instances(); + } + @Override public void start() { try { - Constants.getRegistry().register(this); - Constants.getCommandLoader().classpath(Command_info.class).load(); - Constants.getConfig().reload(); + instances.getRegistry().register(this); + instances.getCommandLoader().classpath(Command_info.class).load(); + instances.getConfig().reload(); // SimplexListener.register(new DependencyListener(), this); new Announcer(); @@ -52,4 +48,20 @@ public final class SimplexCorePlugin extends SimplexAddon { public void stop() { } + + public static boolean isDebug() { + return debug; + } + + public static void setDebug(boolean enable) { + debug = enable; + } + + public static boolean isSuspended() { + return suspended; + } + + public final Instances getInstances() { + return instances; + } } \ No newline at end of file diff --git a/src/main/java/io/github/paldiu/simplexcore/ban/Ban.java b/src/main/java/io/github/simplexdev/simplexcore/ban/Ban.java similarity index 77% rename from src/main/java/io/github/paldiu/simplexcore/ban/Ban.java rename to src/main/java/io/github/simplexdev/simplexcore/ban/Ban.java index 2a490bb..5fd95d0 100644 --- a/src/main/java/io/github/paldiu/simplexcore/ban/Ban.java +++ b/src/main/java/io/github/simplexdev/simplexcore/ban/Ban.java @@ -1,10 +1,12 @@ -package io.github.paldiu.simplexcore.ban; +package io.github.simplexdev.simplexcore.ban; -import io.github.paldiu.simplexcore.chat.Messages; -import io.github.paldiu.simplexcore.config.Yaml; -import io.github.paldiu.simplexcore.config.YamlFactory; -import io.github.paldiu.simplexcore.utils.Constants; -import io.github.paldiu.simplexcore.utils.Utilities; +import io.github.simplexdev.api.IBan; +import io.github.simplexdev.simplexcore.chat.Messages; +import io.github.simplexdev.simplexcore.config.Yaml; +import io.github.simplexdev.simplexcore.config.YamlFactory; +import io.github.simplexdev.simplexcore.utils.Constants; +import io.github.simplexdev.simplexcore.utils.Utilities; +import io.github.simplexdev.simplexcore.listener.SimplexListener; import org.bukkit.command.CommandSender; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.entity.Player; @@ -17,8 +19,8 @@ import java.util.Date; * This class provides a way for you to handle your own banning. * Simply extend this class and create a new instance of the subclass. * Alternatively, you may use {@link BanFactory#create} to create a new Ban instance. - * Use this in synchrony with {@link io.github.paldiu.simplexcore.listener.SimplexListener} to process bans on player login/join. - * Use this in synchrony with {@link io.github.paldiu.simplexcore.config.YamlFactory} to create a new yaml file to store your bans, or to create an individual yaml file per user ban. + * Use this in synchrony with {@link SimplexListener} to process bans on player login/join. + * Use this in synchrony with {@link YamlFactory} to create a new yaml file to store your bans, or to create an individual yaml file per user ban. */ public abstract class Ban implements IBan { private final Player player; @@ -35,7 +37,7 @@ public abstract class Ban implements IBan { } public Ban(Player player, CommandSender sender, BanType type) { - this(player, sender, type, Constants.getTimeValues().DAY()); + this(player, sender, type, Constants.getPlugin().getInstances().getTimeValues().DAY()); } public Ban(Player player, CommandSender sender, BanType type, long banDuration) { diff --git a/src/main/java/io/github/paldiu/simplexcore/ban/BanFactory.java b/src/main/java/io/github/simplexdev/simplexcore/ban/BanFactory.java similarity index 82% rename from src/main/java/io/github/paldiu/simplexcore/ban/BanFactory.java rename to src/main/java/io/github/simplexdev/simplexcore/ban/BanFactory.java index 14f182d..26269fa 100644 --- a/src/main/java/io/github/paldiu/simplexcore/ban/BanFactory.java +++ b/src/main/java/io/github/simplexdev/simplexcore/ban/BanFactory.java @@ -1,9 +1,10 @@ -package io.github.paldiu.simplexcore.ban; +package io.github.simplexdev.simplexcore.ban; -import io.github.paldiu.simplexcore.chat.Messages; -import io.github.paldiu.simplexcore.functional.Guard; -import io.github.paldiu.simplexcore.utils.Constants; -import io.github.paldiu.simplexcore.utils.Utilities; +import io.github.simplexdev.api.IBan; +import io.github.simplexdev.simplexcore.chat.Messages; +import io.github.simplexdev.api.func.Guard; +import io.github.simplexdev.simplexcore.utils.Constants; +import io.github.simplexdev.simplexcore.utils.Utilities; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -26,7 +27,6 @@ public final class BanFactory { this.type = type; this.banReason = Messages.BAN.getMessage(); - assignBanDuration().verify(); banId = createBanId(); } @@ -99,11 +99,11 @@ public final class BanFactory { private Guard assignBanDuration() { return () -> { if (type.equals(BanType.PERMANENT)) { - banDuration = Constants.getTimeValues().YEAR() * 99; + banDuration = Constants.getPlugin().getInstances().getTimeValues().YEAR() * 99; } else if (type.equals(BanType.TEMPORARY)) { - banDuration = Constants.getTimeValues().DAY(); + banDuration = Constants.getPlugin().getInstances().getTimeValues().DAY(); } else { - banDuration = Constants.getTimeValues().MINUTE() * 5; + banDuration = Constants.getPlugin().getInstances().getTimeValues().MINUTE() * 5; } }; } diff --git a/src/main/java/io/github/paldiu/simplexcore/ban/BanType.java b/src/main/java/io/github/simplexdev/simplexcore/ban/BanType.java similarity index 91% rename from src/main/java/io/github/paldiu/simplexcore/ban/BanType.java rename to src/main/java/io/github/simplexdev/simplexcore/ban/BanType.java index fc29ef4..4395eed 100644 --- a/src/main/java/io/github/paldiu/simplexcore/ban/BanType.java +++ b/src/main/java/io/github/simplexdev/simplexcore/ban/BanType.java @@ -1,4 +1,4 @@ -package io.github.paldiu.simplexcore.ban; +package io.github.simplexdev.simplexcore.ban; public enum BanType { PERMANENT("P-"), diff --git a/src/main/java/io/github/paldiu/simplexcore/chat/ChatUtils.java b/src/main/java/io/github/simplexdev/simplexcore/chat/ChatUtils.java similarity index 91% rename from src/main/java/io/github/paldiu/simplexcore/chat/ChatUtils.java rename to src/main/java/io/github/simplexdev/simplexcore/chat/ChatUtils.java index 4be0dfe..2ec8ab4 100644 --- a/src/main/java/io/github/paldiu/simplexcore/chat/ChatUtils.java +++ b/src/main/java/io/github/simplexdev/simplexcore/chat/ChatUtils.java @@ -1,6 +1,6 @@ -package io.github.paldiu.simplexcore.chat; +package io.github.simplexdev.simplexcore.chat; -import io.github.paldiu.simplexcore.utils.Bean; +import io.github.simplexdev.simplexcore.utils.Bean; import net.md_5.bungee.api.chat.TextComponent; import org.bukkit.command.CommandSender; diff --git a/src/main/java/io/github/paldiu/simplexcore/chat/Messages.java b/src/main/java/io/github/simplexdev/simplexcore/chat/Messages.java similarity index 90% rename from src/main/java/io/github/paldiu/simplexcore/chat/Messages.java rename to src/main/java/io/github/simplexdev/simplexcore/chat/Messages.java index 66c6785..e9726e6 100644 --- a/src/main/java/io/github/paldiu/simplexcore/chat/Messages.java +++ b/src/main/java/io/github/simplexdev/simplexcore/chat/Messages.java @@ -1,4 +1,4 @@ -package io.github.paldiu.simplexcore.chat; +package io.github.simplexdev.simplexcore.chat; public enum Messages { NO_PERMS("You do not have permission to use this command!"), diff --git a/src/main/java/io/github/paldiu/simplexcore/chat/TextComponentFactory.java b/src/main/java/io/github/simplexdev/simplexcore/chat/TextComponentFactory.java similarity index 98% rename from src/main/java/io/github/paldiu/simplexcore/chat/TextComponentFactory.java rename to src/main/java/io/github/simplexdev/simplexcore/chat/TextComponentFactory.java index a65bfb9..7df45ac 100644 --- a/src/main/java/io/github/paldiu/simplexcore/chat/TextComponentFactory.java +++ b/src/main/java/io/github/simplexdev/simplexcore/chat/TextComponentFactory.java @@ -1,4 +1,4 @@ -package io.github.paldiu.simplexcore.chat; +package io.github.simplexdev.simplexcore.chat; import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.chat.ClickEvent; diff --git a/src/main/java/io/github/paldiu/simplexcore/command/CommandLoader.java b/src/main/java/io/github/simplexdev/simplexcore/command/CommandLoader.java similarity index 96% rename from src/main/java/io/github/paldiu/simplexcore/command/CommandLoader.java rename to src/main/java/io/github/simplexdev/simplexcore/command/CommandLoader.java index 02d8d69..7072820 100644 --- a/src/main/java/io/github/paldiu/simplexcore/command/CommandLoader.java +++ b/src/main/java/io/github/simplexdev/simplexcore/command/CommandLoader.java @@ -1,7 +1,8 @@ -package io.github.paldiu.simplexcore.command; +package io.github.simplexdev.simplexcore.command; -import io.github.paldiu.simplexcore.command.defaults.DefaultCommand; -import io.github.paldiu.simplexcore.utils.Constants; +import io.github.simplexdev.api.annotations.CommandInfo; +import io.github.simplexdev.simplexcore.command.defaults.DefaultCommand; +import io.github.simplexdev.simplexcore.utils.Constants; import org.bukkit.Bukkit; import org.bukkit.command.*; import org.bukkit.plugin.Plugin; diff --git a/src/main/java/io/github/paldiu/simplexcore/command/SimplexCommand.java b/src/main/java/io/github/simplexdev/simplexcore/command/SimplexCommand.java similarity index 90% rename from src/main/java/io/github/paldiu/simplexcore/command/SimplexCommand.java rename to src/main/java/io/github/simplexdev/simplexcore/command/SimplexCommand.java index be547aa..92c1bdb 100644 --- a/src/main/java/io/github/paldiu/simplexcore/command/SimplexCommand.java +++ b/src/main/java/io/github/simplexdev/simplexcore/command/SimplexCommand.java @@ -1,7 +1,7 @@ -package io.github.paldiu.simplexcore.command; +package io.github.simplexdev.simplexcore.command; -import io.github.paldiu.simplexcore.utils.Constants; -import io.github.paldiu.simplexcore.utils.Utilities; +import io.github.simplexdev.simplexcore.utils.Constants; +import io.github.simplexdev.simplexcore.utils.Utilities; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; diff --git a/src/main/java/io/github/paldiu/simplexcore/command/defaults/Command_info.java b/src/main/java/io/github/simplexdev/simplexcore/command/defaults/Command_info.java similarity index 74% rename from src/main/java/io/github/paldiu/simplexcore/command/defaults/Command_info.java rename to src/main/java/io/github/simplexdev/simplexcore/command/defaults/Command_info.java index da318a6..7ddd0e9 100644 --- a/src/main/java/io/github/paldiu/simplexcore/command/defaults/Command_info.java +++ b/src/main/java/io/github/simplexdev/simplexcore/command/defaults/Command_info.java @@ -1,7 +1,7 @@ -package io.github.paldiu.simplexcore.command.defaults; +package io.github.simplexdev.simplexcore.command.defaults; -import io.github.paldiu.simplexcore.command.CommandInfo; -import io.github.paldiu.simplexcore.command.SimplexCommand; +import io.github.simplexdev.api.annotations.CommandInfo; +import io.github.simplexdev.simplexcore.command.SimplexCommand; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/io/github/paldiu/simplexcore/command/defaults/DefaultCommand.java b/src/main/java/io/github/simplexdev/simplexcore/command/defaults/DefaultCommand.java similarity index 76% rename from src/main/java/io/github/paldiu/simplexcore/command/defaults/DefaultCommand.java rename to src/main/java/io/github/simplexdev/simplexcore/command/defaults/DefaultCommand.java index cb6c32c..6d09d8a 100644 --- a/src/main/java/io/github/paldiu/simplexcore/command/defaults/DefaultCommand.java +++ b/src/main/java/io/github/simplexdev/simplexcore/command/defaults/DefaultCommand.java @@ -1,7 +1,7 @@ -package io.github.paldiu.simplexcore.command.defaults; +package io.github.simplexdev.simplexcore.command.defaults; -import io.github.paldiu.simplexcore.command.CommandInfo; -import io.github.paldiu.simplexcore.command.SimplexCommand; +import io.github.simplexdev.api.annotations.CommandInfo; +import io.github.simplexdev.simplexcore.command.SimplexCommand; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/io/github/paldiu/simplexcore/concurrent/Announcer.java b/src/main/java/io/github/simplexdev/simplexcore/concurrent/Announcer.java similarity index 81% rename from src/main/java/io/github/paldiu/simplexcore/concurrent/Announcer.java rename to src/main/java/io/github/simplexdev/simplexcore/concurrent/Announcer.java index 994c587..655e007 100644 --- a/src/main/java/io/github/paldiu/simplexcore/concurrent/Announcer.java +++ b/src/main/java/io/github/simplexdev/simplexcore/concurrent/Announcer.java @@ -1,7 +1,7 @@ -package io.github.paldiu.simplexcore.concurrent; +package io.github.simplexdev.simplexcore.concurrent; -import io.github.paldiu.simplexcore.chat.Messages; -import io.github.paldiu.simplexcore.utils.Constants; +import io.github.simplexdev.simplexcore.chat.Messages; +import io.github.simplexdev.simplexcore.utils.Constants; import org.apache.commons.lang.math.RandomUtils; import org.bukkit.Bukkit; import org.bukkit.scheduler.BukkitTask; diff --git a/src/main/java/io/github/paldiu/simplexcore/concurrent/SimplexTask.java b/src/main/java/io/github/simplexdev/simplexcore/concurrent/SimplexTask.java similarity index 77% rename from src/main/java/io/github/paldiu/simplexcore/concurrent/SimplexTask.java rename to src/main/java/io/github/simplexdev/simplexcore/concurrent/SimplexTask.java index 84899bd..244c190 100644 --- a/src/main/java/io/github/paldiu/simplexcore/concurrent/SimplexTask.java +++ b/src/main/java/io/github/simplexdev/simplexcore/concurrent/SimplexTask.java @@ -1,7 +1,7 @@ -package io.github.paldiu.simplexcore.concurrent; +package io.github.simplexdev.simplexcore.concurrent; -import io.github.paldiu.simplexcore.plugin.SimplexAddon; -import io.github.paldiu.simplexcore.utils.Constants; +import io.github.simplexdev.simplexcore.plugin.SimplexAddon; +import io.github.simplexdev.simplexcore.utils.Constants; import org.bukkit.scheduler.BukkitTask; import java.util.Date; @@ -24,8 +24,8 @@ public abstract class SimplexTask implements Consumer { } protected SimplexTask() { - DELAY = Constants.getTimeValues().SECOND() * 30; // 30 seconds until the task triggers for the first time. - INTERVAL = Constants.getTimeValues().MINUTE() * 5; // Task will run at 5 minute intervals once the first trigger has been called. + DELAY = Constants.getPlugin().getInstances().getTimeValues().SECOND() * 30; // 30 seconds until the task triggers for the first time. + INTERVAL = Constants.getPlugin().getInstances().getTimeValues().MINUTE() * 5; // Task will run at 5 minute intervals once the first trigger has been called. } public void register(T task, SimplexAddon plugin, boolean repeating, boolean delayed) { diff --git a/src/main/java/io/github/simplexdev/simplexcore/concurrent/TaskFactory.java b/src/main/java/io/github/simplexdev/simplexcore/concurrent/TaskFactory.java new file mode 100644 index 0000000..f2bbee7 --- /dev/null +++ b/src/main/java/io/github/simplexdev/simplexcore/concurrent/TaskFactory.java @@ -0,0 +1,4 @@ +package io.github.simplexdev.simplexcore.concurrent; + +public final class TaskFactory { +} diff --git a/src/main/java/io/github/paldiu/simplexcore/config/Json.java b/src/main/java/io/github/simplexdev/simplexcore/config/Json.java similarity index 92% rename from src/main/java/io/github/paldiu/simplexcore/config/Json.java rename to src/main/java/io/github/simplexdev/simplexcore/config/Json.java index 658ccf1..c901038 100644 --- a/src/main/java/io/github/paldiu/simplexcore/config/Json.java +++ b/src/main/java/io/github/simplexdev/simplexcore/config/Json.java @@ -1,5 +1,7 @@ -package io.github.paldiu.simplexcore.config; +package io.github.simplexdev.simplexcore.config; +import io.github.simplexdev.api.IConfig; +import io.github.simplexdev.api.func.Path; import org.bukkit.configuration.ConfigurationSection; import java.util.List; diff --git a/src/main/java/io/github/paldiu/simplexcore/config/JsonFactory.java b/src/main/java/io/github/simplexdev/simplexcore/config/JsonFactory.java similarity index 61% rename from src/main/java/io/github/paldiu/simplexcore/config/JsonFactory.java rename to src/main/java/io/github/simplexdev/simplexcore/config/JsonFactory.java index 8e52afa..b32e621 100644 --- a/src/main/java/io/github/paldiu/simplexcore/config/JsonFactory.java +++ b/src/main/java/io/github/simplexdev/simplexcore/config/JsonFactory.java @@ -1,4 +1,4 @@ -package io.github.paldiu.simplexcore.config; +package io.github.simplexdev.simplexcore.config; public final class JsonFactory { // TODO: Write a JSON Object Factory. diff --git a/src/main/java/io/github/paldiu/simplexcore/config/Yaml.java b/src/main/java/io/github/simplexdev/simplexcore/config/Yaml.java similarity index 94% rename from src/main/java/io/github/paldiu/simplexcore/config/Yaml.java rename to src/main/java/io/github/simplexdev/simplexcore/config/Yaml.java index 570e3e8..0af5e9f 100644 --- a/src/main/java/io/github/paldiu/simplexcore/config/Yaml.java +++ b/src/main/java/io/github/simplexdev/simplexcore/config/Yaml.java @@ -1,7 +1,9 @@ -package io.github.paldiu.simplexcore.config; +package io.github.simplexdev.simplexcore.config; -import io.github.paldiu.simplexcore.plugin.SimplexAddon; -import io.github.paldiu.simplexcore.utils.Constants; +import io.github.simplexdev.api.IConfig; +import io.github.simplexdev.api.func.Path; +import io.github.simplexdev.simplexcore.plugin.SimplexAddon; +import io.github.simplexdev.simplexcore.utils.Constants; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.YamlConfiguration; diff --git a/src/main/java/io/github/paldiu/simplexcore/config/YamlFactory.java b/src/main/java/io/github/simplexdev/simplexcore/config/YamlFactory.java similarity index 82% rename from src/main/java/io/github/paldiu/simplexcore/config/YamlFactory.java rename to src/main/java/io/github/simplexdev/simplexcore/config/YamlFactory.java index d65a8b4..8e96a4c 100644 --- a/src/main/java/io/github/paldiu/simplexcore/config/YamlFactory.java +++ b/src/main/java/io/github/simplexdev/simplexcore/config/YamlFactory.java @@ -1,7 +1,7 @@ -package io.github.paldiu.simplexcore.config; +package io.github.simplexdev.simplexcore.config; -import io.github.paldiu.simplexcore.plugin.SimplexAddon; -import io.github.paldiu.simplexcore.utils.Trio; +import io.github.simplexdev.simplexcore.plugin.SimplexAddon; +import io.github.simplexdev.simplexcore.utils.Trio; import java.io.File; diff --git a/src/main/java/io/github/paldiu/simplexcore/gui/AbstractGUI.java b/src/main/java/io/github/simplexdev/simplexcore/gui/AbstractGUI.java similarity index 96% rename from src/main/java/io/github/paldiu/simplexcore/gui/AbstractGUI.java rename to src/main/java/io/github/simplexdev/simplexcore/gui/AbstractGUI.java index f865ebd..be42c38 100644 --- a/src/main/java/io/github/paldiu/simplexcore/gui/AbstractGUI.java +++ b/src/main/java/io/github/simplexdev/simplexcore/gui/AbstractGUI.java @@ -1,9 +1,10 @@ -package io.github.paldiu.simplexcore.gui; +package io.github.simplexdev.simplexcore.gui; +import io.github.simplexdev.api.func.Action; +import io.github.simplexdev.api.IGUI; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.entity.Player; -import org.bukkit.event.Listener; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.InventoryHolder; import org.bukkit.inventory.ItemStack; diff --git a/src/main/java/io/github/paldiu/simplexcore/gui/GUIHandler.java b/src/main/java/io/github/simplexdev/simplexcore/gui/GUIHandler.java similarity index 90% rename from src/main/java/io/github/paldiu/simplexcore/gui/GUIHandler.java rename to src/main/java/io/github/simplexdev/simplexcore/gui/GUIHandler.java index aa51005..0667c4b 100644 --- a/src/main/java/io/github/paldiu/simplexcore/gui/GUIHandler.java +++ b/src/main/java/io/github/simplexdev/simplexcore/gui/GUIHandler.java @@ -1,5 +1,7 @@ -package io.github.paldiu.simplexcore.gui; +package io.github.simplexdev.simplexcore.gui; +import io.github.simplexdev.api.func.Action; +import io.github.simplexdev.api.IGUI; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; diff --git a/src/main/java/io/github/paldiu/simplexcore/listener/DependencyListener.java b/src/main/java/io/github/simplexdev/simplexcore/listener/DependencyListener.java similarity index 88% rename from src/main/java/io/github/paldiu/simplexcore/listener/DependencyListener.java rename to src/main/java/io/github/simplexdev/simplexcore/listener/DependencyListener.java index 052b6da..108062f 100644 --- a/src/main/java/io/github/paldiu/simplexcore/listener/DependencyListener.java +++ b/src/main/java/io/github/simplexdev/simplexcore/listener/DependencyListener.java @@ -1,7 +1,7 @@ -package io.github.paldiu.simplexcore.listener; +package io.github.simplexdev.simplexcore.listener; -import io.github.paldiu.simplexcore.functional.Validate; -import io.github.paldiu.simplexcore.utils.Constants; +import io.github.simplexdev.api.func.Validate; +import io.github.simplexdev.simplexcore.utils.Constants; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.server.PluginEnableEvent; diff --git a/src/main/java/io/github/paldiu/simplexcore/listener/SimplexListener.java b/src/main/java/io/github/simplexdev/simplexcore/listener/SimplexListener.java similarity index 90% rename from src/main/java/io/github/paldiu/simplexcore/listener/SimplexListener.java rename to src/main/java/io/github/simplexdev/simplexcore/listener/SimplexListener.java index 1fee786..9f03aae 100644 --- a/src/main/java/io/github/paldiu/simplexcore/listener/SimplexListener.java +++ b/src/main/java/io/github/simplexdev/simplexcore/listener/SimplexListener.java @@ -1,7 +1,7 @@ -package io.github.paldiu.simplexcore.listener; +package io.github.simplexdev.simplexcore.listener; -import io.github.paldiu.simplexcore.plugin.SimplexAddon; -import io.github.paldiu.simplexcore.utils.Constants; +import io.github.simplexdev.simplexcore.plugin.SimplexAddon; +import io.github.simplexdev.simplexcore.utils.Constants; import org.bukkit.event.Listener; import java.lang.reflect.Constructor; diff --git a/src/main/java/io/github/paldiu/simplexcore/math/Cuboid.java b/src/main/java/io/github/simplexdev/simplexcore/math/Cuboid.java similarity index 86% rename from src/main/java/io/github/paldiu/simplexcore/math/Cuboid.java rename to src/main/java/io/github/simplexdev/simplexcore/math/Cuboid.java index 4fd8516..dfa9564 100644 --- a/src/main/java/io/github/paldiu/simplexcore/math/Cuboid.java +++ b/src/main/java/io/github/simplexdev/simplexcore/math/Cuboid.java @@ -1,6 +1,6 @@ -package io.github.paldiu.simplexcore.math; +package io.github.simplexdev.simplexcore.math; -import io.github.paldiu.simplexcore.utils.Constants; +import io.github.simplexdev.simplexcore.utils.Constants; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.scheduler.BukkitTask; @@ -44,6 +44,6 @@ public final class Cuboid { }; - Constants.getScheduler().runTaskLaterAsynchronously(Constants.getPlugin(), task, Constants.getTimeValues().SECOND()); + Constants.getScheduler().runTaskLaterAsynchronously(Constants.getPlugin(), task, Constants.getPlugin().getInstances().getTimeValues().SECOND()); } } diff --git a/src/main/java/io/github/paldiu/simplexcore/math/Pyramid.java b/src/main/java/io/github/simplexdev/simplexcore/math/Pyramid.java similarity index 97% rename from src/main/java/io/github/paldiu/simplexcore/math/Pyramid.java rename to src/main/java/io/github/simplexdev/simplexcore/math/Pyramid.java index 32cdcd2..88e47da 100644 --- a/src/main/java/io/github/paldiu/simplexcore/math/Pyramid.java +++ b/src/main/java/io/github/simplexdev/simplexcore/math/Pyramid.java @@ -1,6 +1,6 @@ -package io.github.paldiu.simplexcore.math; +package io.github.simplexdev.simplexcore.math; -import io.github.paldiu.simplexcore.utils.Constants; +import io.github.simplexdev.simplexcore.utils.Constants; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; diff --git a/src/main/java/io/github/paldiu/simplexcore/math/Size.java b/src/main/java/io/github/simplexdev/simplexcore/math/Size.java similarity index 90% rename from src/main/java/io/github/paldiu/simplexcore/math/Size.java rename to src/main/java/io/github/simplexdev/simplexcore/math/Size.java index 4638d1e..864f052 100644 --- a/src/main/java/io/github/paldiu/simplexcore/math/Size.java +++ b/src/main/java/io/github/simplexdev/simplexcore/math/Size.java @@ -1,4 +1,4 @@ -package io.github.paldiu.simplexcore.math; +package io.github.simplexdev.simplexcore.math; public enum Size { SMALL(1, 1, 1), diff --git a/src/main/java/io/github/paldiu/simplexcore/plugin/AddonManager.java b/src/main/java/io/github/simplexdev/simplexcore/plugin/AddonManager.java similarity index 80% rename from src/main/java/io/github/paldiu/simplexcore/plugin/AddonManager.java rename to src/main/java/io/github/simplexdev/simplexcore/plugin/AddonManager.java index 909a7af..74080ce 100644 --- a/src/main/java/io/github/paldiu/simplexcore/plugin/AddonManager.java +++ b/src/main/java/io/github/simplexdev/simplexcore/plugin/AddonManager.java @@ -1,6 +1,6 @@ -package io.github.paldiu.simplexcore.plugin; +package io.github.simplexdev.simplexcore.plugin; -import io.github.paldiu.simplexcore.utils.Constants; +import io.github.simplexdev.simplexcore.utils.Constants; public final class AddonManager { public AddonManager() { diff --git a/src/main/java/io/github/paldiu/simplexcore/plugin/AddonRegistry.java b/src/main/java/io/github/simplexdev/simplexcore/plugin/AddonRegistry.java similarity index 91% rename from src/main/java/io/github/paldiu/simplexcore/plugin/AddonRegistry.java rename to src/main/java/io/github/simplexdev/simplexcore/plugin/AddonRegistry.java index 6dd6feb..17457cf 100644 --- a/src/main/java/io/github/paldiu/simplexcore/plugin/AddonRegistry.java +++ b/src/main/java/io/github/simplexdev/simplexcore/plugin/AddonRegistry.java @@ -1,4 +1,4 @@ -package io.github.paldiu.simplexcore.plugin; +package io.github.simplexdev.simplexcore.plugin; import java.util.HashSet; import java.util.Set; diff --git a/src/main/java/io/github/paldiu/simplexcore/plugin/DependencyManagement.java b/src/main/java/io/github/simplexdev/simplexcore/plugin/DependencyManagement.java similarity index 94% rename from src/main/java/io/github/paldiu/simplexcore/plugin/DependencyManagement.java rename to src/main/java/io/github/simplexdev/simplexcore/plugin/DependencyManagement.java index 6672c0a..084e376 100644 --- a/src/main/java/io/github/paldiu/simplexcore/plugin/DependencyManagement.java +++ b/src/main/java/io/github/simplexdev/simplexcore/plugin/DependencyManagement.java @@ -1,4 +1,4 @@ -package io.github.paldiu.simplexcore.plugin; +package io.github.simplexdev.simplexcore.plugin; import com.comphenix.protocol.ProtocolLibrary; import com.comphenix.protocol.ProtocolManager; diff --git a/src/main/java/io/github/paldiu/simplexcore/plugin/SimplexAddon.java b/src/main/java/io/github/simplexdev/simplexcore/plugin/SimplexAddon.java similarity index 93% rename from src/main/java/io/github/paldiu/simplexcore/plugin/SimplexAddon.java rename to src/main/java/io/github/simplexdev/simplexcore/plugin/SimplexAddon.java index 230e53f..2b69800 100644 --- a/src/main/java/io/github/paldiu/simplexcore/plugin/SimplexAddon.java +++ b/src/main/java/io/github/simplexdev/simplexcore/plugin/SimplexAddon.java @@ -1,4 +1,4 @@ -package io.github.paldiu.simplexcore.plugin; +package io.github.simplexdev.simplexcore.plugin; import org.bukkit.plugin.java.JavaPlugin; diff --git a/src/main/java/io/github/paldiu/simplexcore/potion/PotionsFactory.java b/src/main/java/io/github/simplexdev/simplexcore/potion/PotionsFactory.java similarity index 79% rename from src/main/java/io/github/paldiu/simplexcore/potion/PotionsFactory.java rename to src/main/java/io/github/simplexdev/simplexcore/potion/PotionsFactory.java index 4379dd0..b8ef8a4 100644 --- a/src/main/java/io/github/paldiu/simplexcore/potion/PotionsFactory.java +++ b/src/main/java/io/github/simplexdev/simplexcore/potion/PotionsFactory.java @@ -1,6 +1,7 @@ -package io.github.paldiu.simplexcore.potion; +package io.github.simplexdev.simplexcore.potion; -import io.github.paldiu.simplexcore.utils.Utilities; +import io.github.simplexdev.api.IPotionEffect; +import io.github.simplexdev.simplexcore.utils.Utilities; import org.bukkit.entity.LivingEntity; import org.bukkit.potion.PotionEffect; diff --git a/src/main/java/io/github/paldiu/simplexcore/structures/Structure.java b/src/main/java/io/github/simplexdev/simplexcore/structures/Structure.java similarity index 59% rename from src/main/java/io/github/paldiu/simplexcore/structures/Structure.java rename to src/main/java/io/github/simplexdev/simplexcore/structures/Structure.java index a101a7c..2f95837 100644 --- a/src/main/java/io/github/paldiu/simplexcore/structures/Structure.java +++ b/src/main/java/io/github/simplexdev/simplexcore/structures/Structure.java @@ -1,4 +1,4 @@ -package io.github.paldiu.simplexcore.structures; +package io.github.simplexdev.simplexcore.structures; public class Structure { // TODO: Write this file to parse schematics. diff --git a/src/main/java/io/github/paldiu/simplexcore/utils/Bean.java b/src/main/java/io/github/simplexdev/simplexcore/utils/Bean.java similarity index 94% rename from src/main/java/io/github/paldiu/simplexcore/utils/Bean.java rename to src/main/java/io/github/simplexdev/simplexcore/utils/Bean.java index 84a2596..ac2b8d3 100644 --- a/src/main/java/io/github/paldiu/simplexcore/utils/Bean.java +++ b/src/main/java/io/github/simplexdev/simplexcore/utils/Bean.java @@ -1,4 +1,4 @@ -package io.github.paldiu.simplexcore.utils; +package io.github.simplexdev.simplexcore.utils; import org.apache.commons.lang.builder.EqualsBuilder; import org.apache.commons.lang.builder.HashCodeBuilder; diff --git a/src/main/java/io/github/simplexdev/simplexcore/utils/Constants.java b/src/main/java/io/github/simplexdev/simplexcore/utils/Constants.java new file mode 100644 index 0000000..73e7127 --- /dev/null +++ b/src/main/java/io/github/simplexdev/simplexcore/utils/Constants.java @@ -0,0 +1,43 @@ +package io.github.simplexdev.simplexcore.utils; + +import io.github.simplexdev.simplexcore.SimplexCorePlugin; +import io.github.simplexdev.simplexcore.command.CommandLoader; +import io.github.simplexdev.simplexcore.config.Yaml; +import io.github.simplexdev.simplexcore.config.YamlFactory; +import io.github.simplexdev.simplexcore.plugin.AddonRegistry; +import io.github.simplexdev.simplexcore.plugin.DependencyManagement; +import org.bukkit.Server; +import org.bukkit.plugin.PluginManager; +import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.scheduler.BukkitScheduler; + +import java.util.logging.Logger; + +public final class Constants { + private static final SimplexCorePlugin plugin = JavaPlugin.getPlugin(SimplexCorePlugin.class); + private static final Server server = plugin.getServer(); + private static final Logger logger = plugin.getLogger(); + private static final PluginManager manager = server.getPluginManager(); + private static final BukkitScheduler scheduler = server.getScheduler(); + + public static SimplexCorePlugin getPlugin() { + return plugin; + } + + public static Server getServer() { + return server; + } + + public static Logger getLogger() { + return logger; + } + + public static PluginManager getManager() { + return manager; + } + + public static BukkitScheduler getScheduler() { + return scheduler; + } +} + diff --git a/src/main/java/io/github/simplexdev/simplexcore/utils/Instances.java b/src/main/java/io/github/simplexdev/simplexcore/utils/Instances.java new file mode 100644 index 0000000..5293a65 --- /dev/null +++ b/src/main/java/io/github/simplexdev/simplexcore/utils/Instances.java @@ -0,0 +1,33 @@ +package io.github.simplexdev.simplexcore.utils; + +import io.github.simplexdev.simplexcore.command.CommandLoader; +import io.github.simplexdev.simplexcore.config.Yaml; +import io.github.simplexdev.simplexcore.config.YamlFactory; +import io.github.simplexdev.simplexcore.plugin.AddonRegistry; +import io.github.simplexdev.simplexcore.plugin.DependencyManagement; + +public class Instances { + private final DependencyManagement dpm = new DependencyManagement(); + private final Yaml config = new YamlFactory(Constants.getPlugin()).setDefaultPathways(); + private final TimeValues time = new TimeValues(); + + public synchronized AddonRegistry getRegistry() { + return AddonRegistry.getInstance(); + } + + public synchronized CommandLoader getCommandLoader() { + return CommandLoader.getInstance(); + } + + public DependencyManagement getDependencyManager() { + return dpm; + } + + public TimeValues getTimeValues() { + return time; + } + + public Yaml getConfig() { + return config; + } +} diff --git a/src/main/java/io/github/simplexdev/simplexcore/utils/TimeValues.java b/src/main/java/io/github/simplexdev/simplexcore/utils/TimeValues.java new file mode 100644 index 0000000..98aea8f --- /dev/null +++ b/src/main/java/io/github/simplexdev/simplexcore/utils/TimeValues.java @@ -0,0 +1,27 @@ +package io.github.simplexdev.simplexcore.utils; + +public final class TimeValues { + public long SECOND() { + return 20L; + } + + public long MINUTE() { + return 1200L; + } + + public long HOUR() { + return 72000L; + } + + public long DAY() { + return 1728000L; + } + + public long MONTH() { + return 51840000L; + } + + public long YEAR() { + return 622080000L; + } +} diff --git a/src/main/java/io/github/paldiu/simplexcore/utils/Trio.java b/src/main/java/io/github/simplexdev/simplexcore/utils/Trio.java similarity index 96% rename from src/main/java/io/github/paldiu/simplexcore/utils/Trio.java rename to src/main/java/io/github/simplexdev/simplexcore/utils/Trio.java index da68789..884f623 100644 --- a/src/main/java/io/github/paldiu/simplexcore/utils/Trio.java +++ b/src/main/java/io/github/simplexdev/simplexcore/utils/Trio.java @@ -1,4 +1,4 @@ -package io.github.paldiu.simplexcore.utils; +package io.github.simplexdev.simplexcore.utils; import org.apache.commons.lang.builder.EqualsBuilder; import org.apache.commons.lang.builder.HashCodeBuilder; diff --git a/src/main/java/io/github/paldiu/simplexcore/utils/Utilities.java b/src/main/java/io/github/simplexdev/simplexcore/utils/Utilities.java similarity index 92% rename from src/main/java/io/github/paldiu/simplexcore/utils/Utilities.java rename to src/main/java/io/github/simplexdev/simplexcore/utils/Utilities.java index ba58e9a..d867a18 100644 --- a/src/main/java/io/github/paldiu/simplexcore/utils/Utilities.java +++ b/src/main/java/io/github/simplexdev/simplexcore/utils/Utilities.java @@ -1,6 +1,7 @@ -package io.github.paldiu.simplexcore.utils; +package io.github.simplexdev.simplexcore.utils; -import io.github.paldiu.simplexcore.ban.BanType; +import io.github.simplexdev.api.func.Guard; +import io.github.simplexdev.simplexcore.ban.BanType; import java.util.ArrayList; import java.util.Arrays; @@ -68,4 +69,4 @@ public final class Utilities { String temp = String.valueOf(character).toUpperCase(); return temp.charAt(0); } -} +} \ No newline at end of file diff --git a/src/test/java/io/github/paldiu/simplexcore/utils/UtilitiesTest.java b/src/test/java/io/github/simplexdev/simplexcore/utils/UtilitiesTest.java similarity index 65% rename from src/test/java/io/github/paldiu/simplexcore/utils/UtilitiesTest.java rename to src/test/java/io/github/simplexdev/simplexcore/utils/UtilitiesTest.java index 25eea89..7da0341 100644 --- a/src/test/java/io/github/paldiu/simplexcore/utils/UtilitiesTest.java +++ b/src/test/java/io/github/simplexdev/simplexcore/utils/UtilitiesTest.java @@ -1,7 +1,7 @@ -package io.github.paldiu.simplexcore.utils; +package io.github.simplexdev.simplexcore.utils; import junit.framework.TestCase; -import io.github.paldiu.simplexcore.ban.BanType; +import io.github.simplexdev.simplexcore.ban.BanType; public class UtilitiesTest extends TestCase { public void testGenerateBanId() {