From 7d29e70cf621e1bc24be33d0960e5ab1a874a8b1 Mon Sep 17 00:00:00 2001 From: Aztec Date: Sun, 28 Jun 2020 16:24:08 -0600 Subject: [PATCH] Reorganized the folders slightly Reorganized the way repositories are --- .../com/sekwah/advancedportals/Config.java | 29 +++++ .../repository => }/ConfigRepository.java | 4 +- .../repository => }/ConfigRepositoryImpl.java | 27 ++++- .../{core/entities => }/DataTag.java | 2 +- .../{core/entities => }/PlayerLocation.java | 39 +++++-- .../{core/entities => }/PlayerTempData.java | 2 +- .../{core/entities => }/PortalLocation.java | 2 +- .../{core => }/api/commands/SubCommand.java | 2 +- .../api/destination/Destination.java | 12 +- .../{core => }/api/effect/TestEffect.java | 6 +- .../{core => }/api/effect/WarpEffect.java | 6 +- .../api/events/PortalEditEvent.java | 2 +- .../api/events/PortalsLoadedEvent.java | 2 +- .../{core => }/api/events/WarpEvent.java | 0 .../{core => }/api/portal/AdvancedPortal.java | 12 +- .../api/registry/SubCommandRegistry.java | 4 +- .../{core => }/api/registry/TagRegistry.java | 4 +- .../api/registry/WarpEffectRegistry.java | 4 +- .../api/services/DestinationServices.java | 11 +- .../api/services/PortalServices.java | 11 +- .../api/services/PortalTempDataServices.java | 6 +- .../api/warphandler/ActivationData.java | 0 .../api/warphandler/TagHandler.java | 0 .../{core => }/commands/CommandTemplate.java | 2 +- .../commands/CommandWithSubCommands.java | 6 +- .../subcommands/CreateSubCommand.java | 4 +- .../desti/CreateDestiSubCommand.java | 10 +- .../portal/CreatePortalSubCommand.java | 10 +- .../portal/EndGatewayBlockSubCommand.java | 4 +- .../portal/EndPortalBlockSubCommand.java | 4 +- .../portal/PortalBlockSubCommand.java | 4 +- .../subcommands/portal/ReloadSubCommand.java | 4 +- .../subcommands/portal/RemoveSubCommand.java | 6 +- .../portal/SelectorSubCommand.java | 4 +- .../portal/TransUpdateSubCommand.java | 4 +- .../subcommands/portal/VersionSubCommand.java | 4 +- .../{core => }/config/Config.java | 2 +- .../{core => }/config/RepositoryModule.java | 9 +- .../core/AdvancedPortalsCore.java | 28 ++--- .../advancedportals/core/CoreListeners.java | 8 +- .../core/repository/PortalRepository.java | 13 --- .../core/repository/PortalRepositoryImpl.java | 23 ---- .../coreconnector/command/CommandHandler.java | 2 +- .../command/CommandRegister.java | 2 +- .../{core => }/data/DataStorage.java | 2 +- .../repository/DestinationRepository.java | 6 + .../repository/DestinationRepositoryImpl.java | 60 ++++++++++ .../DestinationRepositoryImpl2.java} | 19 +-- .../DestinationRepositoryOld.java} | 7 +- .../repository/JsonRepository.java | 14 +++ .../repository/PortalRepository.java | 7 ++ .../repository/PortalRepositoryImpl.java | 33 ++++++ .../repository/PortalTempDataRepository.java | 6 +- .../PortalTempDataRepositoryImpl.java | 7 +- .../services/DestinationServices.java | 109 ++++++++++++++++++ .../services/PortalServices.java | 52 +++++++++ .../advancedportals/services/Response.java | 7 ++ .../convertolddata/ConvertOldSubCommand.java | 2 +- .../command/SpigotCommandHandler.java | 3 +- .../command/SpigotCommandRegister.java | 2 +- .../container/SpigotPlayerContainer.java | 4 +- .../container/SpigotWorldContainer.java | 2 +- .../spigot/effect/WarpEffectEnder.java | 6 +- 63 files changed, 512 insertions(+), 176 deletions(-) create mode 100644 src/main/java/com/sekwah/advancedportals/Config.java rename src/main/java/com/sekwah/advancedportals/{core/repository => }/ConfigRepository.java (69%) rename src/main/java/com/sekwah/advancedportals/{core/repository => }/ConfigRepositoryImpl.java (56%) rename src/main/java/com/sekwah/advancedportals/{core/entities => }/DataTag.java (80%) rename src/main/java/com/sekwah/advancedportals/{core/entities => }/PlayerLocation.java (57%) rename src/main/java/com/sekwah/advancedportals/{core/entities => }/PlayerTempData.java (77%) rename src/main/java/com/sekwah/advancedportals/{core/entities => }/PortalLocation.java (90%) rename src/main/java/com/sekwah/advancedportals/{core => }/api/commands/SubCommand.java (95%) rename src/main/java/com/sekwah/advancedportals/{core => }/api/destination/Destination.java (90%) rename src/main/java/com/sekwah/advancedportals/{core => }/api/effect/TestEffect.java (61%) rename src/main/java/com/sekwah/advancedportals/{core => }/api/effect/WarpEffect.java (75%) rename src/main/java/com/sekwah/advancedportals/{core => }/api/events/PortalEditEvent.java (81%) rename src/main/java/com/sekwah/advancedportals/{core => }/api/events/PortalsLoadedEvent.java (84%) rename src/main/java/com/sekwah/advancedportals/{core => }/api/events/WarpEvent.java (100%) rename src/main/java/com/sekwah/advancedportals/{core => }/api/portal/AdvancedPortal.java (90%) rename src/main/java/com/sekwah/advancedportals/{core => }/api/registry/SubCommandRegistry.java (95%) rename src/main/java/com/sekwah/advancedportals/{core => }/api/registry/TagRegistry.java (97%) rename src/main/java/com/sekwah/advancedportals/{core => }/api/registry/WarpEffectRegistry.java (94%) rename src/main/java/com/sekwah/advancedportals/{core => }/api/services/DestinationServices.java (69%) rename src/main/java/com/sekwah/advancedportals/{core => }/api/services/PortalServices.java (79%) rename src/main/java/com/sekwah/advancedportals/{core => }/api/services/PortalTempDataServices.java (76%) rename src/main/java/com/sekwah/advancedportals/{core => }/api/warphandler/ActivationData.java (100%) rename src/main/java/com/sekwah/advancedportals/{core => }/api/warphandler/TagHandler.java (100%) rename src/main/java/com/sekwah/advancedportals/{core => }/commands/CommandTemplate.java (92%) rename src/main/java/com/sekwah/advancedportals/{core => }/commands/CommandWithSubCommands.java (97%) rename src/main/java/com/sekwah/advancedportals/{core => }/commands/subcommands/CreateSubCommand.java (92%) rename src/main/java/com/sekwah/advancedportals/{core => }/commands/subcommands/desti/CreateDestiSubCommand.java (89%) rename src/main/java/com/sekwah/advancedportals/{core => }/commands/subcommands/portal/CreatePortalSubCommand.java (88%) rename src/main/java/com/sekwah/advancedportals/{core => }/commands/subcommands/portal/EndGatewayBlockSubCommand.java (92%) rename src/main/java/com/sekwah/advancedportals/{core => }/commands/subcommands/portal/EndPortalBlockSubCommand.java (92%) rename src/main/java/com/sekwah/advancedportals/{core => }/commands/subcommands/portal/PortalBlockSubCommand.java (92%) rename src/main/java/com/sekwah/advancedportals/{core => }/commands/subcommands/portal/ReloadSubCommand.java (90%) rename src/main/java/com/sekwah/advancedportals/{core => }/commands/subcommands/portal/RemoveSubCommand.java (92%) rename src/main/java/com/sekwah/advancedportals/{core => }/commands/subcommands/portal/SelectorSubCommand.java (92%) rename src/main/java/com/sekwah/advancedportals/{core => }/commands/subcommands/portal/TransUpdateSubCommand.java (90%) rename src/main/java/com/sekwah/advancedportals/{core => }/commands/subcommands/portal/VersionSubCommand.java (87%) rename src/main/java/com/sekwah/advancedportals/{core => }/config/Config.java (93%) rename src/main/java/com/sekwah/advancedportals/{core => }/config/RepositoryModule.java (71%) delete mode 100644 src/main/java/com/sekwah/advancedportals/core/repository/PortalRepository.java delete mode 100644 src/main/java/com/sekwah/advancedportals/core/repository/PortalRepositoryImpl.java rename src/main/java/com/sekwah/advancedportals/{core => }/data/DataStorage.java (99%) create mode 100644 src/main/java/com/sekwah/advancedportals/repository/DestinationRepository.java create mode 100644 src/main/java/com/sekwah/advancedportals/repository/DestinationRepositoryImpl.java rename src/main/java/com/sekwah/advancedportals/{core/repository/DestinationRepositoryImpl.java => repository/DestinationRepositoryImpl2.java} (84%) rename src/main/java/com/sekwah/advancedportals/{core/repository/DestinationRepository.java => repository/DestinationRepositoryOld.java} (57%) create mode 100644 src/main/java/com/sekwah/advancedportals/repository/JsonRepository.java create mode 100644 src/main/java/com/sekwah/advancedportals/repository/PortalRepository.java create mode 100644 src/main/java/com/sekwah/advancedportals/repository/PortalRepositoryImpl.java rename src/main/java/com/sekwah/advancedportals/{core => }/repository/PortalTempDataRepository.java (76%) rename src/main/java/com/sekwah/advancedportals/{core => }/repository/PortalTempDataRepositoryImpl.java (90%) create mode 100644 src/main/java/com/sekwah/advancedportals/services/DestinationServices.java create mode 100644 src/main/java/com/sekwah/advancedportals/services/PortalServices.java create mode 100644 src/main/java/com/sekwah/advancedportals/services/Response.java diff --git a/src/main/java/com/sekwah/advancedportals/Config.java b/src/main/java/com/sekwah/advancedportals/Config.java new file mode 100644 index 00000000..b1c03969 --- /dev/null +++ b/src/main/java/com/sekwah/advancedportals/Config.java @@ -0,0 +1,29 @@ +package com.sekwah.advancedportals; + +import java.lang.reflect.Type; + +public class Config { + + public Config(String key, String classType, String value) { + this.key = key; + this.value = value; + } + + private String key; + private Type type; + private String value; + + public String getKey() { + return key; + } + public void setKey(String key) { + this.key = key; + } + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } +} diff --git a/src/main/java/com/sekwah/advancedportals/core/repository/ConfigRepository.java b/src/main/java/com/sekwah/advancedportals/ConfigRepository.java similarity index 69% rename from src/main/java/com/sekwah/advancedportals/core/repository/ConfigRepository.java rename to src/main/java/com/sekwah/advancedportals/ConfigRepository.java index e0bd28c1..d7344d18 100644 --- a/src/main/java/com/sekwah/advancedportals/core/repository/ConfigRepository.java +++ b/src/main/java/com/sekwah/advancedportals/ConfigRepository.java @@ -1,6 +1,6 @@ -package com.sekwah.advancedportals.core.repository; +package com.sekwah.advancedportals; -import com.sekwah.advancedportals.core.data.DataStorage; +import com.sekwah.advancedportals.data.DataStorage; public interface ConfigRepository { diff --git a/src/main/java/com/sekwah/advancedportals/core/repository/ConfigRepositoryImpl.java b/src/main/java/com/sekwah/advancedportals/ConfigRepositoryImpl.java similarity index 56% rename from src/main/java/com/sekwah/advancedportals/core/repository/ConfigRepositoryImpl.java rename to src/main/java/com/sekwah/advancedportals/ConfigRepositoryImpl.java index 7129f97d..994b5488 100644 --- a/src/main/java/com/sekwah/advancedportals/core/repository/ConfigRepositoryImpl.java +++ b/src/main/java/com/sekwah/advancedportals/ConfigRepositoryImpl.java @@ -1,14 +1,35 @@ -package com.sekwah.advancedportals.core.repository; +package com.sekwah.advancedportals; import com.google.inject.Singleton; -import com.sekwah.advancedportals.core.config.Config; -import com.sekwah.advancedportals.core.data.DataStorage; +import com.sekwah.advancedportals.config.Config; +import com.sekwah.advancedportals.data.DataStorage; + +import java.util.HashMap; @Singleton public class ConfigRepositoryImpl implements ConfigRepository { + private HashMap configs; private Config config; + public ConfigRepositoryImpl() { + configs = new HashMap(); + } + + public T getValue(String output) { + + try { + return (T) configs.get(output); + } catch (ClassCastException ignored) { + + } + return null; + } + + private void test() { + this.getValue(""); + } + public boolean getUseOnlySpecialAxe() { return this.config.useOnlySpecialAxe; } diff --git a/src/main/java/com/sekwah/advancedportals/core/entities/DataTag.java b/src/main/java/com/sekwah/advancedportals/DataTag.java similarity index 80% rename from src/main/java/com/sekwah/advancedportals/core/entities/DataTag.java rename to src/main/java/com/sekwah/advancedportals/DataTag.java index 2b85bcdd..35a0c16f 100644 --- a/src/main/java/com/sekwah/advancedportals/core/entities/DataTag.java +++ b/src/main/java/com/sekwah/advancedportals/DataTag.java @@ -1,4 +1,4 @@ -package com.sekwah.advancedportals.core.entities; +package com.sekwah.advancedportals; public class DataTag { diff --git a/src/main/java/com/sekwah/advancedportals/core/entities/PlayerLocation.java b/src/main/java/com/sekwah/advancedportals/PlayerLocation.java similarity index 57% rename from src/main/java/com/sekwah/advancedportals/core/entities/PlayerLocation.java rename to src/main/java/com/sekwah/advancedportals/PlayerLocation.java index 94222368..f16b69cf 100644 --- a/src/main/java/com/sekwah/advancedportals/core/entities/PlayerLocation.java +++ b/src/main/java/com/sekwah/advancedportals/PlayerLocation.java @@ -1,21 +1,22 @@ -package com.sekwah.advancedportals.core.entities; +package com.sekwah.advancedportals; import com.google.gson.annotations.SerializedName; public class PlayerLocation { + @SerializedName("x") - public final double posX; + private final double posX; @SerializedName("y") - public final double posY; + private final double posY; @SerializedName("z") - public final double posZ; + private final double posZ; @SerializedName("w") - public final String worldName; + private final String worldName; @SerializedName("yaw") - public final float yaw; + private final float yaw; @SerializedName("p") - public final float pitch; + private final float pitch; public PlayerLocation(String worldName, double posX, double posY, double posZ) { this.worldName = worldName; @@ -34,4 +35,28 @@ public class PlayerLocation { this.yaw = yaw; this.pitch = pitch; } + + public double getPosX() { + return posX; + } + + public double getPosY() { + return posY; + } + + public double getPosZ() { + return posZ; + } + + public String getWorldName() { + return worldName; + } + + public float getYaw() { + return yaw; + } + + public float getPitch() { + return pitch; + } } diff --git a/src/main/java/com/sekwah/advancedportals/core/entities/PlayerTempData.java b/src/main/java/com/sekwah/advancedportals/PlayerTempData.java similarity index 77% rename from src/main/java/com/sekwah/advancedportals/core/entities/PlayerTempData.java rename to src/main/java/com/sekwah/advancedportals/PlayerTempData.java index 8d9c3816..e9769a50 100644 --- a/src/main/java/com/sekwah/advancedportals/core/entities/PlayerTempData.java +++ b/src/main/java/com/sekwah/advancedportals/PlayerTempData.java @@ -1,4 +1,4 @@ -package com.sekwah.advancedportals.core.entities; +package com.sekwah.advancedportals; public class PlayerTempData { diff --git a/src/main/java/com/sekwah/advancedportals/core/entities/PortalLocation.java b/src/main/java/com/sekwah/advancedportals/PortalLocation.java similarity index 90% rename from src/main/java/com/sekwah/advancedportals/core/entities/PortalLocation.java rename to src/main/java/com/sekwah/advancedportals/PortalLocation.java index d1caaf4b..bd92eda2 100644 --- a/src/main/java/com/sekwah/advancedportals/core/entities/PortalLocation.java +++ b/src/main/java/com/sekwah/advancedportals/PortalLocation.java @@ -1,4 +1,4 @@ -package com.sekwah.advancedportals.core.entities; +package com.sekwah.advancedportals; import com.google.gson.annotations.SerializedName; diff --git a/src/main/java/com/sekwah/advancedportals/core/api/commands/SubCommand.java b/src/main/java/com/sekwah/advancedportals/api/commands/SubCommand.java similarity index 95% rename from src/main/java/com/sekwah/advancedportals/core/api/commands/SubCommand.java rename to src/main/java/com/sekwah/advancedportals/api/commands/SubCommand.java index d939b871..9ea9b5d9 100644 --- a/src/main/java/com/sekwah/advancedportals/core/api/commands/SubCommand.java +++ b/src/main/java/com/sekwah/advancedportals/api/commands/SubCommand.java @@ -1,4 +1,4 @@ -package com.sekwah.advancedportals.core.api.commands; +package com.sekwah.advancedportals.api.commands; import com.sekwah.advancedportals.coreconnector.container.CommandSenderContainer; diff --git a/src/main/java/com/sekwah/advancedportals/core/api/destination/Destination.java b/src/main/java/com/sekwah/advancedportals/api/destination/Destination.java similarity index 90% rename from src/main/java/com/sekwah/advancedportals/core/api/destination/Destination.java rename to src/main/java/com/sekwah/advancedportals/api/destination/Destination.java index 8403152f..808f4459 100644 --- a/src/main/java/com/sekwah/advancedportals/core/api/destination/Destination.java +++ b/src/main/java/com/sekwah/advancedportals/api/destination/Destination.java @@ -1,12 +1,12 @@ -package com.sekwah.advancedportals.core.api.destination; +package com.sekwah.advancedportals.api.destination; import com.google.gson.annotations.SerializedName; import com.sekwah.advancedportals.core.AdvancedPortalsCore; -import com.sekwah.advancedportals.core.api.registry.TagRegistry; -import com.sekwah.advancedportals.core.api.warphandler.ActivationData; -import com.sekwah.advancedportals.core.api.warphandler.TagHandler; -import com.sekwah.advancedportals.core.entities.DataTag; -import com.sekwah.advancedportals.core.entities.PlayerLocation; +import com.sekwah.advancedportals.api.registry.TagRegistry; +import com.sekwah.advancedportals.api.warphandler.ActivationData; +import com.sekwah.advancedportals.api.warphandler.TagHandler; +import com.sekwah.advancedportals.DataTag; +import com.sekwah.advancedportals.PlayerLocation; import com.sekwah.advancedportals.coreconnector.container.PlayerContainer; import java.util.ArrayList; diff --git a/src/main/java/com/sekwah/advancedportals/core/api/effect/TestEffect.java b/src/main/java/com/sekwah/advancedportals/api/effect/TestEffect.java similarity index 61% rename from src/main/java/com/sekwah/advancedportals/core/api/effect/TestEffect.java rename to src/main/java/com/sekwah/advancedportals/api/effect/TestEffect.java index c09f2d6d..778a0e9e 100644 --- a/src/main/java/com/sekwah/advancedportals/core/api/effect/TestEffect.java +++ b/src/main/java/com/sekwah/advancedportals/api/effect/TestEffect.java @@ -1,7 +1,7 @@ -package com.sekwah.advancedportals.core.api.effect; +package com.sekwah.advancedportals.api.effect; -import com.sekwah.advancedportals.core.api.portal.AdvancedPortal; -import com.sekwah.advancedportals.core.entities.PortalLocation; +import com.sekwah.advancedportals.api.portal.AdvancedPortal; +import com.sekwah.advancedportals.PortalLocation; import com.sekwah.advancedportals.coreconnector.container.PlayerContainer; /** diff --git a/src/main/java/com/sekwah/advancedportals/core/api/effect/WarpEffect.java b/src/main/java/com/sekwah/advancedportals/api/effect/WarpEffect.java similarity index 75% rename from src/main/java/com/sekwah/advancedportals/core/api/effect/WarpEffect.java rename to src/main/java/com/sekwah/advancedportals/api/effect/WarpEffect.java index 88f6f945..9464523d 100644 --- a/src/main/java/com/sekwah/advancedportals/core/api/effect/WarpEffect.java +++ b/src/main/java/com/sekwah/advancedportals/api/effect/WarpEffect.java @@ -1,7 +1,7 @@ -package com.sekwah.advancedportals.core.api.effect; +package com.sekwah.advancedportals.api.effect; -import com.sekwah.advancedportals.core.api.portal.AdvancedPortal; -import com.sekwah.advancedportals.core.entities.PortalLocation; +import com.sekwah.advancedportals.api.portal.AdvancedPortal; +import com.sekwah.advancedportals.PortalLocation; import com.sekwah.advancedportals.coreconnector.container.PlayerContainer; /** diff --git a/src/main/java/com/sekwah/advancedportals/core/api/events/PortalEditEvent.java b/src/main/java/com/sekwah/advancedportals/api/events/PortalEditEvent.java similarity index 81% rename from src/main/java/com/sekwah/advancedportals/core/api/events/PortalEditEvent.java rename to src/main/java/com/sekwah/advancedportals/api/events/PortalEditEvent.java index c795bc18..f292fbc1 100644 --- a/src/main/java/com/sekwah/advancedportals/core/api/events/PortalEditEvent.java +++ b/src/main/java/com/sekwah/advancedportals/api/events/PortalEditEvent.java @@ -1,4 +1,4 @@ -package com.sekwah.advancedportals.core.api.events; +package com.sekwah.advancedportals.api.events; /** * Activated when something about the event is edited. diff --git a/src/main/java/com/sekwah/advancedportals/core/api/events/PortalsLoadedEvent.java b/src/main/java/com/sekwah/advancedportals/api/events/PortalsLoadedEvent.java similarity index 84% rename from src/main/java/com/sekwah/advancedportals/core/api/events/PortalsLoadedEvent.java rename to src/main/java/com/sekwah/advancedportals/api/events/PortalsLoadedEvent.java index e6961184..5e0a3a46 100644 --- a/src/main/java/com/sekwah/advancedportals/core/api/events/PortalsLoadedEvent.java +++ b/src/main/java/com/sekwah/advancedportals/api/events/PortalsLoadedEvent.java @@ -1,4 +1,4 @@ -package com.sekwah.advancedportals.core.api.events; +package com.sekwah.advancedportals.api.events; /** diff --git a/src/main/java/com/sekwah/advancedportals/core/api/events/WarpEvent.java b/src/main/java/com/sekwah/advancedportals/api/events/WarpEvent.java similarity index 100% rename from src/main/java/com/sekwah/advancedportals/core/api/events/WarpEvent.java rename to src/main/java/com/sekwah/advancedportals/api/events/WarpEvent.java diff --git a/src/main/java/com/sekwah/advancedportals/core/api/portal/AdvancedPortal.java b/src/main/java/com/sekwah/advancedportals/api/portal/AdvancedPortal.java similarity index 90% rename from src/main/java/com/sekwah/advancedportals/core/api/portal/AdvancedPortal.java rename to src/main/java/com/sekwah/advancedportals/api/portal/AdvancedPortal.java index b61d1fcc..5d3f40ff 100644 --- a/src/main/java/com/sekwah/advancedportals/core/api/portal/AdvancedPortal.java +++ b/src/main/java/com/sekwah/advancedportals/api/portal/AdvancedPortal.java @@ -1,12 +1,12 @@ -package com.sekwah.advancedportals.core.api.portal; +package com.sekwah.advancedportals.api.portal; import com.google.gson.annotations.SerializedName; import com.sekwah.advancedportals.core.AdvancedPortalsCore; -import com.sekwah.advancedportals.core.api.registry.TagRegistry; -import com.sekwah.advancedportals.core.api.warphandler.ActivationData; -import com.sekwah.advancedportals.core.api.warphandler.TagHandler; -import com.sekwah.advancedportals.core.entities.DataTag; -import com.sekwah.advancedportals.core.entities.PortalLocation; +import com.sekwah.advancedportals.api.registry.TagRegistry; +import com.sekwah.advancedportals.api.warphandler.ActivationData; +import com.sekwah.advancedportals.api.warphandler.TagHandler; +import com.sekwah.advancedportals.DataTag; +import com.sekwah.advancedportals.PortalLocation; import com.sekwah.advancedportals.coreconnector.container.PlayerContainer; import java.util.ArrayList; diff --git a/src/main/java/com/sekwah/advancedportals/core/api/registry/SubCommandRegistry.java b/src/main/java/com/sekwah/advancedportals/api/registry/SubCommandRegistry.java similarity index 95% rename from src/main/java/com/sekwah/advancedportals/core/api/registry/SubCommandRegistry.java rename to src/main/java/com/sekwah/advancedportals/api/registry/SubCommandRegistry.java index deacfe44..4e25c1d6 100644 --- a/src/main/java/com/sekwah/advancedportals/core/api/registry/SubCommandRegistry.java +++ b/src/main/java/com/sekwah/advancedportals/api/registry/SubCommandRegistry.java @@ -1,7 +1,7 @@ -package com.sekwah.advancedportals.core.api.registry; +package com.sekwah.advancedportals.api.registry; import com.sekwah.advancedportals.core.AdvancedPortalsCore; -import com.sekwah.advancedportals.core.api.commands.SubCommand; +import com.sekwah.advancedportals.api.commands.SubCommand; import com.sekwah.advancedportals.core.util.InfoLogger; import java.util.ArrayList; diff --git a/src/main/java/com/sekwah/advancedportals/core/api/registry/TagRegistry.java b/src/main/java/com/sekwah/advancedportals/api/registry/TagRegistry.java similarity index 97% rename from src/main/java/com/sekwah/advancedportals/core/api/registry/TagRegistry.java rename to src/main/java/com/sekwah/advancedportals/api/registry/TagRegistry.java index 35a0228d..4fa0c3a1 100644 --- a/src/main/java/com/sekwah/advancedportals/core/api/registry/TagRegistry.java +++ b/src/main/java/com/sekwah/advancedportals/api/registry/TagRegistry.java @@ -1,8 +1,8 @@ -package com.sekwah.advancedportals.core.api.registry; +package com.sekwah.advancedportals.api.registry; import com.google.inject.Inject; import com.sekwah.advancedportals.core.AdvancedPortalsCore; -import com.sekwah.advancedportals.core.api.warphandler.TagHandler; +import com.sekwah.advancedportals.api.warphandler.TagHandler; import java.util.ArrayList; import java.util.Collections; diff --git a/src/main/java/com/sekwah/advancedportals/core/api/registry/WarpEffectRegistry.java b/src/main/java/com/sekwah/advancedportals/api/registry/WarpEffectRegistry.java similarity index 94% rename from src/main/java/com/sekwah/advancedportals/core/api/registry/WarpEffectRegistry.java rename to src/main/java/com/sekwah/advancedportals/api/registry/WarpEffectRegistry.java index f1adf750..f33f96a1 100644 --- a/src/main/java/com/sekwah/advancedportals/core/api/registry/WarpEffectRegistry.java +++ b/src/main/java/com/sekwah/advancedportals/api/registry/WarpEffectRegistry.java @@ -1,8 +1,8 @@ -package com.sekwah.advancedportals.core.api.registry; +package com.sekwah.advancedportals.api.registry; import com.google.inject.Inject; import com.sekwah.advancedportals.core.AdvancedPortalsCore; -import com.sekwah.advancedportals.core.api.effect.WarpEffect; +import com.sekwah.advancedportals.api.effect.WarpEffect; import java.util.HashMap; import java.util.Map; diff --git a/src/main/java/com/sekwah/advancedportals/core/api/services/DestinationServices.java b/src/main/java/com/sekwah/advancedportals/api/services/DestinationServices.java similarity index 69% rename from src/main/java/com/sekwah/advancedportals/core/api/services/DestinationServices.java rename to src/main/java/com/sekwah/advancedportals/api/services/DestinationServices.java index 92111fed..88a271ad 100644 --- a/src/main/java/com/sekwah/advancedportals/core/api/services/DestinationServices.java +++ b/src/main/java/com/sekwah/advancedportals/api/services/DestinationServices.java @@ -1,13 +1,14 @@ -package com.sekwah.advancedportals.core.api.services; +package com.sekwah.advancedportals.api.services; -import com.sekwah.advancedportals.core.api.destination.Destination; -import com.sekwah.advancedportals.core.entities.DataTag; -import com.sekwah.advancedportals.core.entities.PlayerLocation; +import com.sekwah.advancedportals.api.destination.Destination; +import com.sekwah.advancedportals.DataTag; +import com.sekwah.advancedportals.PlayerLocation; +import com.sekwah.advancedportals.repository.DestinationRepositoryOld; import com.sekwah.advancedportals.coreconnector.container.PlayerContainer; import java.util.ArrayList; /** * https://github.com/sekwah41/Advanced-Portals/blob/24175610892152828e21f4ff824eb1589ccb0338/src/com/sekwah/advancedportals/core/api/managers/DestinationManager.java - * Based off the old manager with the data storage and handling moved to {@link com.sekwah.advancedportals.core.repository.DestinationRepository} + * Based off the old manager with the data storage and handling moved to {@link DestinationRepositoryOld} */ public final class DestinationServices { diff --git a/src/main/java/com/sekwah/advancedportals/core/api/services/PortalServices.java b/src/main/java/com/sekwah/advancedportals/api/services/PortalServices.java similarity index 79% rename from src/main/java/com/sekwah/advancedportals/core/api/services/PortalServices.java rename to src/main/java/com/sekwah/advancedportals/api/services/PortalServices.java index 125324f9..a524d460 100644 --- a/src/main/java/com/sekwah/advancedportals/core/api/services/PortalServices.java +++ b/src/main/java/com/sekwah/advancedportals/api/services/PortalServices.java @@ -1,9 +1,10 @@ -package com.sekwah.advancedportals.core.api.services; +package com.sekwah.advancedportals.api.services; import com.google.common.collect.ImmutableList; -import com.sekwah.advancedportals.core.api.portal.AdvancedPortal; -import com.sekwah.advancedportals.core.entities.DataTag; -import com.sekwah.advancedportals.core.entities.PlayerLocation; +import com.sekwah.advancedportals.repository.PortalRepository; +import com.sekwah.advancedportals.api.portal.AdvancedPortal; +import com.sekwah.advancedportals.DataTag; +import com.sekwah.advancedportals.PlayerLocation; import com.sekwah.advancedportals.coreconnector.container.PlayerContainer; import java.util.ArrayList; @@ -12,7 +13,7 @@ import java.util.Map; /** * https://github.com/sekwah41/Advanced-Portals/blob/24175610892152828e21f4ff824eb1589ccb0338/src/com/sekwah/advancedportals/core/api/managers/PortalManager.java * - * Based off the old manager with the data storage and handling moved to {@link com.sekwah.advancedportals.core.repository.PortalRepository} + * Based off the old manager with the data storage and handling moved to {@link PortalRepository} * * Excluding the temp data like selections */ diff --git a/src/main/java/com/sekwah/advancedportals/core/api/services/PortalTempDataServices.java b/src/main/java/com/sekwah/advancedportals/api/services/PortalTempDataServices.java similarity index 76% rename from src/main/java/com/sekwah/advancedportals/core/api/services/PortalTempDataServices.java rename to src/main/java/com/sekwah/advancedportals/api/services/PortalTempDataServices.java index fecefc5b..41f675db 100644 --- a/src/main/java/com/sekwah/advancedportals/core/api/services/PortalTempDataServices.java +++ b/src/main/java/com/sekwah/advancedportals/api/services/PortalTempDataServices.java @@ -1,7 +1,7 @@ -package com.sekwah.advancedportals.core.api.services; +package com.sekwah.advancedportals.api.services; -import com.sekwah.advancedportals.core.entities.PlayerTempData; -import com.sekwah.advancedportals.core.entities.PortalLocation; +import com.sekwah.advancedportals.PlayerTempData; +import com.sekwah.advancedportals.PortalLocation; import com.sekwah.advancedportals.coreconnector.container.PlayerContainer; import java.util.HashMap; diff --git a/src/main/java/com/sekwah/advancedportals/core/api/warphandler/ActivationData.java b/src/main/java/com/sekwah/advancedportals/api/warphandler/ActivationData.java similarity index 100% rename from src/main/java/com/sekwah/advancedportals/core/api/warphandler/ActivationData.java rename to src/main/java/com/sekwah/advancedportals/api/warphandler/ActivationData.java diff --git a/src/main/java/com/sekwah/advancedportals/core/api/warphandler/TagHandler.java b/src/main/java/com/sekwah/advancedportals/api/warphandler/TagHandler.java similarity index 100% rename from src/main/java/com/sekwah/advancedportals/core/api/warphandler/TagHandler.java rename to src/main/java/com/sekwah/advancedportals/api/warphandler/TagHandler.java diff --git a/src/main/java/com/sekwah/advancedportals/core/commands/CommandTemplate.java b/src/main/java/com/sekwah/advancedportals/commands/CommandTemplate.java similarity index 92% rename from src/main/java/com/sekwah/advancedportals/core/commands/CommandTemplate.java rename to src/main/java/com/sekwah/advancedportals/commands/CommandTemplate.java index 7ccf62ad..8c40f052 100644 --- a/src/main/java/com/sekwah/advancedportals/core/commands/CommandTemplate.java +++ b/src/main/java/com/sekwah/advancedportals/commands/CommandTemplate.java @@ -1,4 +1,4 @@ -package com.sekwah.advancedportals.core.commands; +package com.sekwah.advancedportals.commands; import com.sekwah.advancedportals.coreconnector.container.CommandSenderContainer; diff --git a/src/main/java/com/sekwah/advancedportals/core/commands/CommandWithSubCommands.java b/src/main/java/com/sekwah/advancedportals/commands/CommandWithSubCommands.java similarity index 97% rename from src/main/java/com/sekwah/advancedportals/core/commands/CommandWithSubCommands.java rename to src/main/java/com/sekwah/advancedportals/commands/CommandWithSubCommands.java index e05f5847..64a1ae07 100644 --- a/src/main/java/com/sekwah/advancedportals/core/commands/CommandWithSubCommands.java +++ b/src/main/java/com/sekwah/advancedportals/commands/CommandWithSubCommands.java @@ -1,7 +1,7 @@ -package com.sekwah.advancedportals.core.commands; +package com.sekwah.advancedportals.commands; -import com.sekwah.advancedportals.core.api.commands.SubCommand; -import com.sekwah.advancedportals.core.api.registry.SubCommandRegistry; +import com.sekwah.advancedportals.api.commands.SubCommand; +import com.sekwah.advancedportals.api.registry.SubCommandRegistry; import com.sekwah.advancedportals.core.util.Lang; import com.sekwah.advancedportals.coreconnector.container.CommandSenderContainer; diff --git a/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/CreateSubCommand.java b/src/main/java/com/sekwah/advancedportals/commands/subcommands/CreateSubCommand.java similarity index 92% rename from src/main/java/com/sekwah/advancedportals/core/commands/subcommands/CreateSubCommand.java rename to src/main/java/com/sekwah/advancedportals/commands/subcommands/CreateSubCommand.java index 4f3ecdd2..ce1b4b47 100644 --- a/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/CreateSubCommand.java +++ b/src/main/java/com/sekwah/advancedportals/commands/subcommands/CreateSubCommand.java @@ -1,6 +1,6 @@ -package com.sekwah.advancedportals.core.commands.subcommands; +package com.sekwah.advancedportals.commands.subcommands; -import com.sekwah.advancedportals.core.entities.DataTag; +import com.sekwah.advancedportals.DataTag; import java.util.ArrayList; diff --git a/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/desti/CreateDestiSubCommand.java b/src/main/java/com/sekwah/advancedportals/commands/subcommands/desti/CreateDestiSubCommand.java similarity index 89% rename from src/main/java/com/sekwah/advancedportals/core/commands/subcommands/desti/CreateDestiSubCommand.java rename to src/main/java/com/sekwah/advancedportals/commands/subcommands/desti/CreateDestiSubCommand.java index 9c2a9ca3..46ad605d 100644 --- a/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/desti/CreateDestiSubCommand.java +++ b/src/main/java/com/sekwah/advancedportals/commands/subcommands/desti/CreateDestiSubCommand.java @@ -1,10 +1,10 @@ -package com.sekwah.advancedportals.core.commands.subcommands.desti; +package com.sekwah.advancedportals.commands.subcommands.desti; import com.sekwah.advancedportals.core.AdvancedPortalsCore; -import com.sekwah.advancedportals.core.api.commands.SubCommand; -import com.sekwah.advancedportals.core.api.destination.Destination; -import com.sekwah.advancedportals.core.commands.subcommands.CreateSubCommand; -import com.sekwah.advancedportals.core.entities.DataTag; +import com.sekwah.advancedportals.api.commands.SubCommand; +import com.sekwah.advancedportals.api.destination.Destination; +import com.sekwah.advancedportals.commands.subcommands.CreateSubCommand; +import com.sekwah.advancedportals.DataTag; import com.sekwah.advancedportals.core.util.Lang; import com.sekwah.advancedportals.coreconnector.container.CommandSenderContainer; import com.sekwah.advancedportals.coreconnector.container.PlayerContainer; diff --git a/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/CreatePortalSubCommand.java b/src/main/java/com/sekwah/advancedportals/commands/subcommands/portal/CreatePortalSubCommand.java similarity index 88% rename from src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/CreatePortalSubCommand.java rename to src/main/java/com/sekwah/advancedportals/commands/subcommands/portal/CreatePortalSubCommand.java index 85b3b5ad..ce14c75a 100644 --- a/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/CreatePortalSubCommand.java +++ b/src/main/java/com/sekwah/advancedportals/commands/subcommands/portal/CreatePortalSubCommand.java @@ -1,10 +1,10 @@ -package com.sekwah.advancedportals.core.commands.subcommands.portal; +package com.sekwah.advancedportals.commands.subcommands.portal; import com.sekwah.advancedportals.core.AdvancedPortalsCore; -import com.sekwah.advancedportals.core.api.commands.SubCommand; -import com.sekwah.advancedportals.core.api.portal.AdvancedPortal; -import com.sekwah.advancedportals.core.commands.subcommands.CreateSubCommand; -import com.sekwah.advancedportals.core.entities.DataTag; +import com.sekwah.advancedportals.api.commands.SubCommand; +import com.sekwah.advancedportals.api.portal.AdvancedPortal; +import com.sekwah.advancedportals.commands.subcommands.CreateSubCommand; +import com.sekwah.advancedportals.DataTag; import com.sekwah.advancedportals.core.util.Lang; import com.sekwah.advancedportals.coreconnector.container.CommandSenderContainer; import com.sekwah.advancedportals.coreconnector.container.PlayerContainer; diff --git a/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/EndGatewayBlockSubCommand.java b/src/main/java/com/sekwah/advancedportals/commands/subcommands/portal/EndGatewayBlockSubCommand.java similarity index 92% rename from src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/EndGatewayBlockSubCommand.java rename to src/main/java/com/sekwah/advancedportals/commands/subcommands/portal/EndGatewayBlockSubCommand.java index 1aa8fc13..f06f5815 100644 --- a/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/EndGatewayBlockSubCommand.java +++ b/src/main/java/com/sekwah/advancedportals/commands/subcommands/portal/EndGatewayBlockSubCommand.java @@ -1,8 +1,8 @@ -package com.sekwah.advancedportals.core.commands.subcommands.portal; +package com.sekwah.advancedportals.commands.subcommands.portal; import com.google.inject.Inject; import com.sekwah.advancedportals.core.AdvancedPortalsCore; -import com.sekwah.advancedportals.core.api.commands.SubCommand; +import com.sekwah.advancedportals.api.commands.SubCommand; import com.sekwah.advancedportals.core.util.Lang; import com.sekwah.advancedportals.coreconnector.container.CommandSenderContainer; import com.sekwah.advancedportals.coreconnector.container.PlayerContainer; diff --git a/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/EndPortalBlockSubCommand.java b/src/main/java/com/sekwah/advancedportals/commands/subcommands/portal/EndPortalBlockSubCommand.java similarity index 92% rename from src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/EndPortalBlockSubCommand.java rename to src/main/java/com/sekwah/advancedportals/commands/subcommands/portal/EndPortalBlockSubCommand.java index 01a45ac4..270f172b 100644 --- a/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/EndPortalBlockSubCommand.java +++ b/src/main/java/com/sekwah/advancedportals/commands/subcommands/portal/EndPortalBlockSubCommand.java @@ -1,8 +1,8 @@ -package com.sekwah.advancedportals.core.commands.subcommands.portal; +package com.sekwah.advancedportals.commands.subcommands.portal; import com.google.inject.Inject; import com.sekwah.advancedportals.core.AdvancedPortalsCore; -import com.sekwah.advancedportals.core.api.commands.SubCommand; +import com.sekwah.advancedportals.api.commands.SubCommand; import com.sekwah.advancedportals.core.util.Lang; import com.sekwah.advancedportals.coreconnector.container.CommandSenderContainer; import com.sekwah.advancedportals.coreconnector.container.PlayerContainer; diff --git a/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/PortalBlockSubCommand.java b/src/main/java/com/sekwah/advancedportals/commands/subcommands/portal/PortalBlockSubCommand.java similarity index 92% rename from src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/PortalBlockSubCommand.java rename to src/main/java/com/sekwah/advancedportals/commands/subcommands/portal/PortalBlockSubCommand.java index 5b5ec4f9..24087c4a 100644 --- a/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/PortalBlockSubCommand.java +++ b/src/main/java/com/sekwah/advancedportals/commands/subcommands/portal/PortalBlockSubCommand.java @@ -1,8 +1,8 @@ -package com.sekwah.advancedportals.core.commands.subcommands.portal; +package com.sekwah.advancedportals.commands.subcommands.portal; import com.google.inject.Inject; import com.sekwah.advancedportals.core.AdvancedPortalsCore; -import com.sekwah.advancedportals.core.api.commands.SubCommand; +import com.sekwah.advancedportals.api.commands.SubCommand; import com.sekwah.advancedportals.core.util.Lang; import com.sekwah.advancedportals.coreconnector.container.CommandSenderContainer; import com.sekwah.advancedportals.coreconnector.container.PlayerContainer; diff --git a/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/ReloadSubCommand.java b/src/main/java/com/sekwah/advancedportals/commands/subcommands/portal/ReloadSubCommand.java similarity index 90% rename from src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/ReloadSubCommand.java rename to src/main/java/com/sekwah/advancedportals/commands/subcommands/portal/ReloadSubCommand.java index ca9df45d..b6a65841 100644 --- a/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/ReloadSubCommand.java +++ b/src/main/java/com/sekwah/advancedportals/commands/subcommands/portal/ReloadSubCommand.java @@ -1,8 +1,8 @@ -package com.sekwah.advancedportals.core.commands.subcommands.portal; +package com.sekwah.advancedportals.commands.subcommands.portal; import com.google.inject.Inject; import com.sekwah.advancedportals.core.AdvancedPortalsCore; -import com.sekwah.advancedportals.core.api.commands.SubCommand; +import com.sekwah.advancedportals.api.commands.SubCommand; import com.sekwah.advancedportals.core.util.Lang; import com.sekwah.advancedportals.coreconnector.container.CommandSenderContainer; diff --git a/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/RemoveSubCommand.java b/src/main/java/com/sekwah/advancedportals/commands/subcommands/portal/RemoveSubCommand.java similarity index 92% rename from src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/RemoveSubCommand.java rename to src/main/java/com/sekwah/advancedportals/commands/subcommands/portal/RemoveSubCommand.java index 47c0a25d..caa6237a 100644 --- a/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/RemoveSubCommand.java +++ b/src/main/java/com/sekwah/advancedportals/commands/subcommands/portal/RemoveSubCommand.java @@ -1,8 +1,8 @@ -package com.sekwah.advancedportals.core.commands.subcommands.portal; +package com.sekwah.advancedportals.commands.subcommands.portal; import com.sekwah.advancedportals.core.AdvancedPortalsCore; -import com.sekwah.advancedportals.core.api.commands.SubCommand; -import com.sekwah.advancedportals.core.api.portal.AdvancedPortal; +import com.sekwah.advancedportals.api.commands.SubCommand; +import com.sekwah.advancedportals.api.portal.AdvancedPortal; import com.sekwah.advancedportals.core.util.Lang; import com.sekwah.advancedportals.coreconnector.container.CommandSenderContainer; import com.sekwah.advancedportals.coreconnector.container.PlayerContainer; diff --git a/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/SelectorSubCommand.java b/src/main/java/com/sekwah/advancedportals/commands/subcommands/portal/SelectorSubCommand.java similarity index 92% rename from src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/SelectorSubCommand.java rename to src/main/java/com/sekwah/advancedportals/commands/subcommands/portal/SelectorSubCommand.java index 841db69c..1ec77fbe 100644 --- a/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/SelectorSubCommand.java +++ b/src/main/java/com/sekwah/advancedportals/commands/subcommands/portal/SelectorSubCommand.java @@ -1,8 +1,8 @@ -package com.sekwah.advancedportals.core.commands.subcommands.portal; +package com.sekwah.advancedportals.commands.subcommands.portal; import com.google.inject.Inject; import com.sekwah.advancedportals.core.AdvancedPortalsCore; -import com.sekwah.advancedportals.core.api.commands.SubCommand; +import com.sekwah.advancedportals.api.commands.SubCommand; import com.sekwah.advancedportals.core.util.Lang; import com.sekwah.advancedportals.coreconnector.container.CommandSenderContainer; import com.sekwah.advancedportals.coreconnector.container.PlayerContainer; diff --git a/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/TransUpdateSubCommand.java b/src/main/java/com/sekwah/advancedportals/commands/subcommands/portal/TransUpdateSubCommand.java similarity index 90% rename from src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/TransUpdateSubCommand.java rename to src/main/java/com/sekwah/advancedportals/commands/subcommands/portal/TransUpdateSubCommand.java index cede6142..4b1106e6 100644 --- a/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/TransUpdateSubCommand.java +++ b/src/main/java/com/sekwah/advancedportals/commands/subcommands/portal/TransUpdateSubCommand.java @@ -1,8 +1,8 @@ -package com.sekwah.advancedportals.core.commands.subcommands.portal; +package com.sekwah.advancedportals.commands.subcommands.portal; import com.google.inject.Inject; import com.sekwah.advancedportals.core.AdvancedPortalsCore; -import com.sekwah.advancedportals.core.api.commands.SubCommand; +import com.sekwah.advancedportals.api.commands.SubCommand; import com.sekwah.advancedportals.core.util.Lang; import com.sekwah.advancedportals.coreconnector.container.CommandSenderContainer; diff --git a/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/VersionSubCommand.java b/src/main/java/com/sekwah/advancedportals/commands/subcommands/portal/VersionSubCommand.java similarity index 87% rename from src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/VersionSubCommand.java rename to src/main/java/com/sekwah/advancedportals/commands/subcommands/portal/VersionSubCommand.java index 5e766fc0..4eb203dc 100644 --- a/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/VersionSubCommand.java +++ b/src/main/java/com/sekwah/advancedportals/commands/subcommands/portal/VersionSubCommand.java @@ -1,7 +1,7 @@ -package com.sekwah.advancedportals.core.commands.subcommands.portal; +package com.sekwah.advancedportals.commands.subcommands.portal; import com.sekwah.advancedportals.core.AdvancedPortalsCore; -import com.sekwah.advancedportals.core.api.commands.SubCommand; +import com.sekwah.advancedportals.api.commands.SubCommand; import com.sekwah.advancedportals.core.util.Lang; import com.sekwah.advancedportals.coreconnector.container.CommandSenderContainer; diff --git a/src/main/java/com/sekwah/advancedportals/core/config/Config.java b/src/main/java/com/sekwah/advancedportals/config/Config.java similarity index 93% rename from src/main/java/com/sekwah/advancedportals/core/config/Config.java rename to src/main/java/com/sekwah/advancedportals/config/Config.java index c9f23d6f..ecc888a6 100644 --- a/src/main/java/com/sekwah/advancedportals/core/config/Config.java +++ b/src/main/java/com/sekwah/advancedportals/config/Config.java @@ -1,4 +1,4 @@ -package com.sekwah.advancedportals.core.config; +package com.sekwah.advancedportals.config; /** * To store the data for config diff --git a/src/main/java/com/sekwah/advancedportals/core/config/RepositoryModule.java b/src/main/java/com/sekwah/advancedportals/config/RepositoryModule.java similarity index 71% rename from src/main/java/com/sekwah/advancedportals/core/config/RepositoryModule.java rename to src/main/java/com/sekwah/advancedportals/config/RepositoryModule.java index 9f25644f..9148e8b3 100644 --- a/src/main/java/com/sekwah/advancedportals/core/config/RepositoryModule.java +++ b/src/main/java/com/sekwah/advancedportals/config/RepositoryModule.java @@ -1,10 +1,12 @@ -package com.sekwah.advancedportals.core.config; +package com.sekwah.advancedportals.config; import com.google.inject.AbstractModule; import com.google.inject.Provides; import com.google.inject.Scopes; +import com.google.inject.matcher.Matchers; +import com.sekwah.advancedportals.*; import com.sekwah.advancedportals.core.AdvancedPortalsCore; -import com.sekwah.advancedportals.core.repository.*; +import com.sekwah.advancedportals.repository.*; public class RepositoryModule extends AbstractModule { @@ -18,8 +20,9 @@ public class RepositoryModule extends AbstractModule { protected void configure() { bind(PortalRepository.class).to(PortalRepositoryImpl.class).in(Scopes.SINGLETON); bind(DestinationRepository.class).to(DestinationRepositoryImpl.class).in(Scopes.SINGLETON); - bind(PortalTempDataRepository.class).to(PortalTempDataRepositoryImpl.class).in(Scopes.SINGLETON); + bind(PortalRepository.class).to(PortalRepositoryImpl.class).in(Scopes.SINGLETON); bind(ConfigRepository.class).to(ConfigRepositoryImpl.class).in(Scopes.SINGLETON); + bindListener(Matchers.Any(), new Log4JTypeListenr()); } @Provides diff --git a/src/main/java/com/sekwah/advancedportals/core/AdvancedPortalsCore.java b/src/main/java/com/sekwah/advancedportals/core/AdvancedPortalsCore.java index f1ebf588..08d66ad3 100644 --- a/src/main/java/com/sekwah/advancedportals/core/AdvancedPortalsCore.java +++ b/src/main/java/com/sekwah/advancedportals/core/AdvancedPortalsCore.java @@ -2,20 +2,20 @@ package com.sekwah.advancedportals.core; import com.google.inject.Guice; import com.google.inject.Injector; -import com.sekwah.advancedportals.core.api.commands.SubCommand; -import com.sekwah.advancedportals.core.api.destination.Destination; -import com.sekwah.advancedportals.core.api.portal.AdvancedPortal; -import com.sekwah.advancedportals.core.api.registry.TagRegistry; -import com.sekwah.advancedportals.core.api.registry.WarpEffectRegistry; -import com.sekwah.advancedportals.core.api.services.DestinationServices; -import com.sekwah.advancedportals.core.api.services.PortalServices; -import com.sekwah.advancedportals.core.api.services.PortalTempDataServices; -import com.sekwah.advancedportals.core.commands.CommandWithSubCommands; -import com.sekwah.advancedportals.core.commands.subcommands.desti.CreateDestiSubCommand; -import com.sekwah.advancedportals.core.commands.subcommands.portal.*; -import com.sekwah.advancedportals.core.config.RepositoryModule; -import com.sekwah.advancedportals.core.data.DataStorage; -import com.sekwah.advancedportals.core.repository.ConfigRepository; +import com.sekwah.advancedportals.api.commands.SubCommand; +import com.sekwah.advancedportals.api.destination.Destination; +import com.sekwah.advancedportals.api.portal.AdvancedPortal; +import com.sekwah.advancedportals.api.registry.TagRegistry; +import com.sekwah.advancedportals.api.registry.WarpEffectRegistry; +import com.sekwah.advancedportals.api.services.DestinationServices; +import com.sekwah.advancedportals.api.services.PortalServices; +import com.sekwah.advancedportals.api.services.PortalTempDataServices; +import com.sekwah.advancedportals.commands.CommandWithSubCommands; +import com.sekwah.advancedportals.commands.subcommands.desti.CreateDestiSubCommand; +import com.sekwah.advancedportals.commands.subcommands.portal.*; +import com.sekwah.advancedportals.config.RepositoryModule; +import com.sekwah.advancedportals.data.DataStorage; +import com.sekwah.advancedportals.ConfigRepository; import com.sekwah.advancedportals.core.util.InfoLogger; import com.sekwah.advancedportals.core.util.Lang; import com.sekwah.advancedportals.coreconnector.command.CommandRegister; diff --git a/src/main/java/com/sekwah/advancedportals/core/CoreListeners.java b/src/main/java/com/sekwah/advancedportals/core/CoreListeners.java index cee976c0..c0f17f97 100644 --- a/src/main/java/com/sekwah/advancedportals/core/CoreListeners.java +++ b/src/main/java/com/sekwah/advancedportals/core/CoreListeners.java @@ -1,10 +1,10 @@ package com.sekwah.advancedportals.core; import com.google.inject.Inject; -import com.sekwah.advancedportals.core.api.services.PortalServices; -import com.sekwah.advancedportals.core.api.services.PortalTempDataServices; -import com.sekwah.advancedportals.core.entities.PlayerLocation; -import com.sekwah.advancedportals.core.entities.PortalLocation; +import com.sekwah.advancedportals.api.services.PortalServices; +import com.sekwah.advancedportals.api.services.PortalTempDataServices; +import com.sekwah.advancedportals.PlayerLocation; +import com.sekwah.advancedportals.PortalLocation; import com.sekwah.advancedportals.core.util.Lang; import com.sekwah.advancedportals.coreconnector.container.PlayerContainer; import com.sekwah.advancedportals.coreconnector.container.WorldContainer; diff --git a/src/main/java/com/sekwah/advancedportals/core/repository/PortalRepository.java b/src/main/java/com/sekwah/advancedportals/core/repository/PortalRepository.java deleted file mode 100644 index 8eb8d05a..00000000 --- a/src/main/java/com/sekwah/advancedportals/core/repository/PortalRepository.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.sekwah.advancedportals.core.repository; - -import com.sekwah.advancedportals.core.entities.PlayerLocation; -import com.sekwah.advancedportals.coreconnector.container.PlayerContainer; - -public interface PortalRepository { - - void loadPortals(); - - void savePortals(); - - boolean playerMove(PlayerContainer player, PlayerLocation fromLoc, PlayerLocation toLoc); -} diff --git a/src/main/java/com/sekwah/advancedportals/core/repository/PortalRepositoryImpl.java b/src/main/java/com/sekwah/advancedportals/core/repository/PortalRepositoryImpl.java deleted file mode 100644 index 795d42f2..00000000 --- a/src/main/java/com/sekwah/advancedportals/core/repository/PortalRepositoryImpl.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.sekwah.advancedportals.core.repository; - -import com.google.inject.Singleton; -import com.sekwah.advancedportals.core.entities.PlayerLocation; -import com.sekwah.advancedportals.coreconnector.container.PlayerContainer; - -@Singleton -public class PortalRepositoryImpl implements PortalRepository { - @Override - public void loadPortals() { - - } - - @Override - public void savePortals() { - - } - - @Override - public boolean playerMove(PlayerContainer player, PlayerLocation fromLoc, PlayerLocation toLoc) { - return false; - } -} diff --git a/src/main/java/com/sekwah/advancedportals/coreconnector/command/CommandHandler.java b/src/main/java/com/sekwah/advancedportals/coreconnector/command/CommandHandler.java index b43f8ffc..e4151312 100644 --- a/src/main/java/com/sekwah/advancedportals/coreconnector/command/CommandHandler.java +++ b/src/main/java/com/sekwah/advancedportals/coreconnector/command/CommandHandler.java @@ -1,7 +1,7 @@ package com.sekwah.advancedportals.coreconnector.command; -import com.sekwah.advancedportals.core.commands.CommandTemplate; +import com.sekwah.advancedportals.commands.CommandTemplate; public abstract class CommandHandler { diff --git a/src/main/java/com/sekwah/advancedportals/coreconnector/command/CommandRegister.java b/src/main/java/com/sekwah/advancedportals/coreconnector/command/CommandRegister.java index 683f34d7..a86662cb 100644 --- a/src/main/java/com/sekwah/advancedportals/coreconnector/command/CommandRegister.java +++ b/src/main/java/com/sekwah/advancedportals/coreconnector/command/CommandRegister.java @@ -1,6 +1,6 @@ package com.sekwah.advancedportals.coreconnector.command; -import com.sekwah.advancedportals.core.commands.CommandTemplate; +import com.sekwah.advancedportals.commands.CommandTemplate; public interface CommandRegister { diff --git a/src/main/java/com/sekwah/advancedportals/core/data/DataStorage.java b/src/main/java/com/sekwah/advancedportals/data/DataStorage.java similarity index 99% rename from src/main/java/com/sekwah/advancedportals/core/data/DataStorage.java rename to src/main/java/com/sekwah/advancedportals/data/DataStorage.java index 6a90a86b..c63fb70d 100644 --- a/src/main/java/com/sekwah/advancedportals/core/data/DataStorage.java +++ b/src/main/java/com/sekwah/advancedportals/data/DataStorage.java @@ -1,4 +1,4 @@ -package com.sekwah.advancedportals.core.data; +package com.sekwah.advancedportals.data; import com.google.gson.Gson; import com.google.gson.GsonBuilder; diff --git a/src/main/java/com/sekwah/advancedportals/repository/DestinationRepository.java b/src/main/java/com/sekwah/advancedportals/repository/DestinationRepository.java new file mode 100644 index 00000000..cb1c6221 --- /dev/null +++ b/src/main/java/com/sekwah/advancedportals/repository/DestinationRepository.java @@ -0,0 +1,6 @@ +package com.sekwah.advancedportals.repository; + +import com.sekwah.advancedportals.api.destination.Destination; + +public interface DestinationRepository extends JsonRepository { +} diff --git a/src/main/java/com/sekwah/advancedportals/repository/DestinationRepositoryImpl.java b/src/main/java/com/sekwah/advancedportals/repository/DestinationRepositoryImpl.java new file mode 100644 index 00000000..fb6f7d75 --- /dev/null +++ b/src/main/java/com/sekwah/advancedportals/repository/DestinationRepositoryImpl.java @@ -0,0 +1,60 @@ +package com.sekwah.advancedportals.repository; + +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; +import com.google.common.collect.ImmutableMap; +import com.sekwah.advancedportals.api.destination.Destination; +import it.unimi.dsi.fastutil.Hash; + +import javax.inject.Singleton; +import java.io.FileWriter; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; + +@Singleton +public class DestinationRepositoryImpl implements DestinationRepository{ + private final String fileLocation = ""; + + private Map destinationCache = new HashMap(); + + /*Is there any reason to load it into the array if it's not been used or connected? Q for Sekwah*/ + public void AddDestination(String name, Destination destination) throws IOException { + gson.toJson(destination, new FileWriter(fileLocation + name + ".json")); + } + + private void test() { + destinationCache.get(""); + } + + @Override + public boolean save(String name, Destination destination) { + return false; + } + + public boolean containsKey(String name) { + return Files.exists(Paths.get(fileLocation + "\\" + name + ".json")); + } + + @Override + public boolean delete(String name) { + try { + Files.deleteIfExists(Paths.get(fileLocation + "\\" + name + ".json")); + } catch (IOException e) { + e.printStackTrace(); + } + return false; + } + + @Override + public boolean update(String name, Destination destination) { + return false; + } + + public ImmutableMap get(String s) { + } +} diff --git a/src/main/java/com/sekwah/advancedportals/core/repository/DestinationRepositoryImpl.java b/src/main/java/com/sekwah/advancedportals/repository/DestinationRepositoryImpl2.java similarity index 84% rename from src/main/java/com/sekwah/advancedportals/core/repository/DestinationRepositoryImpl.java rename to src/main/java/com/sekwah/advancedportals/repository/DestinationRepositoryImpl2.java index 756c0a89..9d190435 100644 --- a/src/main/java/com/sekwah/advancedportals/core/repository/DestinationRepositoryImpl.java +++ b/src/main/java/com/sekwah/advancedportals/repository/DestinationRepositoryImpl2.java @@ -1,14 +1,16 @@ -package com.sekwah.advancedportals.core.repository; +package com.sekwah.advancedportals.repository; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; import com.google.common.collect.ImmutableMap; import com.google.gson.reflect.TypeToken; import com.google.inject.Inject; import com.google.inject.Singleton; +import com.sekwah.advancedportals.DataTag; +import com.sekwah.advancedportals.PlayerLocation; import com.sekwah.advancedportals.core.AdvancedPortalsCore; -import com.sekwah.advancedportals.core.api.destination.Destination; -import com.sekwah.advancedportals.core.api.warphandler.TagHandler; -import com.sekwah.advancedportals.core.entities.DataTag; -import com.sekwah.advancedportals.core.entities.PlayerLocation; +import com.sekwah.advancedportals.api.destination.Destination; +import com.sekwah.advancedportals.api.warphandler.TagHandler; import com.sekwah.advancedportals.core.util.Lang; import com.sekwah.advancedportals.coreconnector.container.PlayerContainer; @@ -18,13 +20,14 @@ import java.util.HashMap; import java.util.Map; @Singleton -public class DestinationRepositoryImpl implements DestinationRepository { - private Map destiHashMap = new HashMap<>(); +@Deprecated +public class DestinationRepositoryImpl2 implements DestinationRepositoryOld { + @Inject private AdvancedPortalsCore portalsCore; - @Override + public void create(String name, Destination destination) { destiHashMap.put(name, destination); } diff --git a/src/main/java/com/sekwah/advancedportals/core/repository/DestinationRepository.java b/src/main/java/com/sekwah/advancedportals/repository/DestinationRepositoryOld.java similarity index 57% rename from src/main/java/com/sekwah/advancedportals/core/repository/DestinationRepository.java rename to src/main/java/com/sekwah/advancedportals/repository/DestinationRepositoryOld.java index ed0ff286..b9cb3872 100644 --- a/src/main/java/com/sekwah/advancedportals/core/repository/DestinationRepository.java +++ b/src/main/java/com/sekwah/advancedportals/repository/DestinationRepositoryOld.java @@ -1,9 +1,10 @@ -package com.sekwah.advancedportals.core.repository; +package com.sekwah.advancedportals.repository; import com.google.common.collect.ImmutableMap; -import com.sekwah.advancedportals.core.api.destination.Destination; +import com.sekwah.advancedportals.api.destination.Destination; -public interface DestinationRepository { +@Deprecated +public interface DestinationRepositoryOld { void create(String name, Destination destination); void delete(String name); diff --git a/src/main/java/com/sekwah/advancedportals/repository/JsonRepository.java b/src/main/java/com/sekwah/advancedportals/repository/JsonRepository.java new file mode 100644 index 00000000..295b42cd --- /dev/null +++ b/src/main/java/com/sekwah/advancedportals/repository/JsonRepository.java @@ -0,0 +1,14 @@ +package com.sekwah.advancedportals.repository; + +import com.google.gson.Gson; + +public interface JsonRepository { + Gson gson = new Gson(); + public boolean save(String name, T t); + + public boolean containsKey(String name); + + public boolean delete(String name); + + public boolean update(String name, T t); +} diff --git a/src/main/java/com/sekwah/advancedportals/repository/PortalRepository.java b/src/main/java/com/sekwah/advancedportals/repository/PortalRepository.java new file mode 100644 index 00000000..59c33f78 --- /dev/null +++ b/src/main/java/com/sekwah/advancedportals/repository/PortalRepository.java @@ -0,0 +1,7 @@ +package com.sekwah.advancedportals.repository; + +import com.sekwah.advancedportals.PortalLocation; + +public interface PortalRepository extends JsonRepository { + +} diff --git a/src/main/java/com/sekwah/advancedportals/repository/PortalRepositoryImpl.java b/src/main/java/com/sekwah/advancedportals/repository/PortalRepositoryImpl.java new file mode 100644 index 00000000..af656f51 --- /dev/null +++ b/src/main/java/com/sekwah/advancedportals/repository/PortalRepositoryImpl.java @@ -0,0 +1,33 @@ +package com.sekwah.advancedportals.repository; + +import com.google.common.cache.Cache; +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.LoadingCache; +import com.google.inject.Singleton; +import com.sekwah.advancedportals.PlayerLocation; +import com.sekwah.advancedportals.PortalLocation; +import com.sekwah.advancedportals.coreconnector.container.PlayerContainer; + +import java.util.UUID; +import java.util.concurrent.TimeUnit; + +@Singleton +public class PortalRepositoryImpl implements PortalRepository { + Cache selectedPortal = CacheBuilder.newBuilder() + .concurrencyLevel(4) + .expireAfterAccess(30, TimeUnit.DAYS) + .build(); + + public String getSelectedPortal(UUID uuid) { + return selectedPortal.getIfPresent(uuid); + } + @Override + public boolean delete(String name) { + return false; + } + + @Override + public boolean update(String name, PortalLocation portalLocation) { + return false; + } +} diff --git a/src/main/java/com/sekwah/advancedportals/core/repository/PortalTempDataRepository.java b/src/main/java/com/sekwah/advancedportals/repository/PortalTempDataRepository.java similarity index 76% rename from src/main/java/com/sekwah/advancedportals/core/repository/PortalTempDataRepository.java rename to src/main/java/com/sekwah/advancedportals/repository/PortalTempDataRepository.java index 7c7bf967..53962c7c 100644 --- a/src/main/java/com/sekwah/advancedportals/core/repository/PortalTempDataRepository.java +++ b/src/main/java/com/sekwah/advancedportals/repository/PortalTempDataRepository.java @@ -1,7 +1,7 @@ -package com.sekwah.advancedportals.core.repository; +package com.sekwah.advancedportals.repository; -import com.sekwah.advancedportals.core.entities.PlayerLocation; -import com.sekwah.advancedportals.core.entities.PortalLocation; +import com.sekwah.advancedportals.PlayerLocation; +import com.sekwah.advancedportals.PortalLocation; import com.sekwah.advancedportals.coreconnector.container.PlayerContainer; import java.util.UUID; diff --git a/src/main/java/com/sekwah/advancedportals/core/repository/PortalTempDataRepositoryImpl.java b/src/main/java/com/sekwah/advancedportals/repository/PortalTempDataRepositoryImpl.java similarity index 90% rename from src/main/java/com/sekwah/advancedportals/core/repository/PortalTempDataRepositoryImpl.java rename to src/main/java/com/sekwah/advancedportals/repository/PortalTempDataRepositoryImpl.java index a8280b9c..849ecf26 100644 --- a/src/main/java/com/sekwah/advancedportals/core/repository/PortalTempDataRepositoryImpl.java +++ b/src/main/java/com/sekwah/advancedportals/repository/PortalTempDataRepositoryImpl.java @@ -1,18 +1,19 @@ -package com.sekwah.advancedportals.core.repository; +package com.sekwah.advancedportals.repository; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; import com.google.common.collect.HashBasedTable; import com.google.common.collect.Table; import com.google.inject.Singleton; -import com.sekwah.advancedportals.core.entities.PlayerLocation; -import com.sekwah.advancedportals.core.entities.PortalLocation; +import com.sekwah.advancedportals.PlayerLocation; +import com.sekwah.advancedportals.PortalLocation; import com.sekwah.advancedportals.coreconnector.container.PlayerContainer; import java.util.UUID; import java.util.concurrent.TimeUnit; @Singleton +@Deprecated public class PortalTempDataRepositoryImpl implements PortalTempDataRepository { Cache selectedPortal = CacheBuilder.newBuilder() .concurrencyLevel(4) diff --git a/src/main/java/com/sekwah/advancedportals/services/DestinationServices.java b/src/main/java/com/sekwah/advancedportals/services/DestinationServices.java new file mode 100644 index 00000000..8108e4eb --- /dev/null +++ b/src/main/java/com/sekwah/advancedportals/services/DestinationServices.java @@ -0,0 +1,109 @@ +package com.sekwah.advancedportals.services; + + +import com.google.common.collect.ImmutableMap; +import com.google.gson.reflect.TypeToken; +import com.sekwah.advancedportals.DataTag; +import com.sekwah.advancedportals.PlayerLocation; +import com.sekwah.advancedportals.api.destination.Destination; +import com.sekwah.advancedportals.api.warphandler.TagHandler; +import com.sekwah.advancedportals.core.AdvancedPortalsCore; +import com.sekwah.advancedportals.core.util.Lang; +import com.sekwah.advancedportals.coreconnector.container.PlayerContainer; +import com.sekwah.advancedportals.repository.DestinationRepositoryImpl; +import org.apache.log4j.Logger; + +import javax.inject.Inject; +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; + +/** + * Handles logic for all destination, this is a transient layer so it should + * not store any information. + */ +public class DestinationServices { + + DestinationRepositoryImpl destinationRepository; + Logger logger; + + @Inject + private DestinationServices(DestinationRepositoryImpl destinationRepository, Logger logger) { + this.destinationRepository = destinationRepository; + this.logger = logger; + } + + public Response create(String name, Destination destination) { + if (!destinationRepository.containsKey(name)) { + destinationRepository.save(name, destination); + return Response.SUCCESS; + } + return Response.NAME_IN_USE; + } + + public Boolean delete(String name) { + if (!destinationRepository.containsKey(name)) { + destinationRepository.delete(name); + } + return false; + } + + public ImmutableMap getDestination() { + return destinationRepository.get(""); + } + + public ImmutableMap getDestinations() { + return ImmutableMap.copyOf(destinationRepository.get("")); + } + + + + + public Destination createDesti(String name, PlayerContainer player, PlayerLocation playerLocation, ArrayList tags) { + // TODO change to write messages + if(name == null || name.equals("")) { + player.sendMessage(Lang.translateColor("messageprefix.positive") + Lang.translate("desti.error.noname")); + return null; + } + else if(this.destinationRepository.containsKey(name)) { + player.sendMessage(Lang.translateColor("messageprefix.positive") + Lang.translate("desti.error.takenname")); + return null; + } + + Destination desti = new Destination(playerLocation); + for(DataTag portalTag : tags) { + desti.setArg(portalTag); + logger.warn("Derp A Derp"); + } + for(DataTag destiTag : tags) { + TagHandler.Creation creation = AdvancedPortalsCore.getDestinationTagRegistry().getCreationHandler(destiTag.NAME); + if(creation != null) { + creation.created(desti, player, destiTag.VALUE); + } + } + try { + this.destinationRepository.AddDestination(name, desti); + } catch (IOException e) { + e.printStackTrace(); + } + this.saveDestinations(); + return desti; + } + + //TODO Change to repository + + public void loadDestinations() { + Type type = new TypeToken>() { + }.getType(); + this.destiHashMap = this.portalsCore.getDataStorage().loadJson(type, "destinations.json"); + this.saveDestinations(); + } + + public void saveDestinations() { + if (this.destiHashMap == null) { + this.destiHashMap = new HashMap<>(); + } + this.portalsCore.getDataStorage().storeJson(this.destiHashMap, "destinations.json"); + } +} diff --git a/src/main/java/com/sekwah/advancedportals/services/PortalServices.java b/src/main/java/com/sekwah/advancedportals/services/PortalServices.java new file mode 100644 index 00000000..b614a57a --- /dev/null +++ b/src/main/java/com/sekwah/advancedportals/services/PortalServices.java @@ -0,0 +1,52 @@ +package com.sekwah.advancedportals.services; + +import com.google.inject.Inject; +import com.sekwah.advancedportals.PlayerLocation; +import com.sekwah.advancedportals.PortalLocation; +import com.sekwah.advancedportals.coreconnector.container.PlayerContainer; +import com.sekwah.advancedportals.repository.PortalRepository; + +import java.util.UUID; + +public class PortalServices { + + private final PortalRepository portalRepository; + + @Inject + public PortalServices(PortalRepository portalRepository) { + this.portalRepository = portalRepository; + } + + public void addSelectedPortal(UUID selectedPlayer, String portal) { + //portalRepository.save(selectedPlayer, portal); + } + + public void removeSelectedPortal(UUID uuid) { + selectedPortal.invalidate(uuid); + } + + public void addSelectedPosition(UUID uuid, boolean isPos1, PortalLocation portalLocation) { + selectedPositions.put(uuid, isPos1, portalLocation); + } + + public void removeSelectedPosition(UUID uuid, boolean isPos1) { + selectedPositions.remove(uuid, isPos1); + } + + public void removeAllSelectedHand(UUID uuid) { + selectedPositions.remove(uuid, true); + selectedPositions.remove(uuid, false); + } + + public void activateCooldown(PlayerContainer player) { + + } + + public void playerLeave(PlayerContainer player) { + + } + + public boolean inPortalRegion(PlayerLocation loc) { + return false; + } +} diff --git a/src/main/java/com/sekwah/advancedportals/services/Response.java b/src/main/java/com/sekwah/advancedportals/services/Response.java new file mode 100644 index 00000000..95841cb3 --- /dev/null +++ b/src/main/java/com/sekwah/advancedportals/services/Response.java @@ -0,0 +1,7 @@ +package com.sekwah.advancedportals.services; + +public enum Response { + SUCCESS, + NAME_IN_USE, + +} diff --git a/src/main/java/com/sekwah/advancedportals/spigot/convertolddata/ConvertOldSubCommand.java b/src/main/java/com/sekwah/advancedportals/spigot/convertolddata/ConvertOldSubCommand.java index 89f9499b..cab6a096 100644 --- a/src/main/java/com/sekwah/advancedportals/spigot/convertolddata/ConvertOldSubCommand.java +++ b/src/main/java/com/sekwah/advancedportals/spigot/convertolddata/ConvertOldSubCommand.java @@ -1,6 +1,6 @@ package com.sekwah.advancedportals.spigot.convertolddata; -import com.sekwah.advancedportals.core.api.commands.SubCommand; +import com.sekwah.advancedportals.api.commands.SubCommand; import com.sekwah.advancedportals.core.util.Lang; import com.sekwah.advancedportals.coreconnector.container.CommandSenderContainer; diff --git a/src/main/java/com/sekwah/advancedportals/spigot/coreconnector/command/SpigotCommandHandler.java b/src/main/java/com/sekwah/advancedportals/spigot/coreconnector/command/SpigotCommandHandler.java index 6ab1ca5e..a1754a31 100644 --- a/src/main/java/com/sekwah/advancedportals/spigot/coreconnector/command/SpigotCommandHandler.java +++ b/src/main/java/com/sekwah/advancedportals/spigot/coreconnector/command/SpigotCommandHandler.java @@ -1,7 +1,6 @@ package com.sekwah.advancedportals.spigot.coreconnector.command; -import com.sekwah.advancedportals.core.commands.CommandTemplate; -import com.sekwah.advancedportals.coreconnector.command.CommandHandler; +import com.sekwah.advancedportals.commands.CommandTemplate; import com.sekwah.advancedportals.spigot.coreconnector.container.SpigotCommandSenderContainer; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; diff --git a/src/main/java/com/sekwah/advancedportals/spigot/coreconnector/command/SpigotCommandRegister.java b/src/main/java/com/sekwah/advancedportals/spigot/coreconnector/command/SpigotCommandRegister.java index e281451f..e1d31aca 100644 --- a/src/main/java/com/sekwah/advancedportals/spigot/coreconnector/command/SpigotCommandRegister.java +++ b/src/main/java/com/sekwah/advancedportals/spigot/coreconnector/command/SpigotCommandRegister.java @@ -1,6 +1,6 @@ package com.sekwah.advancedportals.spigot.coreconnector.command; -import com.sekwah.advancedportals.core.commands.CommandTemplate; +import com.sekwah.advancedportals.commands.CommandTemplate; import com.sekwah.advancedportals.coreconnector.command.CommandRegister; import com.sekwah.advancedportals.spigot.AdvancedPortalsPlugin; diff --git a/src/main/java/com/sekwah/advancedportals/spigot/coreconnector/container/SpigotPlayerContainer.java b/src/main/java/com/sekwah/advancedportals/spigot/coreconnector/container/SpigotPlayerContainer.java index fbfe8b81..db03f1a6 100644 --- a/src/main/java/com/sekwah/advancedportals/spigot/coreconnector/container/SpigotPlayerContainer.java +++ b/src/main/java/com/sekwah/advancedportals/spigot/coreconnector/container/SpigotPlayerContainer.java @@ -2,8 +2,8 @@ package com.sekwah.advancedportals.spigot.coreconnector.container; import com.google.inject.Inject; import com.sekwah.advancedportals.core.AdvancedPortalsCore; -import com.sekwah.advancedportals.core.entities.PlayerLocation; -import com.sekwah.advancedportals.core.entities.PortalLocation; +import com.sekwah.advancedportals.PlayerLocation; +import com.sekwah.advancedportals.PortalLocation; import com.sekwah.advancedportals.coreconnector.container.PlayerContainer; import com.sekwah.advancedportals.coreconnector.container.WorldContainer; import org.bukkit.Bukkit; diff --git a/src/main/java/com/sekwah/advancedportals/spigot/coreconnector/container/SpigotWorldContainer.java b/src/main/java/com/sekwah/advancedportals/spigot/coreconnector/container/SpigotWorldContainer.java index cca7b55d..2250ea97 100644 --- a/src/main/java/com/sekwah/advancedportals/spigot/coreconnector/container/SpigotWorldContainer.java +++ b/src/main/java/com/sekwah/advancedportals/spigot/coreconnector/container/SpigotWorldContainer.java @@ -1,6 +1,6 @@ package com.sekwah.advancedportals.spigot.coreconnector.container; -import com.sekwah.advancedportals.core.entities.PortalLocation; +import com.sekwah.advancedportals.PortalLocation; import com.sekwah.advancedportals.coreconnector.container.WorldContainer; import org.bukkit.Material; import org.bukkit.World; diff --git a/src/main/java/com/sekwah/advancedportals/spigot/effect/WarpEffectEnder.java b/src/main/java/com/sekwah/advancedportals/spigot/effect/WarpEffectEnder.java index d6b03471..9f3ad695 100644 --- a/src/main/java/com/sekwah/advancedportals/spigot/effect/WarpEffectEnder.java +++ b/src/main/java/com/sekwah/advancedportals/spigot/effect/WarpEffectEnder.java @@ -1,8 +1,8 @@ package com.sekwah.advancedportals.spigot.effect; -import com.sekwah.advancedportals.core.api.effect.WarpEffect; -import com.sekwah.advancedportals.core.api.portal.AdvancedPortal; -import com.sekwah.advancedportals.core.entities.PortalLocation; +import com.sekwah.advancedportals.api.effect.WarpEffect; +import com.sekwah.advancedportals.api.portal.AdvancedPortal; +import com.sekwah.advancedportals.PortalLocation; import com.sekwah.advancedportals.coreconnector.container.PlayerContainer; public class WarpEffectEnder extends WarpEffect {