diff --git a/src/main/java/com/sekwah/advancedportals/core/AdvancedPortalsCore.java b/src/main/java/com/sekwah/advancedportals/core/AdvancedPortalsCore.java index 6a1cf6d1..5c4aaa3d 100644 --- a/src/main/java/com/sekwah/advancedportals/core/AdvancedPortalsCore.java +++ b/src/main/java/com/sekwah/advancedportals/core/AdvancedPortalsCore.java @@ -9,8 +9,6 @@ import com.sekwah.advancedportals.core.api.services.PortalServices; import com.sekwah.advancedportals.core.api.services.PortalTempDataServices; import com.sekwah.advancedportals.core.config.RepositoryModule; import com.sekwah.advancedportals.core.repository.ConfigRepository; -import com.sekwah.advancedportals.core.repository.DestinationRepositoryImpl; -import com.sekwah.advancedportals.core.repository.PortalRepositoryImpl; import com.sekwah.advancedportals.core.api.portal.AdvancedPortal; import com.sekwah.advancedportals.core.api.registry.TagRegistry; import com.sekwah.advancedportals.core.api.registry.WarpEffectRegistry; @@ -26,6 +24,7 @@ import com.sekwah.advancedportals.coreconnector.command.CommandRegister; public class AdvancedPortalsCore { private static AdvancedPortalsCore instance; + private final CommandRegister commandRegister; private final DataStorage dataStorage; private final InfoLogger infoLogger; @@ -118,6 +117,7 @@ public class AdvancedPortalsCore { this.dataStorage.copyDefaultFile("lang/en_GB.lang", false); this.loadPortalConfig(); + Lang.loadLanguage(configRepository.getTranslation()); this.registerPortalCommand(); @@ -190,16 +190,16 @@ public class AdvancedPortalsCore { return this.dataStorage; } - public static InfoLogger getInfoLogger() { - return instance.infoLogger; + public InfoLogger getInfoLogger() { + return this.infoLogger; } - public static ConnectorDataCollector getDataCollector() { - return instance.dataCollector; + public ConnectorDataCollector getDataCollector() { + return this.dataCollector; } - public static CoreListeners getCoreListeners() { - return instance.coreListeners; + public CoreListeners getCoreListeners() { + return this.coreListeners; } public static PortalServices getPortalServices() { @@ -210,7 +210,7 @@ public class AdvancedPortalsCore { return instance.destiServices; } - public static PortalTempDataServices getPortalTempDataServices() { + public PortalTempDataServices getPortalTempDataServices() { return instance.portalTempDataServices; } diff --git a/src/main/java/com/sekwah/advancedportals/core/api/services/PortalServices.java b/src/main/java/com/sekwah/advancedportals/core/api/services/PortalServices.java index 43da30f5..322569d4 100644 --- a/src/main/java/com/sekwah/advancedportals/core/api/services/PortalServices.java +++ b/src/main/java/com/sekwah/advancedportals/core/api/services/PortalServices.java @@ -42,4 +42,8 @@ public final class PortalServices { public AdvancedPortal createPortal(String name, PlayerContainer player, ArrayList portalTags) throws PortalException { return null; } + + public void removePlayerSelection(PlayerContainer player) throws PortalException { + + } } diff --git a/src/main/java/com/sekwah/advancedportals/core/api/services/PortalTempDataServices.java b/src/main/java/com/sekwah/advancedportals/core/api/services/PortalTempDataServices.java index cd8e9a5b..a7394859 100644 --- a/src/main/java/com/sekwah/advancedportals/core/api/services/PortalTempDataServices.java +++ b/src/main/java/com/sekwah/advancedportals/core/api/services/PortalTempDataServices.java @@ -1,11 +1,20 @@ package com.sekwah.advancedportals.core.api.services; -import com.sekwah.advancedportals.core.AdvancedPortalsCore; import com.sekwah.advancedportals.core.api.portal.PortalException; +import com.sekwah.advancedportals.core.entities.PlayerTempData; import com.sekwah.advancedportals.core.entities.PortalLocation; import com.sekwah.advancedportals.coreconnector.container.PlayerContainer; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + public final class PortalTempDataServices { + + /** + * Possibly change to the cache map Aztec was talking about + */ + private Map tempDataMap = new HashMap<>(); public void activateCooldown(PlayerContainer player) { } @@ -16,8 +25,4 @@ public final class PortalTempDataServices { public void playerSelectorActivate(PlayerContainer player, PortalLocation blockLoc, boolean leftClick) { } - - public void removePlayerSelection(PlayerContainer player) throws PortalException { - - } } diff --git a/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/RemoveSubCommand.java b/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/RemoveSubCommand.java index 1ee34eaa..0d0c1ab1 100644 --- a/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/RemoveSubCommand.java +++ b/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/RemoveSubCommand.java @@ -33,7 +33,7 @@ public class RemoveSubCommand implements SubCommand { } else { try { - AdvancedPortalsCore.getPortalTempDataServices().removePlayerSelection(player); + AdvancedPortalsCore.getPortalServices().removePlayerSelection(player); } catch (PortalException portalTagExeption) { sender.sendMessage(Lang.translateColor("messageprefix.negative") + Lang.translateColor("command.remove.error") + " " + Lang.translate(portalTagExeption.getMessage())); diff --git a/src/main/java/com/sekwah/advancedportals/core/entities/PlayerTempData.java b/src/main/java/com/sekwah/advancedportals/core/entities/PlayerTempData.java new file mode 100644 index 00000000..8d9c3816 --- /dev/null +++ b/src/main/java/com/sekwah/advancedportals/core/entities/PlayerTempData.java @@ -0,0 +1,13 @@ +package com.sekwah.advancedportals.core.entities; + +public class PlayerTempData { + + private PortalLocation pos1; + + private PortalLocation pos2; + + private long lastAttempt; + + private String selectedPortal; + +}