diff --git a/bungee/src/main/java/com/sekwah/advancedportals/bungee/AdvancedPortalsBungeePlugin.java b/bungee/src/main/java/com/sekwah/advancedportals/bungee/AdvancedPortalsBungeePlugin.java index ebb37e07..e0a44cd2 100644 --- a/bungee/src/main/java/com/sekwah/advancedportals/bungee/AdvancedPortalsBungeePlugin.java +++ b/bungee/src/main/java/com/sekwah/advancedportals/bungee/AdvancedPortalsBungeePlugin.java @@ -10,12 +10,14 @@ public class AdvancedPortalsBungeePlugin extends Plugin { @Override public void onEnable() { - this.proxyCore = new AdvancedPortalsProxyCore(new BungeeInfoLogger(this), new BungeeProxyContainer(this)); + this.proxyCore = new AdvancedPortalsProxyCore( + new BungeeInfoLogger(this), new BungeeProxyContainer(this)); this.proxyCore.onEnable(); getProxy().registerChannel(ProxyMessages.CHANNEL_NAME); - getProxy().getPluginManager().registerListener(this, new EventListener(this, this.proxyCore)); + getProxy().getPluginManager().registerListener( + this, new EventListener(this, this.proxyCore)); } @Override diff --git a/bungee/src/main/java/com/sekwah/advancedportals/bungee/BungeeInfoLogger.java b/bungee/src/main/java/com/sekwah/advancedportals/bungee/BungeeInfoLogger.java index 58086f95..967404b4 100644 --- a/bungee/src/main/java/com/sekwah/advancedportals/bungee/BungeeInfoLogger.java +++ b/bungee/src/main/java/com/sekwah/advancedportals/bungee/BungeeInfoLogger.java @@ -1,7 +1,6 @@ package com.sekwah.advancedportals.bungee; import com.sekwah.advancedportals.core.util.InfoLogger; - import java.util.logging.Level; public class BungeeInfoLogger extends InfoLogger { diff --git a/bungee/src/main/java/com/sekwah/advancedportals/bungee/EventListener.java b/bungee/src/main/java/com/sekwah/advancedportals/bungee/EventListener.java index b8bf4ef1..cabe2c56 100644 --- a/bungee/src/main/java/com/sekwah/advancedportals/bungee/EventListener.java +++ b/bungee/src/main/java/com/sekwah/advancedportals/bungee/EventListener.java @@ -13,35 +13,40 @@ import net.md_5.bungee.api.plugin.Listener; import net.md_5.bungee.event.EventHandler; public class EventListener implements Listener { - - private final AdvancedPortalsBungeePlugin plugin; private final AdvancedPortalsProxyCore proxyCore; - public EventListener(AdvancedPortalsBungeePlugin plugin, AdvancedPortalsProxyCore proxyCore) { + public EventListener(AdvancedPortalsBungeePlugin plugin, + AdvancedPortalsProxyCore proxyCore) { this.plugin = plugin; this.proxyCore = proxyCore; } @EventHandler public void onMessageReceived(PluginMessageEvent event) { - if(!event.getTag().equalsIgnoreCase(ProxyMessages.CHANNEL_NAME)) return; + if (!event.getTag().equalsIgnoreCase(ProxyMessages.CHANNEL_NAME)) + return; event.setCancelled(true); - if(!(event.getSender() instanceof Server)) return; + if (!(event.getSender() instanceof Server)) + return; - if(event.getReceiver() instanceof ProxiedPlayer player) { - this.proxyCore.incomingMessage(new BungeeProxyPlayerContainer(player), event.getData()); + if (event.getReceiver() instanceof ProxiedPlayer player) { + this.proxyCore.incomingMessage( + new BungeeProxyPlayerContainer(player), event.getData()); } } @EventHandler public void onServerConnected(ServerConnectedEvent event) { - this.proxyCore.onServerConnect(new BungeeProxyServerContainer(event.getServer()), new BungeeProxyPlayerContainer(event.getPlayer())); + this.proxyCore.onServerConnect( + new BungeeProxyServerContainer(event.getServer()), + new BungeeProxyPlayerContainer(event.getPlayer())); } @EventHandler public void onDisconnect(PlayerDisconnectEvent event) { - this.proxyCore.onPlayerDisconnect(new BungeeProxyPlayerContainer(event.getPlayer())); + this.proxyCore.onPlayerDisconnect( + new BungeeProxyPlayerContainer(event.getPlayer())); } } diff --git a/bungee/src/main/java/com/sekwah/advancedportals/bungee/connector/container/BungeeProxyContainer.java b/bungee/src/main/java/com/sekwah/advancedportals/bungee/connector/container/BungeeProxyContainer.java index a3fb6ad7..2afed451 100644 --- a/bungee/src/main/java/com/sekwah/advancedportals/bungee/connector/container/BungeeProxyContainer.java +++ b/bungee/src/main/java/com/sekwah/advancedportals/bungee/connector/container/BungeeProxyContainer.java @@ -7,7 +7,6 @@ import com.sekwah.advancedportals.proxycore.connector.container.ProxyPlayerConta import net.md_5.bungee.api.chat.TextComponent; public class BungeeProxyContainer implements ProxyContainer { - private final AdvancedPortalsBungeePlugin plugin; public BungeeProxyContainer(AdvancedPortalsBungeePlugin plugin) { @@ -15,21 +14,26 @@ public class BungeeProxyContainer implements ProxyContainer { } @Override - public void invokeCommand(ProxyPlayerContainer proxyPlayer, String command) { + public void invokeCommand(ProxyPlayerContainer proxyPlayer, + String command) { // Should never not be true but just to be safe - if(proxyPlayer instanceof BungeeProxyPlayerContainer playerContainer) { - plugin.getProxy().getPluginManager().dispatchCommand(playerContainer.getPlayer(), command); + if (proxyPlayer instanceof BungeeProxyPlayerContainer playerContainer) { + plugin.getProxy().getPluginManager().dispatchCommand( + playerContainer.getPlayer(), command); } } @Override - public void transferPlayer(ProxyPlayerContainer proxyPlayer, String serverName) { + public void transferPlayer(ProxyPlayerContainer proxyPlayer, + String serverName) { // Should never not be true but just to be safe - if(proxyPlayer instanceof BungeeProxyPlayerContainer playerContainer) { + if (proxyPlayer instanceof BungeeProxyPlayerContainer playerContainer) { var serverInfo = plugin.getProxy().getServerInfo(serverName); var player = playerContainer.getPlayer(); - if(serverInfo == null) { - player.sendMessage(new TextComponent(Lang.convertColors("&cCould not find server: &e") + serverName)); + if (serverInfo == null) { + player.sendMessage(new TextComponent( + Lang.convertColors("&cCould not find server: &e") + + serverName)); return; } player.connect(serverInfo); diff --git a/bungee/src/main/java/com/sekwah/advancedportals/bungee/connector/container/BungeeProxyPlayerContainer.java b/bungee/src/main/java/com/sekwah/advancedportals/bungee/connector/container/BungeeProxyPlayerContainer.java index cead8dad..7c7ed9f7 100644 --- a/bungee/src/main/java/com/sekwah/advancedportals/bungee/connector/container/BungeeProxyPlayerContainer.java +++ b/bungee/src/main/java/com/sekwah/advancedportals/bungee/connector/container/BungeeProxyPlayerContainer.java @@ -5,7 +5,6 @@ import com.sekwah.advancedportals.proxycore.connector.container.ProxyPlayerConta import net.md_5.bungee.api.connection.ProxiedPlayer; public class BungeeProxyPlayerContainer implements ProxyPlayerContainer { - private final ProxiedPlayer player; public BungeeProxyPlayerContainer(ProxiedPlayer player) { @@ -29,5 +28,4 @@ public class BungeeProxyPlayerContainer implements ProxyPlayerContainer { public void sendServerPluginMessage(byte[] data) { this.player.getServer().sendData(ProxyMessages.CHANNEL_NAME, data); } - } 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 152faa02..3e484d7a 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/AdvancedPortalsCore.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/AdvancedPortalsCore.java @@ -20,12 +20,10 @@ import com.sekwah.advancedportals.core.tags.*; import com.sekwah.advancedportals.core.util.GameScheduler; import com.sekwah.advancedportals.core.util.InfoLogger; import com.sekwah.advancedportals.core.util.Lang; - import java.io.File; import java.util.Arrays; public class AdvancedPortalsCore { - private final InfoLogger infoLogger; private final DataStorage dataStorage; @@ -74,8 +72,8 @@ public class AdvancedPortalsCore { this.infoLogger = infoLogger; int[] mcVersionTemp; - infoLogger.info("Loading Advanced Portals Core v" + BuildConstants.VERSION - + " for MC: " + mcVersion); + infoLogger.info("Loading Advanced Portals Core v" + + BuildConstants.VERSION + " for MC: " + mcVersion); try { mcVersionTemp = Arrays.stream(mcVersion.split("\\.")) .mapToInt(Integer::parseInt) @@ -121,9 +119,11 @@ public class AdvancedPortalsCore { private void registerChannels() { this.serverContainer.registerOutgoingChannel(BungeeTag.PACKET_CHANNEL); - if(this.configRepository.getEnableProxySupport()) { - this.serverContainer.registerOutgoingChannel(ProxyMessages.CHANNEL_NAME); - this.serverContainer.registerIncomingChannel(ProxyMessages.CHANNEL_NAME); + if (this.configRepository.getEnableProxySupport()) { + this.serverContainer.registerOutgoingChannel( + ProxyMessages.CHANNEL_NAME); + this.serverContainer.registerIncomingChannel( + ProxyMessages.CHANNEL_NAME); } } @@ -148,7 +148,8 @@ public class AdvancedPortalsCore { } private void registerPortalCommand(CommandRegister commandRegister) { - this.portalCommand = new CommandWithSubCommands(this, Permissions.PORTAL); + this.portalCommand = + new CommandWithSubCommands(this, Permissions.PORTAL); this.portalCommand.registerSubCommand("version", new VersionSubCommand()); 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 9414a2fa..257df346 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/CoreListeners.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/CoreListeners.java @@ -18,7 +18,6 @@ import com.sekwah.advancedportals.core.services.PortalServices; import com.sekwah.advancedportals.core.util.GameScheduler; import com.sekwah.advancedportals.core.util.Lang; import com.sekwah.advancedportals.core.warphandler.TriggerType; - import java.util.Objects; public class CoreListeners { @@ -44,10 +43,12 @@ public class CoreListeners { } private void setIfInPortal(PlayerContainer player) { - String inPortal = this.portalServices.inPortalRegionGetName(player.getBlockLoc()); + String inPortal = + this.portalServices.inPortalRegionGetName(player.getBlockLoc()); if (inPortal == null) { - inPortal = this.portalServices.inPortalRegionGetName(player.getBlockLoc().addY((int) player.getHeight())); + inPortal = this.portalServices.inPortalRegionGetName( + player.getBlockLoc().addY((int) player.getHeight())); } this.playerDataServices.getPlayerData(player).setInPortal(inPortal); @@ -61,7 +62,8 @@ public class CoreListeners { this.playerDataServices.playerLeave(player); } - public void incomingMessage(PlayerContainer player, String channel, byte[] message) { + public void incomingMessage(PlayerContainer player, String channel, + byte[] message) { var buffer = ByteStreams.newDataInput(message); var messageType = buffer.readUTF(); @@ -135,125 +137,126 @@ public class CoreListeners { } } return true; - } else if (itemInHandName.equals( - "\u00A78End Portal Block Placer")) { - world.setBlock(blockPos, "END_PORTAL"); - return true; - } else if (itemInHandName.equals("\u00A78Gateway Block Placer")) { - world.setBlock(blockPos, "END_GATEWAY"); - world.disableBeacon(blockPos); - return true; - } + } + else if (itemInHandName.equals("\u00A78End Portal Block Placer")) { + world.setBlock(blockPos, "END_PORTAL"); return true; } - if (portalServices.inPortalRegionProtected(blockPos)) { - if (player != null) { - player.sendMessage(Lang.getNegativePrefix() - + Lang.translate("portal.nobuild")); - } - return false; + else if (itemInHandName.equals("\u00A78Gateway Block Placer")) { + world.setBlock(blockPos, "END_GATEWAY"); + world.disableBeacon(blockPos); + return true; } return true; } - - /** - * If the block is allowed to be interacted with e.g. a lever - * @player player causing the event (or null if not a player) - * @param blockPos - * @return - */ - public boolean blockInteract(PlayerContainer player, - BlockLocation blockPos) { - return true; + if (portalServices.inPortalRegionProtected(blockPos)) { + if (player != null) { + player.sendMessage(Lang.getNegativePrefix() + + Lang.translate("portal.nobuild")); + } + return false; } + return true; +} - /** - * @param player - * @param blockLoc - * @param leftClick true = left click, false = right click - * @return if player is allowed to interact with block - */ - public boolean playerInteractWithBlock(PlayerContainer player, - String blockMaterialname, - String itemMaterialName, - String itemName, - BlockLocation blockLoc, - boolean leftClick) { - if (itemName != null - && Permissions.CREATE_PORTAL.hasPermission(player) - && itemMaterialName.equalsIgnoreCase( - this.configRepository.getSelectorMaterial()) - && (!this.configRepository.getUseOnlySpecialAxe() - || itemName.equals("\u00A7ePortal Region Selector"))) { - this.playerDataServices.playerSelectorActivate(player, blockLoc, - leftClick); - return false; - } else if (itemName != null && leftClick - && Objects.equals(itemMaterialName, "PURPLE_WOOL") - && itemName.equals("\u00A75Portal Block Placer") - && Permissions.BUILD.hasPermission(player)) { - if (!Objects.equals(blockMaterialname, "NETHER_PORTAL")) { - return false; - } - WorldContainer world = player.getWorld(); - if (world.getBlockAxis(blockLoc) == BlockAxis.X) { - world.setBlockAxis(blockLoc, BlockAxis.Z); - } else { - world.setBlockAxis(blockLoc, BlockAxis.X); - } +/** + * If the block is allowed to be interacted with e.g. a lever + * @player player causing the event (or null if not a player) + * @param blockPos + * @return + */ +public boolean blockInteract(PlayerContainer player, BlockLocation blockPos) { + return true; +} + +/** + * @param player + * @param blockLoc + * @param leftClick true = left click, false = right click + * @return if player is allowed to interact with block + */ +public boolean playerInteractWithBlock(PlayerContainer player, + String blockMaterialname, + String itemMaterialName, String itemName, + BlockLocation blockLoc, + boolean leftClick) { + if (itemName != null && Permissions.CREATE_PORTAL.hasPermission(player) + && itemMaterialName.equalsIgnoreCase( + this.configRepository.getSelectorMaterial()) + && (!this.configRepository.getUseOnlySpecialAxe() + || itemName.equals("\u00A7ePortal Region Selector"))) { + this.playerDataServices.playerSelectorActivate(player, blockLoc, + leftClick); + return false; + } else if (itemName != null && leftClick + && Objects.equals(itemMaterialName, "PURPLE_WOOL") + && itemName.equals("\u00A75Portal Block Placer") + && Permissions.BUILD.hasPermission(player)) { + if (!Objects.equals(blockMaterialname, "NETHER_PORTAL")) { return false; } - - return true; - } - - public void worldChange(PlayerContainer player) { - this.playerDataServices.setJoinCooldown(player); - this.setIfInPortal(player); - } - - public boolean preventEntityCombust(EntityContainer entity) { - return portalServices.inPortalRegion(entity.getBlockLoc(), 2); - } - - public boolean entityPortalEvent(EntityContainer entity) { - var pos = entity.getBlockLoc(); - if (entity instanceof PlayerContainer player) { - var playerData = playerDataServices.getPlayerData(player); - if (playerData.getPortalBlockCooldown()) { - return false; - } + WorldContainer world = player.getWorld(); + if (world.getBlockAxis(blockLoc) == BlockAxis.X) { + world.setBlockAxis(blockLoc, BlockAxis.Z); + } else { + world.setBlockAxis(blockLoc, BlockAxis.X); } - - return !(portalServices.inPortalRegion(pos, 1) || portalServices.inPortalRegion(pos.addY((int) entity.getHeight()), 1)); + return false; } - public boolean playerPortalEvent(PlayerContainer player, PlayerLocation toLoc) { + return true; +} +public void worldChange(PlayerContainer player) { + this.playerDataServices.setJoinCooldown(player); + this.setIfInPortal(player); +} + +public boolean preventEntityCombust(EntityContainer entity) { + return portalServices.inPortalRegion(entity.getBlockLoc(), 2); +} + +public boolean entityPortalEvent(EntityContainer entity) { + var pos = entity.getBlockLoc(); + if (entity instanceof PlayerContainer player) { var playerData = playerDataServices.getPlayerData(player); - if (playerData.getPortalBlockCooldown()) { return false; } - - var portalResult = this.portalServices.checkPortalActivation(player, toLoc, TriggerType.PORTAL); - - if(portalResult != PortalServices.PortalActivationResult.NOT_IN_PORTAL) { - return false; - } - - // Extra checks to prevent the player from being teleported by touching a portal but not having their body fully in the portal - var pos = player.getBlockLoc(); - - var feetInPortal = portalServices.inPortalRegion(pos, 1); - var headInPortal = portalServices.inPortalRegion( - pos.addY((int) player.getHeight()), 1); - - return !(feetInPortal || headInPortal); } - public boolean physicsEvent(BlockLocation blockLocation, String string) { - return !configRepository.getDisablePhysicsEvents() - || !portalServices.inPortalRegionProtected(blockLocation); - } + return !(portalServices.inPortalRegion(pos, 1) + || portalServices.inPortalRegion( + pos.addY((int) entity.getHeight()), 1)); +} + +public boolean playerPortalEvent(PlayerContainer player, PlayerLocation toLoc) { + var playerData = playerDataServices.getPlayerData(player); + + if (playerData.getPortalBlockCooldown()) { + return false; + } + + var portalResult = this.portalServices.checkPortalActivation( + player, toLoc, TriggerType.PORTAL); + + if (portalResult != PortalServices.PortalActivationResult.NOT_IN_PORTAL) { + return false; + } + + // Extra checks to prevent the player from being teleported by touching a + // portal but not having their body fully in the portal + var pos = player.getBlockLoc(); + + var feetInPortal = portalServices.inPortalRegion(pos, 1); + var headInPortal = + portalServices.inPortalRegion(pos.addY((int) player.getHeight()), 1); + + return !(feetInPortal || headInPortal); +} + +public boolean physicsEvent(BlockLocation blockLocation, String string) { + return !configRepository.getDisablePhysicsEvents() + || !portalServices.inPortalRegionProtected(blockLocation); +} } diff --git a/core/src/main/java/com/sekwah/advancedportals/core/ProxyMessages.java b/core/src/main/java/com/sekwah/advancedportals/core/ProxyMessages.java index b7720b57..715d2aeb 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/ProxyMessages.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/ProxyMessages.java @@ -1,10 +1,10 @@ package com.sekwah.advancedportals.core; /** - * messages going to the proxy will start with proxy: messages going to the server will start with server: + * messages going to the proxy will start with proxy: messages going to the + * server will start with server: */ public class ProxyMessages { - /** * Could split by channel messages we will handle it ourselves */ diff --git a/core/src/main/java/com/sekwah/advancedportals/core/commands/CommandTemplate.java b/core/src/main/java/com/sekwah/advancedportals/core/commands/CommandTemplate.java index a64215a6..3ef2ba8b 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/commands/CommandTemplate.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/commands/CommandTemplate.java @@ -1,7 +1,6 @@ package com.sekwah.advancedportals.core.commands; import com.sekwah.advancedportals.core.connector.containers.CommandSenderContainer; - import java.util.List; /** diff --git a/core/src/main/java/com/sekwah/advancedportals/core/commands/CommandWithSubCommands.java b/core/src/main/java/com/sekwah/advancedportals/core/commands/CommandWithSubCommands.java index 614726d2..8686f2a0 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/commands/CommandWithSubCommands.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/commands/CommandWithSubCommands.java @@ -5,7 +5,6 @@ import com.sekwah.advancedportals.core.connector.containers.CommandSenderContain import com.sekwah.advancedportals.core.permissions.PermissionBuilder; import com.sekwah.advancedportals.core.registry.SubCommandRegistry; import com.sekwah.advancedportals.core.util.Lang; - import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -18,7 +17,8 @@ public class CommandWithSubCommands implements CommandTemplate { private final AdvancedPortalsCore pluginCore; private final PermissionBuilder permission; - public CommandWithSubCommands(AdvancedPortalsCore advancedPortalsCore, PermissionBuilder permission) { + public CommandWithSubCommands(AdvancedPortalsCore advancedPortalsCore, + PermissionBuilder permission) { this.subCommandRegistry = new SubCommandRegistry(); this.pluginCore = advancedPortalsCore; this.permission = permission; @@ -57,8 +57,9 @@ public class CommandWithSubCommands implements CommandTemplate { @Override public void onCommand(CommandSenderContainer sender, String commandExecuted, String[] args) { - if(!permission.hasPermission(sender)) { - sender.sendMessage(Lang.getNegativePrefix() + Lang.translate("command.nopermission")); + if (!permission.hasPermission(sender)) { + sender.sendMessage(Lang.getNegativePrefix() + + Lang.translate("command.nopermission")); return; } if (args.length > 0) { diff --git a/core/src/main/java/com/sekwah/advancedportals/core/commands/SubCommand.java b/core/src/main/java/com/sekwah/advancedportals/core/commands/SubCommand.java index e30c8a77..233bb26f 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/commands/SubCommand.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/commands/SubCommand.java @@ -1,7 +1,6 @@ package com.sekwah.advancedportals.core.commands; import com.sekwah.advancedportals.core.connector.containers.CommandSenderContainer; - import java.util.List; public interface SubCommand { diff --git a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/common/CreateTaggedSubCommand.java b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/common/CreateTaggedSubCommand.java index f79a2227..2c49b69b 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/common/CreateTaggedSubCommand.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/common/CreateTaggedSubCommand.java @@ -5,7 +5,6 @@ import com.sekwah.advancedportals.core.connector.containers.CommandSenderContain import com.sekwah.advancedportals.core.serializeddata.DataTag; import com.sekwah.advancedportals.core.util.TagReader; import com.sekwah.advancedportals.core.warphandler.Tag; - import java.util.ArrayList; import java.util.Arrays; import java.util.List; 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 b84fabc4..2e126213 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 @@ -12,7 +12,6 @@ import com.sekwah.advancedportals.core.services.DestinationServices; import com.sekwah.advancedportals.core.util.Lang; import com.sekwah.advancedportals.core.util.TagReader; import com.sekwah.advancedportals.core.warphandler.Tag; - import java.util.ArrayList; import java.util.Arrays; import java.util.List; diff --git a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/desti/ListDestiSubCommand.java b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/desti/ListDestiSubCommand.java index ae7a340a..175adead 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/desti/ListDestiSubCommand.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/desti/ListDestiSubCommand.java @@ -6,7 +6,6 @@ import com.sekwah.advancedportals.core.connector.containers.CommandSenderContain import com.sekwah.advancedportals.core.permissions.Permissions; import com.sekwah.advancedportals.core.services.DestinationServices; import com.sekwah.advancedportals.core.util.Lang; - import java.util.List; import java.util.stream.Collectors; diff --git a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/desti/RemoveDestiSubCommand.java b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/desti/RemoveDestiSubCommand.java index 124f13b2..57c46011 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/desti/RemoveDestiSubCommand.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/desti/RemoveDestiSubCommand.java @@ -6,7 +6,6 @@ import com.sekwah.advancedportals.core.connector.containers.CommandSenderContain import com.sekwah.advancedportals.core.permissions.Permissions; import com.sekwah.advancedportals.core.services.DestinationServices; import com.sekwah.advancedportals.core.util.Lang; - import java.util.Collections; import java.util.List; diff --git a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/desti/ShowDestiSubCommand.java b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/desti/ShowDestiSubCommand.java index 8a17fff6..0ddffc39 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/desti/ShowDestiSubCommand.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/desti/ShowDestiSubCommand.java @@ -14,7 +14,6 @@ import com.sekwah.advancedportals.core.services.PlayerDataServices; import com.sekwah.advancedportals.core.util.Debug; import com.sekwah.advancedportals.core.util.GameScheduler; import com.sekwah.advancedportals.core.util.Lang; - import java.awt.*; import java.util.List; import java.util.Objects; diff --git a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/desti/TeleportDestiSubCommand.java b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/desti/TeleportDestiSubCommand.java index 246288f8..3c6b4e89 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/desti/TeleportDestiSubCommand.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/desti/TeleportDestiSubCommand.java @@ -6,7 +6,6 @@ import com.sekwah.advancedportals.core.connector.containers.CommandSenderContain import com.sekwah.advancedportals.core.permissions.Permissions; import com.sekwah.advancedportals.core.services.DestinationServices; import com.sekwah.advancedportals.core.util.Lang; - import java.util.Collections; import java.util.List; 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 95d1c306..8125020b 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 @@ -15,7 +15,6 @@ import com.sekwah.advancedportals.core.tags.TriggerBlockTag; import com.sekwah.advancedportals.core.util.Lang; import com.sekwah.advancedportals.core.util.TagReader; import com.sekwah.advancedportals.core.warphandler.Tag; - import java.util.ArrayList; import java.util.Arrays; import java.util.List; diff --git a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/DisableBeaconSubCommand.java b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/DisableBeaconSubCommand.java index e9408e04..8143db13 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/DisableBeaconSubCommand.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/DisableBeaconSubCommand.java @@ -6,7 +6,6 @@ import com.sekwah.advancedportals.core.connector.containers.CommandSenderContain import com.sekwah.advancedportals.core.permissions.Permissions; import com.sekwah.advancedportals.core.services.PortalServices; import com.sekwah.advancedportals.core.util.Lang; - import java.util.List; public class DisableBeaconSubCommand implements SubCommand { @@ -18,17 +17,22 @@ public class DisableBeaconSubCommand implements SubCommand { if (args.length > 1) { var portalName = args[1]; var portal = portalServices.getPortal(portalName); - if(portal == null) { - sender.sendMessage(Lang.getNegativePrefix() - + Lang.translateInsertVariables("command.portal.disablebeacon.notfound", portalName)); + if (portal == null) { + sender.sendMessage( + Lang.getNegativePrefix() + + Lang.translateInsertVariables( + "command.portal.disablebeacon.notfound", portalName)); return; } - sender.sendMessage(Lang.getPositivePrefix() - + Lang.translateInsertVariables("command.portal.disablebeacon.complete", portalName)); + sender.sendMessage( + Lang.getPositivePrefix() + + Lang.translateInsertVariables( + "command.portal.disablebeacon.complete", portalName)); sender.getPlayerContainer().getWorld().disableBeacon(portal); } else { - sender.sendMessage(Lang.getNegativePrefix() - + Lang.translate("command.portal.disablebeacon.noname")); + sender.sendMessage( + Lang.getNegativePrefix() + + Lang.translate("command.portal.disablebeacon.noname")); } } diff --git a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/EndGatewayBlockSubCommand.java b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/EndGatewayBlockSubCommand.java index e2931328..0000e305 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/EndGatewayBlockSubCommand.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/EndGatewayBlockSubCommand.java @@ -7,7 +7,6 @@ import com.sekwah.advancedportals.core.connector.containers.CommandSenderContain import com.sekwah.advancedportals.core.connector.containers.PlayerContainer; import com.sekwah.advancedportals.core.permissions.Permissions; import com.sekwah.advancedportals.core.util.Lang; - import java.util.List; public class EndGatewayBlockSubCommand implements SubCommand { diff --git a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/EndPortalBlockSubCommand.java b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/EndPortalBlockSubCommand.java index 63ad0107..fad15e0f 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/EndPortalBlockSubCommand.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/EndPortalBlockSubCommand.java @@ -7,7 +7,6 @@ import com.sekwah.advancedportals.core.connector.containers.CommandSenderContain import com.sekwah.advancedportals.core.connector.containers.PlayerContainer; import com.sekwah.advancedportals.core.permissions.Permissions; import com.sekwah.advancedportals.core.util.Lang; - import java.util.List; public class EndPortalBlockSubCommand implements SubCommand { diff --git a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/InfoPortalSubCommand.java b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/InfoPortalSubCommand.java index fbd8b4bb..6d6fb1d8 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/InfoPortalSubCommand.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/InfoPortalSubCommand.java @@ -7,7 +7,6 @@ import com.sekwah.advancedportals.core.permissions.Permissions; import com.sekwah.advancedportals.core.services.PortalServices; import com.sekwah.advancedportals.core.util.Lang; import com.sekwah.advancedportals.core.util.TagReader; - import java.util.List; public class InfoPortalSubCommand implements SubCommand { @@ -19,17 +18,20 @@ public class InfoPortalSubCommand implements SubCommand { if (args.length > 1) { var portalName = args[1]; var portal = portalServices.getPortal(portalName); - if(portal == null) { - sender.sendMessage(Lang.getNegativePrefix() - + Lang.translateInsertVariables("command.portal.info.notfound", portalName)); + if (portal == null) { + sender.sendMessage( + Lang.getNegativePrefix() + + Lang.translateInsertVariables( + "command.portal.info.notfound", portalName)); return; } sender.sendMessage(Lang.getPositivePrefix() - + Lang.translateInsertVariables("command.portal.info.complete", portalName)); + + Lang.translateInsertVariables( + "command.portal.info.complete", portalName)); TagReader.printArgs(sender, portal.getArgs()); } else { sender.sendMessage(Lang.getNegativePrefix() - + Lang.translate("command.portal.info.noname")); + + Lang.translate("command.portal.info.noname")); } } diff --git a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/LangUpdateSubCommand.java b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/LangUpdateSubCommand.java index b17599eb..868d4c44 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/LangUpdateSubCommand.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/LangUpdateSubCommand.java @@ -7,7 +7,6 @@ import com.sekwah.advancedportals.core.connector.containers.CommandSenderContain import com.sekwah.advancedportals.core.permissions.Permissions; import com.sekwah.advancedportals.core.repository.ConfigRepository; import com.sekwah.advancedportals.core.util.Lang; - import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.InputStream; diff --git a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/ListPortalsSubCommand.java b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/ListPortalsSubCommand.java index 54b0a4da..aaf4ae50 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/ListPortalsSubCommand.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/ListPortalsSubCommand.java @@ -6,7 +6,6 @@ import com.sekwah.advancedportals.core.connector.containers.CommandSenderContain import com.sekwah.advancedportals.core.permissions.Permissions; import com.sekwah.advancedportals.core.services.PortalServices; import com.sekwah.advancedportals.core.util.Lang; - import java.util.List; import java.util.stream.Collectors; @@ -17,8 +16,8 @@ public class ListPortalsSubCommand implements SubCommand { @Override public void onCommand(CommandSenderContainer sender, String[] args) { sender.sendMessage( - Lang.getPositivePrefix() - + Lang.translate("command.portal.list") + " " + Lang.getPositivePrefix() + Lang.translate("command.portal.list") + + " " + portalServices.getPortalNames().stream().sorted().collect( Collectors.joining(", "))); } diff --git a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/PortalBlockSubCommand.java b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/PortalBlockSubCommand.java index 474c4af1..b4f91e4f 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/PortalBlockSubCommand.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/PortalBlockSubCommand.java @@ -7,7 +7,6 @@ import com.sekwah.advancedportals.core.connector.containers.CommandSenderContain import com.sekwah.advancedportals.core.connector.containers.PlayerContainer; import com.sekwah.advancedportals.core.permissions.Permissions; import com.sekwah.advancedportals.core.util.Lang; - import java.util.List; public class PortalBlockSubCommand implements SubCommand { diff --git a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/ReloadPortalSubCommand.java b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/ReloadPortalSubCommand.java index a52b46ce..c11fa125 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/ReloadPortalSubCommand.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/ReloadPortalSubCommand.java @@ -9,7 +9,6 @@ import com.sekwah.advancedportals.core.repository.ConfigRepository; import com.sekwah.advancedportals.core.services.DestinationServices; import com.sekwah.advancedportals.core.services.PortalServices; import com.sekwah.advancedportals.core.util.Lang; - import java.util.List; public class ReloadPortalSubCommand implements SubCommand { diff --git a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/RemovePortalSubCommand.java b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/RemovePortalSubCommand.java index 83c38c0e..6cc87eae 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/RemovePortalSubCommand.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/RemovePortalSubCommand.java @@ -6,7 +6,6 @@ import com.sekwah.advancedportals.core.connector.containers.CommandSenderContain import com.sekwah.advancedportals.core.permissions.Permissions; import com.sekwah.advancedportals.core.services.PortalServices; import com.sekwah.advancedportals.core.util.Lang; - import java.util.List; public class RemovePortalSubCommand implements SubCommand { diff --git a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/SelectorSubCommand.java b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/SelectorSubCommand.java index e9b6a145..cbac4db5 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/SelectorSubCommand.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/SelectorSubCommand.java @@ -8,7 +8,6 @@ import com.sekwah.advancedportals.core.connector.containers.PlayerContainer; import com.sekwah.advancedportals.core.permissions.Permissions; import com.sekwah.advancedportals.core.repository.ConfigRepository; import com.sekwah.advancedportals.core.util.Lang; - import java.util.List; public class SelectorSubCommand implements SubCommand { diff --git a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/ShowPortalSubCommand.java b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/ShowPortalSubCommand.java index 5408f440..379d391b 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/ShowPortalSubCommand.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/ShowPortalSubCommand.java @@ -16,7 +16,6 @@ import com.sekwah.advancedportals.core.tags.NameTag; import com.sekwah.advancedportals.core.util.Debug; import com.sekwah.advancedportals.core.util.GameScheduler; import com.sekwah.advancedportals.core.util.Lang; - import java.awt.*; import java.util.List; import java.util.Objects; @@ -120,12 +119,15 @@ public class ShowPortalSubCommand player.getWorldName())) { int widthX = Math.abs(tempData.getPos1().getPosX() - tempData.getPos2().getPosX()); - int widthY = Math.abs(tempData.getPos1().getPosY() - tempData.getPos2().getPosY()); - int widthZ = Math.abs(tempData.getPos1().getPosZ() - tempData.getPos2().getPosZ()); + int widthY = Math.abs(tempData.getPos1().getPosY() + - tempData.getPos2().getPosY()); + int widthZ = Math.abs(tempData.getPos1().getPosZ() + - tempData.getPos2().getPosZ()); int totalBlocks = widthX * widthY * widthZ; if (totalBlocks <= config.getMaxTriggerVisualisationSize()) - debugVisuals(player, tempData.getPos1(), tempData.getPos2(), - SELECTION_COLOR, SHOW_TICKS); + debugVisuals(player, tempData.getPos1(), + tempData.getPos2(), SELECTION_COLOR, + SHOW_TICKS); } if (tempData.getPos1() != null diff --git a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/VersionSubCommand.java b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/VersionSubCommand.java index 3f07e49e..71ad06a9 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/VersionSubCommand.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/commands/subcommands/portal/VersionSubCommand.java @@ -4,14 +4,12 @@ import com.sekwah.advancedportals.core.BuildConstants; import com.sekwah.advancedportals.core.commands.SubCommand; import com.sekwah.advancedportals.core.connector.containers.CommandSenderContainer; import com.sekwah.advancedportals.core.util.Lang; - import java.util.List; public class VersionSubCommand implements SubCommand { @Override public void onCommand(CommandSenderContainer sender, String[] args) { - sender.sendMessage(Lang.getPositivePrefix() - + " Advanced Portals v" + sender.sendMessage(Lang.getPositivePrefix() + " Advanced Portals v" + BuildConstants.VERSION); } diff --git a/core/src/main/java/com/sekwah/advancedportals/core/connector/containers/GameMode.java b/core/src/main/java/com/sekwah/advancedportals/core/connector/containers/GameMode.java index 54c6b2cc..1388766e 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/connector/containers/GameMode.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/connector/containers/GameMode.java @@ -1,8 +1,3 @@ package com.sekwah.advancedportals.core.connector.containers; -public enum GameMode { - SURVIVAL, - CREATIVE, - ADVENTURE, - SPECTATOR -} +public enum GameMode { SURVIVAL, CREATIVE, ADVENTURE, SPECTATOR } 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 f5170c64..d2bc2545 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,6 @@ package com.sekwah.advancedportals.core.connector.containers; import com.sekwah.advancedportals.core.serializeddata.BlockLocation; - import java.util.UUID; /** diff --git a/core/src/main/java/com/sekwah/advancedportals/core/connector/containers/ServerContainer.java b/core/src/main/java/com/sekwah/advancedportals/core/connector/containers/ServerContainer.java index 18787f42..97aacbd0 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/connector/containers/ServerContainer.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/connector/containers/ServerContainer.java @@ -1,7 +1,6 @@ package com.sekwah.advancedportals.core.connector.containers; import com.sekwah.advancedportals.core.tags.CommandTag; - import java.util.List; import java.util.UUID; 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 b9f625e1..c09cac30 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 @@ -9,7 +9,6 @@ import com.sekwah.advancedportals.core.serializeddata.PlayerLocation; import com.sekwah.advancedportals.core.warphandler.ActivationData; import com.sekwah.advancedportals.core.warphandler.Tag; import com.sekwah.advancedportals.core.warphandler.TriggerType; - import java.util.*; /** @@ -87,7 +86,7 @@ public class Destination implements TagTarget { public boolean activate(PlayerContainer player) { ActivationData data = new ActivationData(TriggerType.MANUAL); - if(this.portalActivate(player, data)) { + if (this.portalActivate(player, data)) { this.postActivate(player, data); return true; } @@ -95,7 +94,7 @@ public class Destination implements TagTarget { } public boolean portalActivate(PlayerContainer player, ActivationData data) { - if(!isSorted) { + if (!isSorted) { updateDestiTagList(); } DataTag[] destiTags = new DataTag[args.size()]; @@ -104,16 +103,17 @@ public class Destination implements TagTarget { destiTags[i++] = new DataTag(entry.getKey(), entry.getValue()); } for (DataTag destiTag : destiTags) { - Tag.Activation activationHandler = - tagRegistry.getActivationHandler(destiTag.NAME, Tag.TagType.DESTINATION); - if (activationHandler != null && !activationHandler.preActivated( + Tag.Activation activationHandler = tagRegistry.getActivationHandler( + destiTag.NAME, Tag.TagType.DESTINATION); + if (activationHandler != null + && !activationHandler.preActivated( this, player, data, this.getArgValues(destiTag.NAME))) { return false; } } for (DataTag destiTag : destiTags) { - Tag.Activation activationHandler = - tagRegistry.getActivationHandler(destiTag.NAME, Tag.TagType.DESTINATION); + Tag.Activation activationHandler = tagRegistry.getActivationHandler( + destiTag.NAME, Tag.TagType.DESTINATION); if (activationHandler != null) { activationHandler.activated(this, player, data, this.getArgValues(destiTag.NAME)); @@ -129,8 +129,8 @@ public class Destination implements TagTarget { destiTags[i++] = new DataTag(entry.getKey(), entry.getValue()); } for (DataTag destiTag : destiTags) { - Tag.Activation activationHandler = - tagRegistry.getActivationHandler(destiTag.NAME, Tag.TagType.DESTINATION); + Tag.Activation activationHandler = tagRegistry.getActivationHandler( + destiTag.NAME, Tag.TagType.DESTINATION); if (activationHandler != null) { activationHandler.postActivated( this, player, data, this.getArgValues(destiTag.NAME)); 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 46d6829f..6883b6e1 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 @@ -20,10 +20,9 @@ import com.sekwah.advancedportals.core.serializeddata.DataStorage; import com.sekwah.advancedportals.core.serializeddata.config.Config; import com.sekwah.advancedportals.core.serializeddata.config.ConfigProvider; import com.sekwah.advancedportals.core.util.InfoLogger; - -import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.List; +import javax.annotation.Nonnull; public class AdvancedPortalsModule extends AbstractModule { private Injector injector; diff --git a/core/src/main/java/com/sekwah/advancedportals/core/network/ProxyCommandPacket.java b/core/src/main/java/com/sekwah/advancedportals/core/network/ProxyCommandPacket.java index 54dc171c..44682adf 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/network/ProxyCommandPacket.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/network/ProxyCommandPacket.java @@ -6,7 +6,6 @@ import com.google.common.io.ByteStreams; import com.sekwah.advancedportals.core.ProxyMessages; public class ProxyCommandPacket implements Packet { - private final String command; public ProxyCommandPacket(String command) { diff --git a/core/src/main/java/com/sekwah/advancedportals/core/network/ProxyTransferDestiPacket.java b/core/src/main/java/com/sekwah/advancedportals/core/network/ProxyTransferDestiPacket.java index dc0c8224..e24826b2 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/network/ProxyTransferDestiPacket.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/network/ProxyTransferDestiPacket.java @@ -6,7 +6,6 @@ import com.google.common.io.ByteStreams; import com.sekwah.advancedportals.core.ProxyMessages; public class ProxyTransferDestiPacket implements Packet { - private final String serverName; private final String destination; @@ -21,7 +20,6 @@ public class ProxyTransferDestiPacket implements Packet { buffer.writeUTF(this.serverName); buffer.writeUTF(this.destination); return buffer.toByteArray(); - } public static ProxyTransferDestiPacket decode(ByteArrayDataInput buffer) { diff --git a/core/src/main/java/com/sekwah/advancedportals/core/network/ProxyTransferPacket.java b/core/src/main/java/com/sekwah/advancedportals/core/network/ProxyTransferPacket.java index 435f4789..216f36f0 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/network/ProxyTransferPacket.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/network/ProxyTransferPacket.java @@ -6,7 +6,6 @@ import com.google.common.io.ByteStreams; import com.sekwah.advancedportals.core.ProxyMessages; public class ProxyTransferPacket implements Packet { - private final String serverName; public ProxyTransferPacket(String serverName) { @@ -18,7 +17,6 @@ public class ProxyTransferPacket implements Packet { buffer.writeUTF(ProxyMessages.PROXY_TRANSFER); buffer.writeUTF(this.serverName); return buffer.toByteArray(); - } public static ProxyTransferPacket decode(ByteArrayDataInput buffer) { diff --git a/core/src/main/java/com/sekwah/advancedportals/core/network/ServerDestiPacket.java b/core/src/main/java/com/sekwah/advancedportals/core/network/ServerDestiPacket.java index d390f687..33fb9201 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/network/ServerDestiPacket.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/network/ServerDestiPacket.java @@ -6,7 +6,6 @@ import com.google.common.io.ByteStreams; import com.sekwah.advancedportals.core.ProxyMessages; public class ServerDestiPacket implements Packet { - private final String destination; public ServerDestiPacket(String destination) { @@ -18,7 +17,6 @@ public class ServerDestiPacket implements Packet { buffer.writeUTF(ProxyMessages.SERVER_DESTI); buffer.writeUTF(this.destination); return buffer.toByteArray(); - } public static ServerDestiPacket decode(ByteArrayDataInput buffer) { diff --git a/core/src/main/java/com/sekwah/advancedportals/core/permissions/PermissionBuilder.java b/core/src/main/java/com/sekwah/advancedportals/core/permissions/PermissionBuilder.java index cd0aeea2..4a70a3d8 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/permissions/PermissionBuilder.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/permissions/PermissionBuilder.java @@ -2,7 +2,6 @@ package com.sekwah.advancedportals.core.permissions; import com.google.common.collect.ImmutableList; import com.sekwah.advancedportals.core.connector.containers.HasPermission; - import java.util.ArrayList; import java.util.List; @@ -31,13 +30,15 @@ public class PermissionBuilder { this.permissionDefault = parent.permissionDefault; } - PermissionBuilder(String permissionTag, PermissionBuilder parent, PermissionDefault permissionDefault) { + PermissionBuilder(String permissionTag, PermissionBuilder parent, + PermissionDefault permissionDefault) { this.permissionTag = permissionTag; this.parent = parent; this.permissionDefault = permissionDefault; } - PermissionBuilder(String permissionTag, PermissionDefault permissionDefault) { + PermissionBuilder(String permissionTag, + PermissionDefault permissionDefault) { this.permissionTag = permissionTag; this.parent = null; this.permissionDefault = permissionDefault; @@ -54,8 +55,10 @@ public class PermissionBuilder { return child; } - public PermissionBuilder createChild(String permissionTag, PermissionDefault permissionDefault) { - var child = new PermissionBuilder(permissionTag, this, permissionDefault); + public PermissionBuilder createChild(String permissionTag, + PermissionDefault permissionDefault) { + var child = + new PermissionBuilder(permissionTag, this, permissionDefault); children.add(child); return child; diff --git a/core/src/main/java/com/sekwah/advancedportals/core/permissions/Permissions.java b/core/src/main/java/com/sekwah/advancedportals/core/permissions/Permissions.java index cc1b9a99..53cd2b5f 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/permissions/Permissions.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/permissions/Permissions.java @@ -1,12 +1,12 @@ package com.sekwah.advancedportals.core.permissions; public class Permissions { - /** * If true then a permission manager is being used and don't check for op * for platforms like spigot this will always be true. *
- * This is to allow for negative permissions where a value may be defaulted to true.
+ * This is to allow for negative permissions where a value may be defaulted
+ * to true.
*/
public static boolean hasPermissionManager = false;
@@ -14,95 +14,116 @@ public class Permissions {
new PermissionBuilder("advancedportals").doNotExport();
public static final PermissionBuilder BUILD =
- ROOT.createChild("build", PermissionBuilder.PermissionDefault.OP).description("Allows you to build in the portal regions");
-
+ ROOT.createChild("build", PermissionBuilder.PermissionDefault.OP)
+ .description("Allows you to build in the portal regions");
public static final PermissionBuilder DESTI =
- ROOT.createChild("desti", PermissionBuilder.PermissionDefault.TRUE).description("Allows you to use the destination command");
+ ROOT.createChild("desti", PermissionBuilder.PermissionDefault.TRUE)
+ .description("Allows you to use the destination command");
public static final PermissionBuilder CREATE_DESTI =
- DESTI.createChild("create", PermissionBuilder.PermissionDefault.OP).description("Allows you to create destinations");
+ DESTI.createChild("create", PermissionBuilder.PermissionDefault.OP)
+ .description("Allows you to create destinations");
public static final PermissionBuilder TELEPORT_DESTI =
- DESTI.createChild("teleport", PermissionBuilder.PermissionDefault.OP).description("Allows you to teleport to destinations");
+ DESTI.createChild("teleport", PermissionBuilder.PermissionDefault.OP)
+ .description("Allows you to teleport to destinations");
public static final PermissionBuilder REMOVE_DESTI =
- DESTI.createChild("remove", PermissionBuilder.PermissionDefault.OP).description("Allows you to remove destinations");
+ DESTI.createChild("remove", PermissionBuilder.PermissionDefault.OP)
+ .description("Allows you to remove destinations");
public static final PermissionBuilder LIST_DESTI =
- DESTI.createChild("list", PermissionBuilder.PermissionDefault.OP).description("Allows you to list all destinations");
+ DESTI.createChild("list", PermissionBuilder.PermissionDefault.OP)
+ .description("Allows you to list all destinations");
public static final PermissionBuilder SHOW_DESTI =
- DESTI.createChild("show", PermissionBuilder.PermissionDefault.OP).description("Allows you to visualise the destination locations");
+ DESTI.createChild("show", PermissionBuilder.PermissionDefault.OP)
+ .description("Allows you to visualise the destination locations");
public static final PermissionBuilder PORTAL =
- ROOT.createChild("portal", PermissionBuilder.PermissionDefault.TRUE).description("Allows you to use the portal command");
+ ROOT.createChild("portal", PermissionBuilder.PermissionDefault.TRUE)
+ .description("Allows you to use the portal command");
public static final PermissionBuilder CREATE_PORTAL =
- PORTAL.createChild("create", PermissionBuilder.PermissionDefault.OP).description("Allows you to create portals");
+ PORTAL.createChild("create", PermissionBuilder.PermissionDefault.OP)
+ .description("Allows you to create portals");
public static final PermissionBuilder SELECTOR =
- PORTAL.createChild("selector", PermissionBuilder.PermissionDefault.OP).description("Allows you to give yourself a portal selector");
+ PORTAL.createChild("selector", PermissionBuilder.PermissionDefault.OP)
+ .description("Allows you to give yourself a portal selector");
public static final PermissionBuilder REMOVE_PORTAL =
- PORTAL.createChild("remove", PermissionBuilder.PermissionDefault.OP).description("Allows you to remove portals");
+ PORTAL.createChild("remove", PermissionBuilder.PermissionDefault.OP)
+ .description("Allows you to remove portals");
public static final PermissionBuilder LIST_PORTAL =
- PORTAL.createChild("list", PermissionBuilder.PermissionDefault.OP).description("Allows you to list all portals");
+ PORTAL.createChild("list", PermissionBuilder.PermissionDefault.OP)
+ .description("Allows you to list all portals");
- public static final PermissionBuilder LANG_UPDATE =
- PORTAL.createChild("lang_update", PermissionBuilder.PermissionDefault.OP);
+ public static final PermissionBuilder LANG_UPDATE = PORTAL.createChild(
+ "lang_update", PermissionBuilder.PermissionDefault.OP);
public static final PermissionBuilder RELOAD =
- PORTAL.createChild("reload", PermissionBuilder.PermissionDefault.OP);
+ PORTAL.createChild("reload", PermissionBuilder.PermissionDefault.OP);
- public static final PermissionBuilder DISABLE_BEACON =
- PORTAL.createChild("disable_beacon", PermissionBuilder.PermissionDefault.OP);
+ public static final PermissionBuilder DISABLE_BEACON = PORTAL.createChild(
+ "disable_beacon", PermissionBuilder.PermissionDefault.OP);
public static final PermissionBuilder IMPORT =
- PORTAL.createChild("import", PermissionBuilder.PermissionDefault.OP);
+ PORTAL.createChild("import", PermissionBuilder.PermissionDefault.OP);
public static final PermissionBuilder SHOW_PORTAL =
- PORTAL.createChild("show", PermissionBuilder.PermissionDefault.OP).description("Allows you to view the portal regions");
+ PORTAL.createChild("show", PermissionBuilder.PermissionDefault.OP)
+ .description("Allows you to view the portal regions");
private static final PermissionBuilder CREATE_COMMAND_LEVEL =
- CREATE_PORTAL.createChild("command_level").doNotExport();
+ CREATE_PORTAL.createChild("command_level").doNotExport();
public static final PermissionBuilder CREATE_COMMAND_OP =
- CREATE_COMMAND_LEVEL.createChild("op").description("Allows you to increase the users level temporarily to op");
+ CREATE_COMMAND_LEVEL.createChild("op").description(
+ "Allows you to increase the users level temporarily to op");
public static final PermissionBuilder CREATE_COMMAND_CONSOLE =
- CREATE_COMMAND_LEVEL.createChild("console").description("Allows you to create portals which execute console commands");
+ CREATE_COMMAND_LEVEL.createChild("console").description(
+ "Allows you to create portals which execute console commands");
public static final PermissionBuilder CREATE_COMMAND_PERMS =
- CREATE_COMMAND_LEVEL.createChild("perms_wildcard").description("Allows you to increase the users level temporarily to have all perms");
+ CREATE_COMMAND_LEVEL.createChild("perms_wildcard")
+ .description("Allows you to increase the users level temporarily "
+ + "to have all perms");
public static final PermissionBuilder PORTAL_INFO =
- PORTAL.createChild("info", PermissionBuilder.PermissionDefault.OP).description("Allows you to view portal information");
+ PORTAL.createChild("info", PermissionBuilder.PermissionDefault.OP)
+ .description("Allows you to view portal information");
static {
- // These are to add children which will not be used directly e.g. advancedportals.*
- ROOT.createChild("*", PermissionBuilder.PermissionDefault.OP).description("Gives access to all portal commands")
- .addGrantChild(CREATE_PORTAL)
- .addGrantChild(CREATE_DESTI)
- .addGrantChild(DESTI)
- .addGrantChild(PORTAL)
- .addGrantChild(TELEPORT_DESTI)
- .addGrantChild(REMOVE_DESTI)
- .addGrantChild(LIST_DESTI)
- .addGrantChild(SHOW_DESTI)
- .addGrantChild(SELECTOR)
- .addGrantChild(REMOVE_PORTAL)
- .addGrantChild(LIST_PORTAL)
- .addGrantChild(LANG_UPDATE)
- .addGrantChild(RELOAD)
- .addGrantChild(DISABLE_BEACON)
- .addGrantChild(IMPORT)
- .addGrantChild(SHOW_PORTAL)
- .addGrantChild(PORTAL_INFO)
- .addGrantChild(BUILD);
+ // These are to add children which will not be used directly e.g.
+ // advancedportals.*
+ ROOT.createChild("*", PermissionBuilder.PermissionDefault.OP)
+ .description("Gives access to all portal commands")
+ .addGrantChild(CREATE_PORTAL)
+ .addGrantChild(CREATE_DESTI)
+ .addGrantChild(DESTI)
+ .addGrantChild(PORTAL)
+ .addGrantChild(TELEPORT_DESTI)
+ .addGrantChild(REMOVE_DESTI)
+ .addGrantChild(LIST_DESTI)
+ .addGrantChild(SHOW_DESTI)
+ .addGrantChild(SELECTOR)
+ .addGrantChild(REMOVE_PORTAL)
+ .addGrantChild(LIST_PORTAL)
+ .addGrantChild(LANG_UPDATE)
+ .addGrantChild(RELOAD)
+ .addGrantChild(DISABLE_BEACON)
+ .addGrantChild(IMPORT)
+ .addGrantChild(SHOW_PORTAL)
+ .addGrantChild(PORTAL_INFO)
+ .addGrantChild(BUILD);
- CREATE_COMMAND_LEVEL.createChild("*", PermissionBuilder.PermissionDefault.OP).description("Gives access to all command level raisers")
- .addGrantChild(CREATE_COMMAND_OP)
- .addGrantChild(CREATE_COMMAND_CONSOLE)
- .addGrantChild(CREATE_COMMAND_PERMS);
+ CREATE_COMMAND_LEVEL
+ .createChild("*", PermissionBuilder.PermissionDefault.OP)
+ .description("Gives access to all command level raisers")
+ .addGrantChild(CREATE_COMMAND_OP)
+ .addGrantChild(CREATE_COMMAND_CONSOLE)
+ .addGrantChild(CREATE_COMMAND_PERMS);
}
}
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 035dbaba..98b948a5 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
@@ -14,7 +14,6 @@ import com.sekwah.advancedportals.core.util.Lang;
import com.sekwah.advancedportals.core.warphandler.ActivationData;
import com.sekwah.advancedportals.core.warphandler.Tag;
import com.sekwah.advancedportals.core.warphandler.TriggerType;
-
import java.util.*;
/**
@@ -137,8 +136,9 @@ public class AdvancedPortal implements TagTarget {
* @param triggerType The type of trigger that activated the portal
* @return Whether the portal was successfully activated
*/
- public ActivationResult activate(PlayerContainer player, TriggerType triggerType) {
- if(!isSorted) {
+ public ActivationResult activate(PlayerContainer player,
+ TriggerType triggerType) {
+ if (!isSorted) {
updatePortalTagList();
}
@@ -162,14 +162,17 @@ public class AdvancedPortal implements TagTarget {
ActivationData data = new ActivationData(triggerType);
for (DataTag portalTag : this.portalTags) {
- Tag.Activation activationHandler =
- tagRegistry.getActivationHandler(portalTag.NAME, Tag.TagType.PORTAL);
+ Tag.Activation activationHandler = tagRegistry.getActivationHandler(
+ portalTag.NAME, Tag.TagType.PORTAL);
if (activationHandler != null) {
var preActivated = activationHandler.preActivated(
- this, player, data, this.getArgValues(portalTag.NAME));
+ this, player, data, this.getArgValues(portalTag.NAME));
- if(!preActivated) {
- if(activationHandler instanceof Tag.DenyBehavior denyBehavior && denyBehavior.getDenyBehavior() == Tag.DenyBehavior.Behaviour.SILENT) {
+ if (!preActivated) {
+ if (activationHandler
+ instanceof Tag.DenyBehavior denyBehavior
+ && denyBehavior.getDenyBehavior()
+ == Tag.DenyBehavior.Behaviour.SILENT) {
return ActivationResult.FAILED_DO_NOTHING;
}
return ActivationResult.FAILED_DO_KNOCKBACK;
@@ -177,8 +180,8 @@ public class AdvancedPortal implements TagTarget {
}
}
for (DataTag portalTag : this.portalTags) {
- Tag.Activation activationHandler =
- tagRegistry.getActivationHandler(portalTag.NAME, Tag.TagType.PORTAL);
+ Tag.Activation activationHandler = tagRegistry.getActivationHandler(
+ portalTag.NAME, Tag.TagType.PORTAL);
if (activationHandler != null
&& !activationHandler.activated(
this, player, data, this.getArgValues(portalTag.NAME))) {
@@ -186,8 +189,8 @@ public class AdvancedPortal implements TagTarget {
}
}
for (DataTag portalTag : this.portalTags) {
- Tag.Activation activationHandler =
- tagRegistry.getActivationHandler(portalTag.NAME, Tag.TagType.PORTAL);
+ Tag.Activation activationHandler = tagRegistry.getActivationHandler(
+ portalTag.NAME, Tag.TagType.PORTAL);
if (activationHandler != null) {
activationHandler.postActivated(
this, player, data, this.getArgValues(portalTag.NAME));
diff --git a/core/src/main/java/com/sekwah/advancedportals/core/registry/SubCommandRegistry.java b/core/src/main/java/com/sekwah/advancedportals/core/registry/SubCommandRegistry.java
index 3cd5b180..9ac4f8e6 100644
--- a/core/src/main/java/com/sekwah/advancedportals/core/registry/SubCommandRegistry.java
+++ b/core/src/main/java/com/sekwah/advancedportals/core/registry/SubCommandRegistry.java
@@ -3,7 +3,6 @@ package com.sekwah.advancedportals.core.registry;
import com.google.inject.Inject;
import com.sekwah.advancedportals.core.commands.SubCommand;
import com.sekwah.advancedportals.core.util.InfoLogger;
-
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
diff --git a/core/src/main/java/com/sekwah/advancedportals/core/registry/TagRegistry.java b/core/src/main/java/com/sekwah/advancedportals/core/registry/TagRegistry.java
index 1ea9231d..5bb72eef 100644
--- a/core/src/main/java/com/sekwah/advancedportals/core/registry/TagRegistry.java
+++ b/core/src/main/java/com/sekwah/advancedportals/core/registry/TagRegistry.java
@@ -3,7 +3,6 @@ package com.sekwah.advancedportals.core.registry;
import com.google.inject.Inject;
import com.sekwah.advancedportals.core.AdvancedPortalsCore;
import com.sekwah.advancedportals.core.warphandler.Tag;
-
import java.util.*;
/**
@@ -34,10 +33,12 @@ public class TagRegistry {
* @param arg
* @return
*/
- public Tag.Activation getActivationHandler(String arg, Tag.TagType targetType) {
+ public Tag.Activation getActivationHandler(String arg,
+ Tag.TagType targetType) {
var tag = this.activationTags.get(arg);
- if (tag != null && Arrays.asList(tag.getTagTypes()).contains(targetType)) {
- return tag;
+ if (tag != null
+ && Arrays.asList(tag.getTagTypes()).contains(targetType)) {
+ return tag;
}
return null;
}
diff --git a/core/src/main/java/com/sekwah/advancedportals/core/registry/WarpEffectRegistry.java b/core/src/main/java/com/sekwah/advancedportals/core/registry/WarpEffectRegistry.java
index 463c980f..07b0634a 100644
--- a/core/src/main/java/com/sekwah/advancedportals/core/registry/WarpEffectRegistry.java
+++ b/core/src/main/java/com/sekwah/advancedportals/core/registry/WarpEffectRegistry.java
@@ -4,7 +4,6 @@ import com.google.inject.Inject;
import com.sekwah.advancedportals.core.AdvancedPortalsCore;
import com.sekwah.advancedportals.core.effect.WarpEffect;
import com.sekwah.advancedportals.core.util.InfoLogger;
-
import java.util.HashMap;
import java.util.Map;
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 eb3c3ba6..8bbf8dc3 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
@@ -5,7 +5,6 @@ import com.sekwah.advancedportals.core.repository.ConfigRepository;
import com.sekwah.advancedportals.core.serializeddata.DataStorage;
import com.sekwah.advancedportals.core.serializeddata.config.CommandPortalConfig;
import com.sekwah.advancedportals.core.serializeddata.config.Config;
-
import java.util.HashMap;
@Singleton
diff --git a/core/src/main/java/com/sekwah/advancedportals/core/repository/impl/DestinationRepositoryImpl.java b/core/src/main/java/com/sekwah/advancedportals/core/repository/impl/DestinationRepositoryImpl.java
index bdaffa2c..28d29e33 100644
--- a/core/src/main/java/com/sekwah/advancedportals/core/repository/impl/DestinationRepositoryImpl.java
+++ b/core/src/main/java/com/sekwah/advancedportals/core/repository/impl/DestinationRepositoryImpl.java
@@ -5,10 +5,9 @@ import com.sekwah.advancedportals.core.destination.Destination;
import com.sekwah.advancedportals.core.repository.IDestinationRepository;
import com.sekwah.advancedportals.core.serializeddata.DataStorage;
import com.sekwah.advancedportals.core.tags.NameTag;
-
-import javax.inject.Singleton;
import java.util.ArrayList;
import java.util.List;
+import javax.inject.Singleton;
@Singleton
public class DestinationRepositoryImpl implements IDestinationRepository {
diff --git a/core/src/main/java/com/sekwah/advancedportals/core/repository/impl/PlayerDataRepositoryImpl.java b/core/src/main/java/com/sekwah/advancedportals/core/repository/impl/PlayerDataRepositoryImpl.java
index 635b855b..2265017c 100644
--- a/core/src/main/java/com/sekwah/advancedportals/core/repository/impl/PlayerDataRepositoryImpl.java
+++ b/core/src/main/java/com/sekwah/advancedportals/core/repository/impl/PlayerDataRepositoryImpl.java
@@ -4,7 +4,6 @@ import com.google.inject.Inject;
import com.sekwah.advancedportals.core.repository.IPlayerDataRepository;
import com.sekwah.advancedportals.core.serializeddata.DataStorage;
import com.sekwah.advancedportals.core.serializeddata.PlayerData;
-
import java.util.List;
public class PlayerDataRepositoryImpl implements IPlayerDataRepository {
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 b8f90632..70a7a4bc 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
@@ -7,7 +7,6 @@ import com.sekwah.advancedportals.core.portal.AdvancedPortal;
import com.sekwah.advancedportals.core.repository.IPortalRepository;
import com.sekwah.advancedportals.core.serializeddata.DataStorage;
import com.sekwah.advancedportals.core.tags.NameTag;
-
import java.util.ArrayList;
import java.util.List;
@@ -70,9 +69,9 @@ public class PortalRepositoryImpl implements IPortalRepository {
if (portal != null) {
AdvancedPortalsCore.getInstance()
- .getModule()
- .getInjector()
- .injectMembers(portal);
+ .getModule()
+ .getInjector()
+ .injectMembers(portal);
}
// Forces the name tag to be up-to-date on load
diff --git a/core/src/main/java/com/sekwah/advancedportals/core/serializeddata/DataStorage.java b/core/src/main/java/com/sekwah/advancedportals/core/serializeddata/DataStorage.java
index 9ed14752..00c5be2d 100644
--- a/core/src/main/java/com/sekwah/advancedportals/core/serializeddata/DataStorage.java
+++ b/core/src/main/java/com/sekwah/advancedportals/core/serializeddata/DataStorage.java
@@ -3,18 +3,17 @@ package com.sekwah.advancedportals.core.serializeddata;
import com.google.inject.Inject;
import com.sekwah.advancedportals.core.AdvancedPortalsCore;
import com.sekwah.advancedportals.core.util.InfoLogger;
-import org.yaml.snakeyaml.DumperOptions;
-import org.yaml.snakeyaml.LoaderOptions;
-import org.yaml.snakeyaml.Yaml;
-import org.yaml.snakeyaml.inspector.TagInspector;
-import org.yaml.snakeyaml.nodes.Tag;
-
import java.io.*;
import java.lang.reflect.InvocationTargetException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
+import org.yaml.snakeyaml.DumperOptions;
+import org.yaml.snakeyaml.LoaderOptions;
+import org.yaml.snakeyaml.Yaml;
+import org.yaml.snakeyaml.inspector.TagInspector;
+import org.yaml.snakeyaml.nodes.Tag;
public class DataStorage {
private final File dataFolder;
diff --git a/core/src/main/java/com/sekwah/advancedportals/core/serializeddata/ReflectiveConstructor.java b/core/src/main/java/com/sekwah/advancedportals/core/serializeddata/ReflectiveConstructor.java
index 064b47ea..84cb4035 100644
--- a/core/src/main/java/com/sekwah/advancedportals/core/serializeddata/ReflectiveConstructor.java
+++ b/core/src/main/java/com/sekwah/advancedportals/core/serializeddata/ReflectiveConstructor.java
@@ -1,18 +1,17 @@
package com.sekwah.advancedportals.core.serializeddata;
import com.sekwah.advancedportals.core.util.InfoLogger;
-import org.yaml.snakeyaml.LoaderOptions;
-import org.yaml.snakeyaml.constructor.Constructor;
-import org.yaml.snakeyaml.nodes.*;
-import sun.misc.Unsafe;
-
-import javax.inject.Inject;
import java.lang.reflect.Array;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import javax.inject.Inject;
+import org.yaml.snakeyaml.LoaderOptions;
+import org.yaml.snakeyaml.constructor.Constructor;
+import org.yaml.snakeyaml.nodes.*;
+import sun.misc.Unsafe;
public class ReflectiveConstructor