From d4461f09c850dbf56d08f1b470fb1ad740c0d7f1 Mon Sep 17 00:00:00 2001 From: Govindass Date: Thu, 29 Oct 2020 10:01:36 +0200 Subject: [PATCH] some refactoring, make classes more well-sorted --- src/main/java/META-INF/MANIFEST.MF | 2 +- .../limework/{core => rediskript}/RediSkript.java | 10 +++++----- .../commands/CommandReloadRedis.java} | 8 ++++---- .../limework/{ => rediskript}/data/Encryption.java | 2 +- .../events/RedisMessageEvent.java | 2 +- .../managers/RedisManager.java | 8 ++++---- .../hooks => rediskript/skript}/SkriptHook.java | 14 +++++++------- .../skript/elements/EffSendMessage.java | 6 +++--- .../skript/elements/EvtRedis.java | 6 +++--- .../skript/elements/ExprChannel.java | 4 ++-- .../skript/elements/ExprMessage.java | 4 ++-- .../skript/elements/ExprMessageDate.java | 4 ++-- 12 files changed, 35 insertions(+), 35 deletions(-) rename src/main/java/net/limework/{core => rediskript}/RediSkript.java (82%) rename src/main/java/net/limework/{core/commands/ReloadRedis.java => rediskript/commands/CommandReloadRedis.java} (85%) rename src/main/java/net/limework/{ => rediskript}/data/Encryption.java (97%) rename src/main/java/net/limework/{core => rediskript}/events/RedisMessageEvent.java (95%) rename src/main/java/net/limework/{core => rediskript}/managers/RedisManager.java (97%) rename src/main/java/net/limework/{core/hooks => rediskript/skript}/SkriptHook.java (83%) rename src/main/java/net/limework/{core => rediskript}/skript/elements/EffSendMessage.java (94%) rename src/main/java/net/limework/{core => rediskript}/skript/elements/EvtRedis.java (70%) rename src/main/java/net/limework/{core => rediskript}/skript/elements/ExprChannel.java (92%) rename src/main/java/net/limework/{core => rediskript}/skript/elements/ExprMessage.java (92%) rename src/main/java/net/limework/{core => rediskript}/skript/elements/ExprMessageDate.java (92%) diff --git a/src/main/java/META-INF/MANIFEST.MF b/src/main/java/META-INF/MANIFEST.MF index 2e5c799..5772dbe 100644 --- a/src/main/java/META-INF/MANIFEST.MF +++ b/src/main/java/META-INF/MANIFEST.MF @@ -1,3 +1,3 @@ Manifest-Version: 1.0 -Main-Class: net.limework.core.RediSkript +Main-Class: net.limework.rediskript.RediSkript diff --git a/src/main/java/net/limework/core/RediSkript.java b/src/main/java/net/limework/rediskript/RediSkript.java similarity index 82% rename from src/main/java/net/limework/core/RediSkript.java rename to src/main/java/net/limework/rediskript/RediSkript.java index e9dd044..f42c66d 100644 --- a/src/main/java/net/limework/core/RediSkript.java +++ b/src/main/java/net/limework/rediskript/RediSkript.java @@ -1,7 +1,7 @@ -package net.limework.core; -import net.limework.core.commands.ReloadRedis; -import net.limework.core.hooks.SkriptHook; -import net.limework.core.managers.RedisManager; +package net.limework.rediskript; +import net.limework.rediskript.commands.CommandReloadRedis; +import net.limework.rediskript.skript.SkriptHook; +import net.limework.rediskript.managers.RedisManager; import org.bukkit.command.PluginCommand; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -25,7 +25,7 @@ public class RediSkript extends JavaPlugin { PluginCommand command = getServer().getPluginCommand("reloadredis"); assert command != null; - command.setExecutor(new ReloadRedis(this)); + command.setExecutor(new CommandReloadRedis(this)); new SkriptHook(this); } else { diff --git a/src/main/java/net/limework/core/commands/ReloadRedis.java b/src/main/java/net/limework/rediskript/commands/CommandReloadRedis.java similarity index 85% rename from src/main/java/net/limework/core/commands/ReloadRedis.java rename to src/main/java/net/limework/rediskript/commands/CommandReloadRedis.java index 263d9d4..1dfecd8 100644 --- a/src/main/java/net/limework/core/commands/ReloadRedis.java +++ b/src/main/java/net/limework/rediskript/commands/CommandReloadRedis.java @@ -1,6 +1,6 @@ -package net.limework.core.commands; +package net.limework.rediskript.commands; -import net.limework.core.RediSkript; +import net.limework.rediskript.RediSkript; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.command.Command; @@ -8,9 +8,9 @@ import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -public class ReloadRedis implements CommandExecutor { +public class CommandReloadRedis implements CommandExecutor { private RediSkript plugin; - public ReloadRedis(RediSkript plugin) { + public CommandReloadRedis(RediSkript plugin) { this.plugin = plugin; } @Override diff --git a/src/main/java/net/limework/data/Encryption.java b/src/main/java/net/limework/rediskript/data/Encryption.java similarity index 97% rename from src/main/java/net/limework/data/Encryption.java rename to src/main/java/net/limework/rediskript/data/Encryption.java index a2cdc79..9401583 100644 --- a/src/main/java/net/limework/data/Encryption.java +++ b/src/main/java/net/limework/rediskript/data/Encryption.java @@ -1,4 +1,4 @@ -package net.limework.data; +package net.limework.rediskript.data; import org.bukkit.configuration.Configuration; import org.cryptomator.siv.SivMode; diff --git a/src/main/java/net/limework/core/events/RedisMessageEvent.java b/src/main/java/net/limework/rediskript/events/RedisMessageEvent.java similarity index 95% rename from src/main/java/net/limework/core/events/RedisMessageEvent.java rename to src/main/java/net/limework/rediskript/events/RedisMessageEvent.java index e51b11c..6be4717 100644 --- a/src/main/java/net/limework/core/events/RedisMessageEvent.java +++ b/src/main/java/net/limework/rediskript/events/RedisMessageEvent.java @@ -1,4 +1,4 @@ -package net.limework.core.events; +package net.limework.rediskript.events; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; diff --git a/src/main/java/net/limework/core/managers/RedisManager.java b/src/main/java/net/limework/rediskript/managers/RedisManager.java similarity index 97% rename from src/main/java/net/limework/core/managers/RedisManager.java rename to src/main/java/net/limework/rediskript/managers/RedisManager.java index 7fbbf92..7ad883b 100644 --- a/src/main/java/net/limework/core/managers/RedisManager.java +++ b/src/main/java/net/limework/rediskript/managers/RedisManager.java @@ -1,8 +1,8 @@ -package net.limework.core.managers; +package net.limework.rediskript.managers; -import net.limework.core.RediSkript; -import net.limework.core.events.RedisMessageEvent; -import net.limework.data.Encryption; +import net.limework.rediskript.RediSkript; +import net.limework.rediskript.events.RedisMessageEvent; +import net.limework.rediskript.data.Encryption; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.configuration.Configuration; diff --git a/src/main/java/net/limework/core/hooks/SkriptHook.java b/src/main/java/net/limework/rediskript/skript/SkriptHook.java similarity index 83% rename from src/main/java/net/limework/core/hooks/SkriptHook.java rename to src/main/java/net/limework/rediskript/skript/SkriptHook.java index 2c11990..27bf0f3 100644 --- a/src/main/java/net/limework/core/hooks/SkriptHook.java +++ b/src/main/java/net/limework/rediskript/skript/SkriptHook.java @@ -1,4 +1,4 @@ -package net.limework.core.hooks; +package net.limework.rediskript.skript; import ch.njol.skript.Skript; import ch.njol.skript.SkriptAddon; @@ -6,12 +6,12 @@ import ch.njol.skript.lang.ExpressionType; import ch.njol.skript.registrations.EventValues; import ch.njol.skript.util.Date; import ch.njol.skript.util.Getter; -import net.limework.core.RediSkript; -import net.limework.core.events.RedisMessageEvent; -import net.limework.core.skript.elements.EvtRedis; -import net.limework.core.skript.elements.ExprChannel; -import net.limework.core.skript.elements.ExprMessage; -import net.limework.core.skript.elements.ExprMessageDate; +import net.limework.rediskript.RediSkript; +import net.limework.rediskript.events.RedisMessageEvent; +import net.limework.rediskript.skript.elements.EvtRedis; +import net.limework.rediskript.skript.elements.ExprChannel; +import net.limework.rediskript.skript.elements.ExprMessage; +import net.limework.rediskript.skript.elements.ExprMessageDate; import java.io.IOException; diff --git a/src/main/java/net/limework/core/skript/elements/EffSendMessage.java b/src/main/java/net/limework/rediskript/skript/elements/EffSendMessage.java similarity index 94% rename from src/main/java/net/limework/core/skript/elements/EffSendMessage.java rename to src/main/java/net/limework/rediskript/skript/elements/EffSendMessage.java index 8b00a3d..42a6eaf 100644 --- a/src/main/java/net/limework/core/skript/elements/EffSendMessage.java +++ b/src/main/java/net/limework/rediskript/skript/elements/EffSendMessage.java @@ -1,12 +1,12 @@ -package net.limework.core.skript.elements; +package net.limework.rediskript.skript.elements; import ch.njol.skript.Skript; import ch.njol.skript.lang.Effect; import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.SkriptParser; import ch.njol.util.Kleenean; -import net.limework.core.RediSkript; -import net.limework.core.managers.RedisManager; +import net.limework.rediskript.RediSkript; +import net.limework.rediskript.managers.RedisManager; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.event.Event; diff --git a/src/main/java/net/limework/core/skript/elements/EvtRedis.java b/src/main/java/net/limework/rediskript/skript/elements/EvtRedis.java similarity index 70% rename from src/main/java/net/limework/core/skript/elements/EvtRedis.java rename to src/main/java/net/limework/rediskript/skript/elements/EvtRedis.java index 004f9ee..0cc1783 100644 --- a/src/main/java/net/limework/core/skript/elements/EvtRedis.java +++ b/src/main/java/net/limework/rediskript/skript/elements/EvtRedis.java @@ -1,14 +1,14 @@ -package net.limework.core.skript.elements; +package net.limework.rediskript.skript.elements; import ch.njol.skript.lang.Literal; import ch.njol.skript.lang.SkriptEvent; import ch.njol.skript.lang.SkriptParser; -import net.limework.core.events.RedisMessageEvent; +import net.limework.rediskript.events.RedisMessageEvent; import org.bukkit.event.Event; public class EvtRedis extends SkriptEvent { @Override - public boolean init(Literal[] literals, int i, SkriptParser.ParseResult parseResult) { + public boolean init(final Literal[] literals, final int i, final SkriptParser.ParseResult parseResult) { return true; } diff --git a/src/main/java/net/limework/core/skript/elements/ExprChannel.java b/src/main/java/net/limework/rediskript/skript/elements/ExprChannel.java similarity index 92% rename from src/main/java/net/limework/core/skript/elements/ExprChannel.java rename to src/main/java/net/limework/rediskript/skript/elements/ExprChannel.java index 9422a1c..86625b4 100644 --- a/src/main/java/net/limework/core/skript/elements/ExprChannel.java +++ b/src/main/java/net/limework/rediskript/skript/elements/ExprChannel.java @@ -1,4 +1,4 @@ -package net.limework.core.skript.elements; +package net.limework.rediskript.skript.elements; import ch.njol.skript.ScriptLoader; @@ -8,7 +8,7 @@ import ch.njol.skript.lang.SkriptParser; import ch.njol.skript.lang.util.SimpleExpression; import ch.njol.skript.log.ErrorQuality; import ch.njol.util.Kleenean; -import net.limework.core.events.RedisMessageEvent; +import net.limework.rediskript.events.RedisMessageEvent; import org.bukkit.event.Event; public class ExprChannel extends SimpleExpression { diff --git a/src/main/java/net/limework/core/skript/elements/ExprMessage.java b/src/main/java/net/limework/rediskript/skript/elements/ExprMessage.java similarity index 92% rename from src/main/java/net/limework/core/skript/elements/ExprMessage.java rename to src/main/java/net/limework/rediskript/skript/elements/ExprMessage.java index e902af4..c7977af 100644 --- a/src/main/java/net/limework/core/skript/elements/ExprMessage.java +++ b/src/main/java/net/limework/rediskript/skript/elements/ExprMessage.java @@ -1,4 +1,4 @@ -package net.limework.core.skript.elements; +package net.limework.rediskript.skript.elements; import ch.njol.skript.ScriptLoader; @@ -8,7 +8,7 @@ import ch.njol.skript.lang.SkriptParser; import ch.njol.skript.lang.util.SimpleExpression; import ch.njol.skript.log.ErrorQuality; import ch.njol.util.Kleenean; -import net.limework.core.events.RedisMessageEvent; +import net.limework.rediskript.events.RedisMessageEvent; import org.bukkit.event.Event; public class ExprMessage extends SimpleExpression { diff --git a/src/main/java/net/limework/core/skript/elements/ExprMessageDate.java b/src/main/java/net/limework/rediskript/skript/elements/ExprMessageDate.java similarity index 92% rename from src/main/java/net/limework/core/skript/elements/ExprMessageDate.java rename to src/main/java/net/limework/rediskript/skript/elements/ExprMessageDate.java index 51f4491..5325e04 100644 --- a/src/main/java/net/limework/core/skript/elements/ExprMessageDate.java +++ b/src/main/java/net/limework/rediskript/skript/elements/ExprMessageDate.java @@ -1,4 +1,4 @@ -package net.limework.core.skript.elements; +package net.limework.rediskript.skript.elements; import ch.njol.skript.ScriptLoader; @@ -9,7 +9,7 @@ import ch.njol.skript.lang.util.SimpleExpression; import ch.njol.skript.log.ErrorQuality; import ch.njol.skript.util.Date; import ch.njol.util.Kleenean; -import net.limework.core.events.RedisMessageEvent; +import net.limework.rediskript.events.RedisMessageEvent; import org.bukkit.event.Event; public class ExprMessageDate extends SimpleExpression {