From ad1ef6cc40adbae075d7a875e9c9c749c2540963 Mon Sep 17 00:00:00 2001 From: Sekwah Date: Sun, 14 May 2023 21:31:17 +0100 Subject: [PATCH] feat: portal block placing checks surrounding blocks for orientation Also moved data to be serializeddata --- .../core/AdvancedPortalsCore.java | 2 +- .../advancedportals/core/CoreListeners.java | 16 +++++++++----- .../desti/CreateDestiSubCommand.java | 2 +- .../portal/CreatePortalSubCommand.java | 2 +- .../connector/containers/PlayerContainer.java | 4 ++-- .../connector/containers/WorldContainer.java | 4 ++-- .../core/connector/data/BlockAxis.java | 7 ------ .../advancedportals/core/data/BlockAxis.java | 7 ++++++ .../advancedportals/core/data/Direction.java | 22 +++++++++++++++++++ .../core/destination/Destination.java | 5 ++--- .../core/effect/WarpEffect.java | 2 +- .../core/module/AdvancedPortalsModule.java | 2 +- .../core/portal/AdvancedPortal.java | 6 ++--- .../core/repository/ConfigRepository.java | 2 +- .../core/repository/IPortalRepository.java | 2 +- .../repository/IPortalTempDataRepository.java | 4 ++-- .../repository/impl/ConfigRepositoryImpl.java | 2 +- .../repository/impl/PortalRepositoryImpl.java | 2 +- .../BlockLocation.java | 11 +++++++++- .../{data => serializeddata}/DataStorage.java | 2 +- .../{data => serializeddata}/DataTag.java | 2 +- .../PlayerLocation.java | 2 +- .../PlayerTempData.java | 2 +- .../WorldLocation.java | 2 +- .../core/services/DestinationServices.java | 4 ++-- .../core/services/PortalServices.java | 4 ++-- .../core/services/PortalTempDataServices.java | 4 ++-- .../advancedportals/core/util/Lang.java | 2 +- .../advancedportals/core/util/TagReader.java | 2 +- .../core/warphandler/ActivationData.java | 2 +- .../container/SpigotPlayerContainer.java | 6 ++--- .../container/SpigotWorldContainer.java | 5 ++--- 32 files changed, 87 insertions(+), 56 deletions(-) delete mode 100644 core/src/main/java/com/sekwah/advancedportals/core/connector/data/BlockAxis.java create mode 100644 core/src/main/java/com/sekwah/advancedportals/core/data/BlockAxis.java create mode 100644 core/src/main/java/com/sekwah/advancedportals/core/data/Direction.java rename core/src/main/java/com/sekwah/advancedportals/core/{data => serializeddata}/BlockLocation.java (56%) rename core/src/main/java/com/sekwah/advancedportals/core/{data => serializeddata}/DataStorage.java (99%) rename core/src/main/java/com/sekwah/advancedportals/core/{data => serializeddata}/DataTag.java (78%) rename core/src/main/java/com/sekwah/advancedportals/core/{data => serializeddata}/PlayerLocation.java (94%) rename core/src/main/java/com/sekwah/advancedportals/core/{data => serializeddata}/PlayerTempData.java (93%) rename core/src/main/java/com/sekwah/advancedportals/core/{data => serializeddata}/WorldLocation.java (90%) diff --git a/core/src/main/java/com/sekwah/advancedportals/core/AdvancedPortalsCore.java b/core/src/main/java/com/sekwah/advancedportals/core/AdvancedPortalsCore.java index e6ebea9e..e7267977 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/AdvancedPortalsCore.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/AdvancedPortalsCore.java @@ -6,7 +6,7 @@ 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.connector.commands.CommandRegister; -import com.sekwah.advancedportals.core.data.DataStorage; +import com.sekwah.advancedportals.core.serializeddata.DataStorage; import com.sekwah.advancedportals.core.module.AdvancedPortalsModule; import com.sekwah.advancedportals.core.repository.ConfigRepository; import com.sekwah.advancedportals.core.util.InfoLogger; diff --git a/core/src/main/java/com/sekwah/advancedportals/core/CoreListeners.java b/core/src/main/java/com/sekwah/advancedportals/core/CoreListeners.java index 4e0e6247..c4f6a248 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/CoreListeners.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/CoreListeners.java @@ -3,9 +3,10 @@ package com.sekwah.advancedportals.core; import com.google.inject.Inject; import com.sekwah.advancedportals.core.connector.containers.PlayerContainer; import com.sekwah.advancedportals.core.connector.containers.WorldContainer; -import com.sekwah.advancedportals.core.connector.data.BlockAxis; -import com.sekwah.advancedportals.core.data.BlockLocation; -import com.sekwah.advancedportals.core.data.PlayerLocation; +import com.sekwah.advancedportals.core.data.BlockAxis; +import com.sekwah.advancedportals.core.data.Direction; +import com.sekwah.advancedportals.core.serializeddata.BlockLocation; +import com.sekwah.advancedportals.core.serializeddata.PlayerLocation; import com.sekwah.advancedportals.core.permissions.PortalPermissions; import com.sekwah.advancedportals.core.repository.ConfigRepository; import com.sekwah.advancedportals.core.services.PortalServices; @@ -81,11 +82,17 @@ public class CoreListeners { * @return if the block is allowed to be placed */ public boolean blockPlace(PlayerContainer player, BlockLocation blockPos, String blockMaterial, String itemInHandMaterial, String itemInHandName) { - System.out.println("Block placed: " + blockMaterial + " " + itemInHandMaterial + " " + itemInHandName); if(itemInHandName != null && player != null && PortalPermissions.BUILD.hasPermission(player)) { WorldContainer world = player.getWorld(); if(itemInHandName.equals("\u00A75Portal Block Placer")) { world.setBlock(blockPos, "NETHER_PORTAL"); + for (Direction direction : Direction.values()) { + var checkLoc = new BlockLocation(blockPos, direction); + if (world.getBlock(checkLoc).equals("NETHER_PORTAL")) { + world.setBlockAxis(blockPos, world.getBlockAxis(checkLoc)); + break; + } + } return false; } else if(itemInHandName.equals("\u00A78End Portal Block Placer")) { @@ -118,7 +125,6 @@ public class CoreListeners { */ public boolean playerInteractWithBlock(PlayerContainer player, String blockMaterialname, String itemMaterialName, String itemName, BlockLocation blockLoc, boolean leftClick) { - System.out.println(blockMaterialname); if(itemName != null && (player.isOp() || PortalPermissions.CREATE_PORTAL.hasPermission(player)) && itemMaterialName.equalsIgnoreCase(this.configRepository.getSelectorMaterial()) && (!this.configRepository.getUseOnlySpecialAxe() || itemName.equals("\u00A7ePortal Region Selector"))) { diff --git a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/desti/CreateDestiSubCommand.java b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/desti/CreateDestiSubCommand.java index 6ec4d474..47d112bc 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/desti/CreateDestiSubCommand.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/desti/CreateDestiSubCommand.java @@ -3,7 +3,7 @@ package com.sekwah.advancedportals.core.commands.subcommands.desti; import com.sekwah.advancedportals.core.commands.SubCommand; import com.sekwah.advancedportals.core.connector.containers.CommandSenderContainer; import com.sekwah.advancedportals.core.connector.containers.PlayerContainer; -import com.sekwah.advancedportals.core.data.DataTag; +import com.sekwah.advancedportals.core.serializeddata.DataTag; import com.sekwah.advancedportals.core.permissions.PortalPermissions; import com.sekwah.advancedportals.core.util.Lang; import com.sekwah.advancedportals.core.util.TagReader; diff --git a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/CreatePortalSubCommand.java b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/CreatePortalSubCommand.java index 0f05bcfd..1737b1af 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/CreatePortalSubCommand.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/CreatePortalSubCommand.java @@ -4,7 +4,7 @@ import com.google.inject.Inject; import com.sekwah.advancedportals.core.commands.SubCommand; import com.sekwah.advancedportals.core.connector.containers.CommandSenderContainer; import com.sekwah.advancedportals.core.connector.containers.PlayerContainer; -import com.sekwah.advancedportals.core.data.DataTag; +import com.sekwah.advancedportals.core.serializeddata.DataTag; import com.sekwah.advancedportals.core.permissions.PortalPermissions; import com.sekwah.advancedportals.core.portal.AdvancedPortal; import com.sekwah.advancedportals.core.services.PortalServices; diff --git a/core/src/main/java/com/sekwah/advancedportals/core/connector/containers/PlayerContainer.java b/core/src/main/java/com/sekwah/advancedportals/core/connector/containers/PlayerContainer.java index 838e10a0..4b3d5b2e 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/connector/containers/PlayerContainer.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/connector/containers/PlayerContainer.java @@ -1,7 +1,7 @@ package com.sekwah.advancedportals.core.connector.containers; -import com.sekwah.advancedportals.core.data.BlockLocation; -import com.sekwah.advancedportals.core.data.PlayerLocation; +import com.sekwah.advancedportals.core.serializeddata.BlockLocation; +import com.sekwah.advancedportals.core.serializeddata.PlayerLocation; import java.util.UUID; diff --git a/core/src/main/java/com/sekwah/advancedportals/core/connector/containers/WorldContainer.java b/core/src/main/java/com/sekwah/advancedportals/core/connector/containers/WorldContainer.java index fec51320..d1caf238 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/connector/containers/WorldContainer.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/connector/containers/WorldContainer.java @@ -1,7 +1,7 @@ package com.sekwah.advancedportals.core.connector.containers; -import com.sekwah.advancedportals.core.connector.data.BlockAxis; -import com.sekwah.advancedportals.core.data.BlockLocation; +import com.sekwah.advancedportals.core.data.BlockAxis; +import com.sekwah.advancedportals.core.serializeddata.BlockLocation; public interface WorldContainer { diff --git a/core/src/main/java/com/sekwah/advancedportals/core/connector/data/BlockAxis.java b/core/src/main/java/com/sekwah/advancedportals/core/connector/data/BlockAxis.java deleted file mode 100644 index eb976d62..00000000 --- a/core/src/main/java/com/sekwah/advancedportals/core/connector/data/BlockAxis.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.sekwah.advancedportals.core.connector.data; - -public enum BlockAxis { - X, - Y, - Z -} diff --git a/core/src/main/java/com/sekwah/advancedportals/core/data/BlockAxis.java b/core/src/main/java/com/sekwah/advancedportals/core/data/BlockAxis.java new file mode 100644 index 00000000..a0f28bb8 --- /dev/null +++ b/core/src/main/java/com/sekwah/advancedportals/core/data/BlockAxis.java @@ -0,0 +1,7 @@ +package com.sekwah.advancedportals.core.data; + +public enum BlockAxis { + X, + Y, + Z +} diff --git a/core/src/main/java/com/sekwah/advancedportals/core/data/Direction.java b/core/src/main/java/com/sekwah/advancedportals/core/data/Direction.java new file mode 100644 index 00000000..65b88dcd --- /dev/null +++ b/core/src/main/java/com/sekwah/advancedportals/core/data/Direction.java @@ -0,0 +1,22 @@ +package com.sekwah.advancedportals.core.data; + +public enum Direction { + + NORTH(0, 0, -1), + EAST(1, 0, 0), + SOUTH(0, 0, 1), + WEST(-1, 0, 0), + UP(0, 1, 0), + DOWN(0, -1, 0) + ; + + public final int x; + public final int y; + public final int z; + + Direction(int x, int y, int z) { + this.x = x; + this.y = y; + this.z = z; + } +} diff --git a/core/src/main/java/com/sekwah/advancedportals/core/destination/Destination.java b/core/src/main/java/com/sekwah/advancedportals/core/destination/Destination.java index 0428dc7d..0ec1ee86 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/destination/Destination.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/destination/Destination.java @@ -2,10 +2,9 @@ package com.sekwah.advancedportals.core.destination; import com.google.gson.annotations.SerializedName; import com.google.inject.Inject; -import com.sekwah.advancedportals.core.AdvancedPortalsCore; import com.sekwah.advancedportals.core.connector.containers.PlayerContainer; -import com.sekwah.advancedportals.core.data.DataTag; -import com.sekwah.advancedportals.core.data.PlayerLocation; +import com.sekwah.advancedportals.core.serializeddata.DataTag; +import com.sekwah.advancedportals.core.serializeddata.PlayerLocation; import com.sekwah.advancedportals.core.registry.TagRegistry; import com.sekwah.advancedportals.core.warphandler.ActivationData; import com.sekwah.advancedportals.core.warphandler.TagHandler; diff --git a/core/src/main/java/com/sekwah/advancedportals/core/effect/WarpEffect.java b/core/src/main/java/com/sekwah/advancedportals/core/effect/WarpEffect.java index 46af2ccc..395e32f2 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/effect/WarpEffect.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/effect/WarpEffect.java @@ -2,7 +2,7 @@ package com.sekwah.advancedportals.core.effect; import com.sekwah.advancedportals.core.connector.containers.PlayerContainer; -import com.sekwah.advancedportals.core.data.WorldLocation; +import com.sekwah.advancedportals.core.serializeddata.WorldLocation; import com.sekwah.advancedportals.core.portal.AdvancedPortal; /** diff --git a/core/src/main/java/com/sekwah/advancedportals/core/module/AdvancedPortalsModule.java b/core/src/main/java/com/sekwah/advancedportals/core/module/AdvancedPortalsModule.java index 57695143..6d387a43 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/module/AdvancedPortalsModule.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/module/AdvancedPortalsModule.java @@ -4,7 +4,7 @@ import com.google.inject.*; import com.sekwah.advancedportals.core.AdvancedPortalsCore; import com.sekwah.advancedportals.core.config.Config; import com.sekwah.advancedportals.core.config.ConfigProvider; -import com.sekwah.advancedportals.core.data.DataStorage; +import com.sekwah.advancedportals.core.serializeddata.DataStorage; import com.sekwah.advancedportals.core.repository.ConfigRepository; import com.sekwah.advancedportals.core.repository.IDestinationRepository; import com.sekwah.advancedportals.core.repository.IPortalRepository; diff --git a/core/src/main/java/com/sekwah/advancedportals/core/portal/AdvancedPortal.java b/core/src/main/java/com/sekwah/advancedportals/core/portal/AdvancedPortal.java index 667598aa..47f93c8f 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/portal/AdvancedPortal.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/portal/AdvancedPortal.java @@ -2,11 +2,9 @@ package com.sekwah.advancedportals.core.portal; import com.google.gson.annotations.SerializedName; import com.google.inject.Inject; -import com.sekwah.advancedportals.core.AdvancedPortalsCore; import com.sekwah.advancedportals.core.connector.containers.PlayerContainer; -import com.sekwah.advancedportals.core.data.DataTag; -import com.sekwah.advancedportals.core.data.WorldLocation; -import com.sekwah.advancedportals.core.destination.Destination; +import com.sekwah.advancedportals.core.serializeddata.DataTag; +import com.sekwah.advancedportals.core.serializeddata.WorldLocation; import com.sekwah.advancedportals.core.registry.TagRegistry; import com.sekwah.advancedportals.core.warphandler.ActivationData; import com.sekwah.advancedportals.core.warphandler.TagHandler; diff --git a/core/src/main/java/com/sekwah/advancedportals/core/repository/ConfigRepository.java b/core/src/main/java/com/sekwah/advancedportals/core/repository/ConfigRepository.java index e0bd28c1..6f4e00af 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/repository/ConfigRepository.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/repository/ConfigRepository.java @@ -1,6 +1,6 @@ package com.sekwah.advancedportals.core.repository; -import com.sekwah.advancedportals.core.data.DataStorage; +import com.sekwah.advancedportals.core.serializeddata.DataStorage; public interface ConfigRepository { diff --git a/core/src/main/java/com/sekwah/advancedportals/core/repository/IPortalRepository.java b/core/src/main/java/com/sekwah/advancedportals/core/repository/IPortalRepository.java index ca00e2a0..98701240 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/repository/IPortalRepository.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/repository/IPortalRepository.java @@ -1,6 +1,6 @@ package com.sekwah.advancedportals.core.repository; -import com.sekwah.advancedportals.core.data.WorldLocation; +import com.sekwah.advancedportals.core.serializeddata.WorldLocation; public interface IPortalRepository extends IJsonRepository { diff --git a/core/src/main/java/com/sekwah/advancedportals/core/repository/IPortalTempDataRepository.java b/core/src/main/java/com/sekwah/advancedportals/core/repository/IPortalTempDataRepository.java index 3f3343d2..e5df0fd9 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/repository/IPortalTempDataRepository.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/repository/IPortalTempDataRepository.java @@ -1,8 +1,8 @@ package com.sekwah.advancedportals.core.repository; import com.sekwah.advancedportals.core.connector.containers.PlayerContainer; -import com.sekwah.advancedportals.core.data.BlockLocation; -import com.sekwah.advancedportals.core.data.PlayerLocation; +import com.sekwah.advancedportals.core.serializeddata.BlockLocation; +import com.sekwah.advancedportals.core.serializeddata.PlayerLocation; import java.util.UUID; diff --git a/core/src/main/java/com/sekwah/advancedportals/core/repository/impl/ConfigRepositoryImpl.java b/core/src/main/java/com/sekwah/advancedportals/core/repository/impl/ConfigRepositoryImpl.java index 27ae372f..2a5c63b2 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/repository/impl/ConfigRepositoryImpl.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/repository/impl/ConfigRepositoryImpl.java @@ -2,7 +2,7 @@ package com.sekwah.advancedportals.core.repository.impl; import com.google.inject.Singleton; import com.sekwah.advancedportals.core.config.Config; -import com.sekwah.advancedportals.core.data.DataStorage; +import com.sekwah.advancedportals.core.serializeddata.DataStorage; import com.sekwah.advancedportals.core.repository.ConfigRepository; import java.util.HashMap; diff --git a/core/src/main/java/com/sekwah/advancedportals/core/repository/impl/PortalRepositoryImpl.java b/core/src/main/java/com/sekwah/advancedportals/core/repository/impl/PortalRepositoryImpl.java index 61a894e3..1a02f5ae 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/repository/impl/PortalRepositoryImpl.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/repository/impl/PortalRepositoryImpl.java @@ -2,7 +2,7 @@ package com.sekwah.advancedportals.core.repository.impl; import com.google.common.collect.ImmutableMap; import com.google.inject.Singleton; -import com.sekwah.advancedportals.core.data.WorldLocation; +import com.sekwah.advancedportals.core.serializeddata.WorldLocation; import com.sekwah.advancedportals.core.repository.IPortalRepository; import java.util.UUID; diff --git a/core/src/main/java/com/sekwah/advancedportals/core/data/BlockLocation.java b/core/src/main/java/com/sekwah/advancedportals/core/serializeddata/BlockLocation.java similarity index 56% rename from core/src/main/java/com/sekwah/advancedportals/core/data/BlockLocation.java rename to core/src/main/java/com/sekwah/advancedportals/core/serializeddata/BlockLocation.java index bd055100..2676ba7b 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/data/BlockLocation.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/serializeddata/BlockLocation.java @@ -1,6 +1,7 @@ -package com.sekwah.advancedportals.core.data; +package com.sekwah.advancedportals.core.serializeddata; import com.google.gson.annotations.SerializedName; +import com.sekwah.advancedportals.core.data.Direction; public class BlockLocation { @@ -22,4 +23,12 @@ public class BlockLocation { this.posY = posY; this.posZ = posZ; } + + public BlockLocation(BlockLocation location, Direction direction) { + this.worldName = location.worldName; + this.posX = location.posX + direction.x; + this.posY = location.posY + direction.y; + this.posZ = location.posZ + direction.z; + + } } diff --git a/core/src/main/java/com/sekwah/advancedportals/core/data/DataStorage.java b/core/src/main/java/com/sekwah/advancedportals/core/serializeddata/DataStorage.java similarity index 99% rename from core/src/main/java/com/sekwah/advancedportals/core/data/DataStorage.java rename to core/src/main/java/com/sekwah/advancedportals/core/serializeddata/DataStorage.java index 02f074b3..1d221283 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/data/DataStorage.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/serializeddata/DataStorage.java @@ -1,4 +1,4 @@ -package com.sekwah.advancedportals.core.data; +package com.sekwah.advancedportals.core.serializeddata; import com.google.gson.Gson; import com.google.gson.GsonBuilder; diff --git a/core/src/main/java/com/sekwah/advancedportals/core/data/DataTag.java b/core/src/main/java/com/sekwah/advancedportals/core/serializeddata/DataTag.java similarity index 78% rename from core/src/main/java/com/sekwah/advancedportals/core/data/DataTag.java rename to core/src/main/java/com/sekwah/advancedportals/core/serializeddata/DataTag.java index 6e55b31e..db1761fb 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/data/DataTag.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/serializeddata/DataTag.java @@ -1,4 +1,4 @@ -package com.sekwah.advancedportals.core.data; +package com.sekwah.advancedportals.core.serializeddata; public class DataTag { diff --git a/core/src/main/java/com/sekwah/advancedportals/core/data/PlayerLocation.java b/core/src/main/java/com/sekwah/advancedportals/core/serializeddata/PlayerLocation.java similarity index 94% rename from core/src/main/java/com/sekwah/advancedportals/core/data/PlayerLocation.java rename to core/src/main/java/com/sekwah/advancedportals/core/serializeddata/PlayerLocation.java index beeac98e..b1cdb306 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/data/PlayerLocation.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/serializeddata/PlayerLocation.java @@ -1,4 +1,4 @@ -package com.sekwah.advancedportals.core.data; +package com.sekwah.advancedportals.core.serializeddata; import com.google.gson.annotations.SerializedName; diff --git a/core/src/main/java/com/sekwah/advancedportals/core/data/PlayerTempData.java b/core/src/main/java/com/sekwah/advancedportals/core/serializeddata/PlayerTempData.java similarity index 93% rename from core/src/main/java/com/sekwah/advancedportals/core/data/PlayerTempData.java rename to core/src/main/java/com/sekwah/advancedportals/core/serializeddata/PlayerTempData.java index 0f522c2e..fdb7c048 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/data/PlayerTempData.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/serializeddata/PlayerTempData.java @@ -1,4 +1,4 @@ -package com.sekwah.advancedportals.core.data; +package com.sekwah.advancedportals.core.serializeddata; /** * Possibly one of the only files in this package not designed to be serialised. diff --git a/core/src/main/java/com/sekwah/advancedportals/core/data/WorldLocation.java b/core/src/main/java/com/sekwah/advancedportals/core/serializeddata/WorldLocation.java similarity index 90% rename from core/src/main/java/com/sekwah/advancedportals/core/data/WorldLocation.java rename to core/src/main/java/com/sekwah/advancedportals/core/serializeddata/WorldLocation.java index a2f4be55..82f5fd42 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/data/WorldLocation.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/serializeddata/WorldLocation.java @@ -1,4 +1,4 @@ -package com.sekwah.advancedportals.core.data; +package com.sekwah.advancedportals.core.serializeddata; import com.google.gson.annotations.SerializedName; diff --git a/core/src/main/java/com/sekwah/advancedportals/core/services/DestinationServices.java b/core/src/main/java/com/sekwah/advancedportals/core/services/DestinationServices.java index 1ab2a637..0948765d 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/services/DestinationServices.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/services/DestinationServices.java @@ -5,8 +5,8 @@ import com.google.common.collect.ImmutableMap; import com.google.gson.reflect.TypeToken; import com.google.inject.Inject; import com.sekwah.advancedportals.core.connector.containers.PlayerContainer; -import com.sekwah.advancedportals.core.data.DataTag; -import com.sekwah.advancedportals.core.data.PlayerLocation; +import com.sekwah.advancedportals.core.serializeddata.DataTag; +import com.sekwah.advancedportals.core.serializeddata.PlayerLocation; import com.sekwah.advancedportals.core.destination.Destination; import com.sekwah.advancedportals.core.repository.IDestinationRepository; import com.sekwah.advancedportals.core.util.Lang; diff --git a/core/src/main/java/com/sekwah/advancedportals/core/services/PortalServices.java b/core/src/main/java/com/sekwah/advancedportals/core/services/PortalServices.java index 2783e3e0..9f33333c 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/services/PortalServices.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/services/PortalServices.java @@ -2,8 +2,8 @@ package com.sekwah.advancedportals.core.services; import com.google.common.collect.ImmutableList; import com.sekwah.advancedportals.core.connector.containers.PlayerContainer; -import com.sekwah.advancedportals.core.data.DataTag; -import com.sekwah.advancedportals.core.data.PlayerLocation; +import com.sekwah.advancedportals.core.serializeddata.DataTag; +import com.sekwah.advancedportals.core.serializeddata.PlayerLocation; import com.sekwah.advancedportals.core.portal.AdvancedPortal; import javax.inject.Singleton; diff --git a/core/src/main/java/com/sekwah/advancedportals/core/services/PortalTempDataServices.java b/core/src/main/java/com/sekwah/advancedportals/core/services/PortalTempDataServices.java index 42847377..aff6499a 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/services/PortalTempDataServices.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/services/PortalTempDataServices.java @@ -1,8 +1,8 @@ package com.sekwah.advancedportals.core.services; import com.sekwah.advancedportals.core.connector.containers.PlayerContainer; -import com.sekwah.advancedportals.core.data.BlockLocation; -import com.sekwah.advancedportals.core.data.PlayerTempData; +import com.sekwah.advancedportals.core.serializeddata.BlockLocation; +import com.sekwah.advancedportals.core.serializeddata.PlayerTempData; import javax.inject.Singleton; import java.util.HashMap; diff --git a/core/src/main/java/com/sekwah/advancedportals/core/util/Lang.java b/core/src/main/java/com/sekwah/advancedportals/core/util/Lang.java index 4a471b30..19a0b011 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/util/Lang.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/util/Lang.java @@ -1,7 +1,7 @@ package com.sekwah.advancedportals.core.util; import com.google.inject.Inject; -import com.sekwah.advancedportals.core.data.DataStorage; +import com.sekwah.advancedportals.core.serializeddata.DataStorage; import java.io.IOException; import java.io.InputStream; diff --git a/core/src/main/java/com/sekwah/advancedportals/core/util/TagReader.java b/core/src/main/java/com/sekwah/advancedportals/core/util/TagReader.java index 461dd729..2b4e6bcc 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/util/TagReader.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/util/TagReader.java @@ -1,6 +1,6 @@ package com.sekwah.advancedportals.core.util; -import com.sekwah.advancedportals.core.data.DataTag; +import com.sekwah.advancedportals.core.serializeddata.DataTag; import java.util.ArrayList; diff --git a/core/src/main/java/com/sekwah/advancedportals/core/warphandler/ActivationData.java b/core/src/main/java/com/sekwah/advancedportals/core/warphandler/ActivationData.java index 1f411818..1761cf00 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/warphandler/ActivationData.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/warphandler/ActivationData.java @@ -1,7 +1,7 @@ package com.sekwah.advancedportals.core.warphandler; -import com.sekwah.advancedportals.core.data.PlayerLocation; +import com.sekwah.advancedportals.core.serializeddata.PlayerLocation; /** * Created by on 30/07/2016. diff --git a/spigot/src/main/java/com/sekwah/advancedportals/spigot/connector/container/SpigotPlayerContainer.java b/spigot/src/main/java/com/sekwah/advancedportals/spigot/connector/container/SpigotPlayerContainer.java index df2637c2..3a6e3779 100644 --- a/spigot/src/main/java/com/sekwah/advancedportals/spigot/connector/container/SpigotPlayerContainer.java +++ b/spigot/src/main/java/com/sekwah/advancedportals/spigot/connector/container/SpigotPlayerContainer.java @@ -4,16 +4,14 @@ import com.google.inject.Inject; import com.sekwah.advancedportals.core.AdvancedPortalsCore; import com.sekwah.advancedportals.core.connector.containers.PlayerContainer; import com.sekwah.advancedportals.core.connector.containers.WorldContainer; -import com.sekwah.advancedportals.core.data.BlockLocation; -import com.sekwah.advancedportals.core.data.PlayerLocation; +import com.sekwah.advancedportals.core.serializeddata.BlockLocation; +import com.sekwah.advancedportals.core.serializeddata.PlayerLocation; import org.bukkit.Bukkit; -import org.bukkit.DyeColor; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; -import org.bukkit.material.Wool; import java.util.Arrays; import java.util.UUID; diff --git a/spigot/src/main/java/com/sekwah/advancedportals/spigot/connector/container/SpigotWorldContainer.java b/spigot/src/main/java/com/sekwah/advancedportals/spigot/connector/container/SpigotWorldContainer.java index 1f22a583..3723fb4d 100644 --- a/spigot/src/main/java/com/sekwah/advancedportals/spigot/connector/container/SpigotWorldContainer.java +++ b/spigot/src/main/java/com/sekwah/advancedportals/spigot/connector/container/SpigotWorldContainer.java @@ -1,12 +1,11 @@ package com.sekwah.advancedportals.spigot.connector.container; import com.sekwah.advancedportals.core.connector.containers.WorldContainer; -import com.sekwah.advancedportals.core.connector.data.BlockAxis; -import com.sekwah.advancedportals.core.data.BlockLocation; +import com.sekwah.advancedportals.core.data.BlockAxis; +import com.sekwah.advancedportals.core.serializeddata.BlockLocation; import org.bukkit.Axis; import org.bukkit.Material; import org.bukkit.World; -import org.bukkit.block.data.BlockData; import org.bukkit.block.data.Orientable; public class SpigotWorldContainer implements WorldContainer {