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 1f01ba14..e74cfa0c 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 @@ -20,7 +20,8 @@ public class BungeeProxyContainer implements ProxyContainer { String command) { // Should never not be true but just to be safe if (proxyPlayer instanceof BungeeProxyPlayerContainer) { - BungeeProxyPlayerContainer playerContainer = (BungeeProxyPlayerContainer) proxyPlayer; + BungeeProxyPlayerContainer playerContainer = + (BungeeProxyPlayerContainer) proxyPlayer; plugin.getProxy().getPluginManager().dispatchCommand( playerContainer.getPlayer(), command); } @@ -31,7 +32,8 @@ public class BungeeProxyContainer implements ProxyContainer { String serverName) { // Should never not be true but just to be safe if (proxyPlayer instanceof BungeeProxyPlayerContainer) { - BungeeProxyPlayerContainer playerContainer = (BungeeProxyPlayerContainer) proxyPlayer; + BungeeProxyPlayerContainer playerContainer = + (BungeeProxyPlayerContainer) proxyPlayer; ServerInfo serverInfo = plugin.getProxy().getServerInfo(serverName); ProxiedPlayer player = playerContainer.getPlayer(); if (serverInfo == null) { 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 4f7e341c..9ac27e57 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/AdvancedPortalsCore.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/AdvancedPortalsCore.java @@ -218,7 +218,8 @@ public class AdvancedPortalsCore { } public void onDisable() { - for (PlayerContainer playerContainer : this.serverContainer.getPlayers()) { + for (PlayerContainer playerContainer : + this.serverContainer.getPlayers()) { playerDataRepository.playerLeave(playerContainer); } this.infoLogger.info(Lang.translate("logger.plugindisable")); 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 3e8b6b92..47f50b55 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/CoreListeners.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/CoreListeners.java @@ -70,13 +70,13 @@ public class CoreListeners { String messageType = buffer.readUTF(); switch (messageType) { - case ProxyMessages.SERVER_DESTI: - { - ServerDestiPacket serverDestiPacket = ServerDestiPacket.decode(buffer); - this.destinationServices.teleportToDestination(serverDestiPacket.getDestination(), player, true); + case ProxyMessages.SERVER_DESTI: { + ServerDestiPacket serverDestiPacket = + ServerDestiPacket.decode(buffer); + this.destinationServices.teleportToDestination( + serverDestiPacket.getDestination(), player, true); } } - } public void tick() { @@ -88,7 +88,8 @@ public class CoreListeners { * @param toLoc */ public void playerMove(PlayerContainer player, PlayerLocation toLoc) { - this.portalServices.checkPortalActivation(player, toLoc, TriggerType.MOVEMENT); + this.portalServices.checkPortalActivation(player, toLoc, + TriggerType.MOVEMENT); } /** @@ -132,7 +133,8 @@ public class CoreListeners { if (itemInHandName.equals("\u00A75Portal Block Placer")) { world.setBlock(blockPos, "NETHER_PORTAL"); for (Direction direction : Direction.values()) { - BlockLocation checkLoc = new BlockLocation(blockPos, direction); + BlockLocation checkLoc = + new BlockLocation(blockPos, direction); if (world.getBlock(checkLoc).equals("NETHER_PORTAL")) { world.setBlockAxis(blockPos, world.getBlockAxis(checkLoc)); @@ -140,127 +142,131 @@ public class CoreListeners { } } return true; - } - else if (itemInHandName.equals("\u00A78End Portal Block Placer")) { - world.setBlock(blockPos, "END_PORTAL"); + } 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; + } return true; } - else if (itemInHandName.equals("\u00A78Gateway Block Placer")) { - world.setBlock(blockPos, "END_GATEWAY"); - world.disableBeacon(blockPos); - return true; + if (portalServices.inPortalRegionProtected(blockPos)) { + if (player != null) { + player.sendMessage(Lang.getNegativePrefix() + + Lang.translate("portal.nobuild")); + } + return false; } return true; } - if (portalServices.inPortalRegionProtected(blockPos)) { - if (player != null) { - player.sendMessage(Lang.getNegativePrefix() - + Lang.translate("portal.nobuild")); - } - return false; + + /** + * 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; } - 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; -} - -/** - * @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")) { + /** + * @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); + } return false; } - WorldContainer world = player.getWorld(); - if (world.getBlockAxis(blockLoc) == BlockAxis.X) { - world.setBlockAxis(blockLoc, BlockAxis.Z); - } else { - world.setBlockAxis(blockLoc, BlockAxis.X); - } - return false; + + return true; } - return true; -} + public void worldChange(PlayerContainer player) { + this.playerDataServices.setJoinCooldown(player); + this.setIfInPortal(player); + } -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 preventEntityCombust(EntityContainer entity) { - return portalServices.inPortalRegion(entity.getBlockLoc(), 2); -} + public boolean entityPortalEvent(EntityContainer entity) { + BlockLocation pos = entity.getBlockLoc(); + if (entity instanceof PlayerContainer) { + PlayerContainer player = (PlayerContainer) entity; + PlayerData playerData = playerDataServices.getPlayerData(player); + if (playerData.getPortalBlockCooldown()) { + return false; + } + } -public boolean entityPortalEvent(EntityContainer entity) { - BlockLocation pos = entity.getBlockLoc(); - if (entity instanceof PlayerContainer ) { - PlayerContainer player = (PlayerContainer) entity; + return !(portalServices.inPortalRegion(pos, 1) + || portalServices.inPortalRegion( + pos.addY((int) entity.getHeight()), 1)); + } + + public boolean playerPortalEvent(PlayerContainer player, + PlayerLocation toLoc) { PlayerData playerData = playerDataServices.getPlayerData(player); + if (playerData.getPortalBlockCooldown()) { return false; } + + PortalServices.PortalActivationResult 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 + BlockLocation pos = player.getBlockLoc(); + + boolean feetInPortal = portalServices.inPortalRegion(pos, 1); + boolean headInPortal = portalServices.inPortalRegion( + pos.addY((int) player.getHeight()), 1); + + return !(feetInPortal || headInPortal); } - return !(portalServices.inPortalRegion(pos, 1) - || portalServices.inPortalRegion( - pos.addY((int) entity.getHeight()), 1)); -} - -public boolean playerPortalEvent(PlayerContainer player, PlayerLocation toLoc) { - PlayerData playerData = playerDataServices.getPlayerData(player); - - if (playerData.getPortalBlockCooldown()) { - return false; + public boolean physicsEvent(BlockLocation blockLocation, String string) { + return !configRepository.getDisablePhysicsEvents() + || !portalServices.inPortalRegionProtected(blockLocation); } - - PortalServices.PortalActivationResult 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 - BlockLocation pos = player.getBlockLoc(); - - boolean feetInPortal = portalServices.inPortalRegion(pos, 1); - boolean 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/commands/CommandWithSubCommands.java b/core/src/main/java/com/sekwah/advancedportals/core/commands/CommandWithSubCommands.java index 0ca5b25c..af31c0ea 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 @@ -36,8 +36,9 @@ public class CommandWithSubCommands implements CommandTemplate { boolean result = this.subCommandRegistry.registerSubCommand(arg, subCommand) || hasRegistered; - if (subCommand instanceof SubCommand.SubCommandOnInit ) { - SubCommand.SubCommandOnInit init = (SubCommand.SubCommandOnInit) subCommand; + if (subCommand instanceof SubCommand.SubCommandOnInit) { + SubCommand.SubCommandOnInit init = + (SubCommand.SubCommandOnInit) subCommand; init.registered(); } return result; 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 38706098..568fa1f6 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.*; import java.util.stream.Collectors; @@ -47,14 +46,14 @@ public abstract class CreateTaggedSubCommand implements SubCommand { } } - if (tag instanceof Tag.AutoComplete - && startsWith) { + if (tag instanceof Tag.AutoComplete && startsWith) { Tag.AutoComplete autoComplete = (Tag.AutoComplete) tag; String argData = split.length == 2 ? split[1] : ""; - List tagSuggestions = autoComplete.autoComplete(argData); + List tagSuggestions = + autoComplete.autoComplete(argData); if (tagSuggestions != null) { - if (tag instanceof Tag.Split ) { + if (tag instanceof Tag.Split) { Tag.Split splitTag = (Tag.Split) tag; String multiTagSplit = splitTag.splitString(); boolean endsWithSplit = @@ -75,9 +74,8 @@ public abstract class CreateTaggedSubCommand implements SubCommand { String baseString = endsWithSplit ? argData : argData.substring( - 0, - argData.lastIndexOf(multiTagSplit) - + 1); + 0, + argData.lastIndexOf(multiTagSplit) + 1); tagSuggestions = tagSuggestions @@ -129,7 +127,8 @@ public abstract class CreateTaggedSubCommand implements SubCommand { suggestions.add(tag.getName()); String[] aliases = tag.getAliases(); if (aliases != null) { - suggestions.addAll(Arrays.stream(aliases).collect(Collectors.toList())); + suggestions.addAll( + Arrays.stream(aliases).collect(Collectors.toList())); } }); @@ -145,7 +144,7 @@ public abstract class CreateTaggedSubCommand implements SubCommand { for (DataTag dataTag : dataTags) { for (Tag tag : relatedTags) { - if (tag instanceof Tag.Split ) { + if (tag instanceof Tag.Split) { Tag.Split splitTag = (Tag.Split) tag; String splitString = splitTag.splitString(); if (splitString != null) { 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 f1eb4a8a..420665ec 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 @@ -75,7 +75,7 @@ public class Destination implements TagTarget { this.destiTags.sort(Comparator.comparingInt(o -> { Tag tag = tagRegistry.getTag(o.NAME); - if (tag instanceof Tag.OrderPriority ) { + if (tag instanceof Tag.OrderPriority) { Tag.OrderPriority tagPriority = (Tag.OrderPriority) tag; return tagPriority.getPriority().ordinal(); } else { 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 72b340a9..be848445 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 @@ -100,7 +100,8 @@ public class PermissionBuilder { case NOT_OP: return !sender.isOp(); default: - throw new IllegalStateException("Unexpected value: " + permissionDefault); + throw new IllegalStateException("Unexpected value: " + + permissionDefault); } } @@ -125,10 +126,5 @@ public class PermissionBuilder { return this; } - public enum PermissionDefault { - TRUE, - FALSE, - OP, - NOT_OP - } + public enum PermissionDefault { TRUE, FALSE, OP, NOT_OP } } 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 ffdbe0a0..1c27e3da 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 @@ -87,7 +87,7 @@ public class AdvancedPortal implements TagTarget { // sort the tags by priority this.portalTags.sort(Comparator.comparingInt(o -> { Tag tag = tagRegistry.getTag(o.NAME); - if (tag instanceof Tag.OrderPriority ) { + if (tag instanceof Tag.OrderPriority) { Tag.OrderPriority tagPriority = (Tag.OrderPriority) tag; return tagPriority.getPriority().ordinal(); } else { @@ -172,8 +172,10 @@ public class AdvancedPortal implements TagTarget { if (!preActivated) { if (activationHandler instanceof Tag.DenyBehavior) { - Tag.DenyBehavior denyBehaviorHandler = (Tag.DenyBehavior) activationHandler; - if (denyBehaviorHandler.getDenyBehavior().equals(Tag.DenyBehavior.Behaviour.SILENT)) { + Tag.DenyBehavior denyBehaviorHandler = + (Tag.DenyBehavior) activationHandler; + if (denyBehaviorHandler.getDenyBehavior().equals( + Tag.DenyBehavior.Behaviour.SILENT)) { return ActivationResult.FAILED_DO_NOTHING; } } 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 3f68abf2..a2ea359f 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 @@ -43,8 +43,8 @@ public class PortalRepositoryImpl implements IPortalRepository { @Override public AdvancedPortal get(String name) { - AdvancedPortal portal = dataStorage.loadFile(AdvancedPortal.class, - fileLocation + name + ".yaml"); + AdvancedPortal portal = dataStorage.loadFile( + AdvancedPortal.class, fileLocation + name + ".yaml"); if (portal != null) { AdvancedPortalsCore.getInstance() .getModule() 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 45dd0570..2916adca 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 @@ -41,7 +41,8 @@ public class DataStorage { ReflectiveRepresenter representer = new ReflectiveRepresenter(options); representer.addClassTag(clazz, Tag.MAP); representer.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); - ReflectiveConstructor constructor = new ReflectiveConstructor(clazz, loaderOptions); + ReflectiveConstructor constructor = + new ReflectiveConstructor(clazz, loaderOptions); AdvancedPortalsCore.getInstance() .getModule() 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 ac29b2a5..fe94f823 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 @@ -72,7 +72,8 @@ public class ReflectiveConstructor extends Constructor { Node node = tuple.getValueNode(); if (node instanceof ScalarNode) { - Object constructedItem = constructFromScalarNode((ScalarNode) node); + Object constructedItem = + constructFromScalarNode((ScalarNode) node); values.put(key, constructedItem); } else if (node instanceof SequenceNode) { SequenceNode sequenceNode = (SequenceNode) node; @@ -131,8 +132,8 @@ public class ReflectiveConstructor extends Constructor { } } catch (Exception e) { infoLogger.warning("Failed to set field " + field.getName() - + " in " + currentClass.getName() - + ": " + e.getMessage()); + + " in " + currentClass.getName() + ": " + + e.getMessage()); infoLogger.error(e); throw new RuntimeException("Failed to set field " + field.getName() + " in " 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 53803d89..346fb35f 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 @@ -154,14 +154,16 @@ public class DestinationServices { player.teleport(this.destinationRepository.get(name).getLoc()); if (doEffect && configRepository.getWarpEffectEnabled()) { - WarpEffect.Visual warpEffectVisual = warpEffectRegistry.getVisualEffect( - configRepository.getWarpVisual()); + WarpEffect.Visual warpEffectVisual = + warpEffectRegistry.getVisualEffect( + configRepository.getWarpVisual()); if (warpEffectVisual != null) { warpEffectVisual.onWarpVisual(player, WarpEffect.Action.ENTER); } - WarpEffect.Sound warpEffectSound = warpEffectRegistry.getSoundEffect( - configRepository.getWarpSound()); + WarpEffect.Sound warpEffectSound = + warpEffectRegistry.getSoundEffect( + configRepository.getWarpSound()); if (warpEffectSound != null) { warpEffectSound.onWarpSound(player, WarpEffect.Action.ENTER); diff --git a/core/src/main/java/com/sekwah/advancedportals/core/services/PlayerDataServices.java b/core/src/main/java/com/sekwah/advancedportals/core/services/PlayerDataServices.java index c5ea10ad..3db72546 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/services/PlayerDataServices.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/services/PlayerDataServices.java @@ -27,7 +27,8 @@ public final class PlayerDataServices { public PlayerData getPlayerData(PlayerContainer player) { return tempDataMap.computeIfAbsent(player.getUUID(), uuid -> { - PlayerData tempData = tempDataRepository.get(player.getUUID().toString()); + PlayerData tempData = + tempDataRepository.get(player.getUUID().toString()); if (tempData == null) { tempData = new PlayerData(); 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 c620b4f8..faec786b 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 @@ -131,7 +131,8 @@ public class PortalServices { return PortalActivationResult.PORTAL_ACTIVATED; case FAILED_DO_KNOCKBACK: playerData.setInPortal(portal.getName()); - double strength = configRepository.getThrowbackStrength(); + double strength = + configRepository.getThrowbackStrength(); PlayerUtils.throwPlayerBack(player, strength); return PortalActivationResult.PORTAL_DENIED; } diff --git a/core/src/main/java/com/sekwah/advancedportals/core/tags/CommandTag.java b/core/src/main/java/com/sekwah/advancedportals/core/tags/CommandTag.java index d5ec6a03..53522023 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/tags/CommandTag.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/tags/CommandTag.java @@ -51,7 +51,8 @@ public class CommandTag implements Tag.Activation, Tag.Split, Tag.Creation { @Override public boolean preActivated(TagTarget target, PlayerContainer player, ActivationData activeData, String[] argData) { - CommandPortalConfig commandPortals = configRepository.getCommandPortals(); + CommandPortalConfig commandPortals = + configRepository.getCommandPortals(); if (!commandPortals.enabled) { player.sendMessage(Lang.getNegativePrefix() @@ -156,7 +157,9 @@ public class CommandTag implements Tag.Activation, Tag.Split, Tag.Creation { public boolean created(TagTarget target, PlayerContainer player, String[] argData) { if (argData != null) { - com.sekwah.advancedportals.core.serializeddata.config.CommandPortalConfig commandPortals = configRepository.getCommandPortals(); + com.sekwah.advancedportals.core.serializeddata.config + .CommandPortalConfig commandPortals = + configRepository.getCommandPortals(); if (!commandPortals.enabled) { player.sendMessage(Lang.getNegativePrefix() + Lang.translate("tag.command.disabled")); @@ -167,37 +170,51 @@ public class CommandTag implements Tag.Activation, Tag.Split, Tag.Creation { switch (executionCommand) { case '!': if (!commandPortals.op) { - player.sendMessage(Lang.getNegativePrefix() - + Lang.translate("tag.command.op.disabled")); + player.sendMessage( + Lang.getNegativePrefix() + + Lang.translate("tag.command.op.disabled")); return false; } - if (!Permissions.CREATE_COMMAND_OP.hasPermission(player)) { - player.sendMessage(Lang.getNegativePrefix() - + Lang.translateInsertVariables("tag.command.nopermission", "OP")); + if (!Permissions.CREATE_COMMAND_OP.hasPermission( + player)) { + player.sendMessage( + Lang.getNegativePrefix() + + Lang.translateInsertVariables( + "tag.command.nopermission", "OP")); return false; } return true; case '#': if (!commandPortals.console) { - player.sendMessage(Lang.getNegativePrefix() - + Lang.translate("tag.command.console.disabled")); + player.sendMessage( + Lang.getNegativePrefix() + + Lang.translate( + "tag.command.console.disabled")); return false; } - if (!Permissions.CREATE_COMMAND_CONSOLE.hasPermission(player)) { - player.sendMessage(Lang.getNegativePrefix() - + Lang.translateInsertVariables("tag.command.nopermission", "Console")); + if (!Permissions.CREATE_COMMAND_CONSOLE.hasPermission( + player)) { + player.sendMessage( + Lang.getNegativePrefix() + + Lang.translateInsertVariables( + "tag.command.nopermission", "Console")); return false; } return true; case '^': if (!commandPortals.permsWildcard) { - player.sendMessage(Lang.getNegativePrefix() - + Lang.translate("tag.command.permswildcard.disabled")); + player.sendMessage( + Lang.getNegativePrefix() + + Lang.translate( + "tag.command.permswildcard.disabled")); return false; } - if (!Permissions.CREATE_COMMAND_PERMS.hasPermission(player)) { - player.sendMessage(Lang.getNegativePrefix() - + Lang.translateInsertVariables("tag.command.nopermission", "*")); + if (!Permissions.CREATE_COMMAND_PERMS.hasPermission( + player)) { + player.sendMessage( + Lang.getNegativePrefix() + + Lang.translateInsertVariables( + "tag.command.nopermission", "*")); return false; } return true; @@ -210,14 +227,10 @@ public class CommandTag implements Tag.Activation, Tag.Split, Tag.Creation { } @Override - public void destroyed(TagTarget target, PlayerContainer player, String[] argData) { + public void destroyed(TagTarget target, PlayerContainer player, + String[] argData) { // Needs created but not destroyed } - public enum CommandLevel{ - OP, - PERMISSION_WILDCARD, - CONSOLE, - PLAYER - } + public enum CommandLevel { OP, PERMISSION_WILDCARD, CONSOLE, PLAYER } } diff --git a/core/src/main/java/com/sekwah/advancedportals/core/tags/CooldownTag.java b/core/src/main/java/com/sekwah/advancedportals/core/tags/CooldownTag.java index 2f798a00..642c27f9 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/tags/CooldownTag.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/tags/CooldownTag.java @@ -81,7 +81,8 @@ public class CooldownTag implements Tag.Activation, Tag.Creation { if (activationData.hasActivated()) { if (target instanceof AdvancedPortal) { AdvancedPortal portal = (AdvancedPortal) target; - PlayerData playerData = playerDataServices.getPlayerData(player); + PlayerData playerData = + playerDataServices.getPlayerData(player); try { playerData.setPortalCooldown( portal.getName(), Integer.parseInt(argData[0]) * 1000); diff --git a/core/src/main/java/com/sekwah/advancedportals/core/tags/DestiTag.java b/core/src/main/java/com/sekwah/advancedportals/core/tags/DestiTag.java index e00a9ea1..c2528beb 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/tags/DestiTag.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/tags/DestiTag.java @@ -151,10 +151,12 @@ public class DestiTag implements Tag.Activation, Tag.AutoComplete, Tag.Split { } if (destination != null) { - WarpEffect.Visual warpEffectVisual = warpEffectRegistry.getVisualEffect( - configRepository.getWarpVisual()); - WarpEffect.Sound warpEffectSound = warpEffectRegistry.getSoundEffect( - configRepository.getWarpSound()); + WarpEffect.Visual warpEffectVisual = + warpEffectRegistry.getVisualEffect( + configRepository.getWarpVisual()); + WarpEffect.Sound warpEffectSound = + warpEffectRegistry.getSoundEffect( + configRepository.getWarpSound()); if (configRepository.getWarpEffectEnabled()) { if (warpEffectVisual != null) { warpEffectVisual.onWarpVisual(player, diff --git a/core/src/main/java/com/sekwah/advancedportals/core/tags/PortalEventTag.java b/core/src/main/java/com/sekwah/advancedportals/core/tags/PortalEventTag.java index 60d6322b..2e4a18e9 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/tags/PortalEventTag.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/tags/PortalEventTag.java @@ -11,7 +11,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.Arrays; import java.util.List; import java.util.Objects; diff --git a/core/src/main/java/com/sekwah/advancedportals/core/tags/TriggerBlockTag.java b/core/src/main/java/com/sekwah/advancedportals/core/tags/TriggerBlockTag.java index 69e7e564..498c0cec 100644 --- a/core/src/main/java/com/sekwah/advancedportals/core/tags/TriggerBlockTag.java +++ b/core/src/main/java/com/sekwah/advancedportals/core/tags/TriggerBlockTag.java @@ -40,7 +40,8 @@ public class TriggerBlockTag @Override public List autoComplete(String argData) { - List triggerBlocks = serverContainer.getCommonTriggerBlocks() + List triggerBlocks = + serverContainer.getCommonTriggerBlocks() .stream() .filter(block -> block.contains(argData)) .collect(Collectors.toList()); 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 020c80fa..06f52601 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 @@ -135,7 +135,8 @@ public class Lang { repeatedEquals.append("="); } - return "\u00A7e" + repeatedEquals.toString() + " " + title + " \u00A7e" + repeatedEquals.toString(); + return "\u00A7e" + repeatedEquals.toString() + " " + title + " \u00A7e" + + repeatedEquals.toString(); } private void injectTranslations(String fileName) { diff --git a/proxycore/src/main/java/com/sekwah/advancedportals/proxycore/AdvancedPortalsProxyCore.java b/proxycore/src/main/java/com/sekwah/advancedportals/proxycore/AdvancedPortalsProxyCore.java index 058b61fb..45fa784b 100644 --- a/proxycore/src/main/java/com/sekwah/advancedportals/proxycore/AdvancedPortalsProxyCore.java +++ b/proxycore/src/main/java/com/sekwah/advancedportals/proxycore/AdvancedPortalsProxyCore.java @@ -66,24 +66,34 @@ public class AdvancedPortalsProxyCore { // packets switch (messageType) { case ProxyMessages.PROXY_TRANSFER: - ProxyTransferPacket transferPacket = ProxyTransferPacket.decode(buffer); - this.logger.info("Transfer request for " + player.getName() + " to " + transferPacket.getServerName()); - this.proxyContainer.transferPlayer(player, transferPacket.getServerName()); + ProxyTransferPacket transferPacket = + ProxyTransferPacket.decode(buffer); + this.logger.info("Transfer request for " + player.getName() + + " to " + transferPacket.getServerName()); + this.proxyContainer.transferPlayer( + player, transferPacket.getServerName()); break; case ProxyMessages.PROXY_COMMAND: - ProxyCommandPacket commandPacket = ProxyCommandPacket.decode(buffer); - this.logger.info("Command request for " + player.getName() + " to run /" + commandPacket.getCommand()); - this.proxyContainer.invokeCommand(player, commandPacket.getCommand()); + ProxyCommandPacket commandPacket = + ProxyCommandPacket.decode(buffer); + this.logger.info("Command request for " + player.getName() + + " to run /" + commandPacket.getCommand()); + this.proxyContainer.invokeCommand(player, + commandPacket.getCommand()); break; case ProxyMessages.PROXY_TRANSFER_DESTI: - ProxyTransferDestiPacket transferDestiPacket = ProxyTransferDestiPacket.decode(buffer); - this.proxyContainer.transferPlayer(player, transferDestiPacket.getServerName()); - this.playerJoinMap.put(player.getUUID(), new ProxyJoinData(transferDestiPacket.getDestination(), transferDestiPacket.getServerName())); + ProxyTransferDestiPacket transferDestiPacket = + ProxyTransferDestiPacket.decode(buffer); + this.proxyContainer.transferPlayer( + player, transferDestiPacket.getServerName()); + this.playerJoinMap.put( + player.getUUID(), + new ProxyJoinData(transferDestiPacket.getDestination(), + transferDestiPacket.getServerName())); break; default: this.logger.info("Unknown message type: " + messageType); break; } - } } diff --git a/spigot/src/main/java/com/sekwah/advancedportals/spigot/AdvancedPortalsPlugin.java b/spigot/src/main/java/com/sekwah/advancedportals/spigot/AdvancedPortalsPlugin.java index 2a97205d..3997c3d2 100644 --- a/spigot/src/main/java/com/sekwah/advancedportals/spigot/AdvancedPortalsPlugin.java +++ b/spigot/src/main/java/com/sekwah/advancedportals/spigot/AdvancedPortalsPlugin.java @@ -54,7 +54,8 @@ public class AdvancedPortalsPlugin extends JavaPlugin { String mcVersion = this.getServer().getVersion(); Pattern pattern = Pattern.compile("\\(MC: ([\\d.]+)\\)"); Matcher matcher = pattern.matcher(mcVersion); - SpigotServerContainer serverContainer = new SpigotServerContainer(this.getServer()); + SpigotServerContainer serverContainer = + new SpigotServerContainer(this.getServer()); this.portalsCore = new AdvancedPortalsCore( matcher.find() ? matcher.group(1) : "0.0.0", this.getDataFolder(), new SpigotInfoLogger(this), serverContainer); diff --git a/spigot/src/main/java/com/sekwah/advancedportals/spigot/PermissionsGeneratorSpigot.java b/spigot/src/main/java/com/sekwah/advancedportals/spigot/PermissionsGeneratorSpigot.java index 685607e2..1f345a56 100644 --- a/spigot/src/main/java/com/sekwah/advancedportals/spigot/PermissionsGeneratorSpigot.java +++ b/spigot/src/main/java/com/sekwah/advancedportals/spigot/PermissionsGeneratorSpigot.java @@ -2,7 +2,6 @@ package com.sekwah.advancedportals.spigot; import com.sekwah.advancedportals.core.permissions.PermissionBuilder; import com.sekwah.advancedportals.core.permissions.Permissions; - import java.util.List; public class PermissionsGeneratorSpigot { diff --git a/spigot/src/main/java/com/sekwah/advancedportals/spigot/commands/subcommands/portal/ImportPortalSubCommand.java b/spigot/src/main/java/com/sekwah/advancedportals/spigot/commands/subcommands/portal/ImportPortalSubCommand.java index 1956221f..b9828e6d 100644 --- a/spigot/src/main/java/com/sekwah/advancedportals/spigot/commands/subcommands/portal/ImportPortalSubCommand.java +++ b/spigot/src/main/java/com/sekwah/advancedportals/spigot/commands/subcommands/portal/ImportPortalSubCommand.java @@ -12,10 +12,9 @@ import com.sekwah.advancedportals.shadowed.inject.Inject; import com.sekwah.advancedportals.spigot.AdvancedPortalsPlugin; import com.sekwah.advancedportals.spigot.importer.ConfigAccessor; import com.sekwah.advancedportals.spigot.importer.LegacyImporter; -import org.bukkit.configuration.file.FileConfiguration; - import java.util.List; import java.util.Set; +import org.bukkit.configuration.file.FileConfiguration; public class ImportPortalSubCommand implements SubCommand { @Inject diff --git a/spigot/src/main/java/com/sekwah/advancedportals/spigot/connector/container/SpigotServerContainer.java b/spigot/src/main/java/com/sekwah/advancedportals/spigot/connector/container/SpigotServerContainer.java index 6e9e6c43..524950f0 100644 --- a/spigot/src/main/java/com/sekwah/advancedportals/spigot/connector/container/SpigotServerContainer.java +++ b/spigot/src/main/java/com/sekwah/advancedportals/spigot/connector/container/SpigotServerContainer.java @@ -11,7 +11,6 @@ import java.util.Arrays; import java.util.List; import java.util.UUID; import java.util.stream.Collectors; - import org.bukkit.Material; import org.bukkit.Server; import org.bukkit.World; @@ -33,7 +32,9 @@ public class SpigotServerContainer implements ServerContainer { .collect(Collectors.toList()); private final List fullTriggerBlockList = - Arrays.stream(Material.values()).map(Enum::name).collect(Collectors.toList()); + Arrays.stream(Material.values()) + .map(Enum::name) + .collect(Collectors.toList()); public SpigotServerContainer(Server server) { this.server = server; 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 0e33571f..7836b462 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 @@ -54,7 +54,7 @@ public class SpigotWorldContainer implements WorldContainer { @Override public BlockAxis getBlockAxis(BlockLocation location) { Block block = world.getBlockAt(location.getPosX(), location.getPosY(), - location.getPosZ()); + location.getPosZ()); BlockData matData = block.getState().getBlockData(); if (matData instanceof Orientable) { Orientable rotatable = (Orientable) matData; @@ -70,7 +70,7 @@ public class SpigotWorldContainer implements WorldContainer { @Override public void setBlockAxis(BlockLocation location, BlockAxis axis) { Block block = world.getBlockAt(location.getPosX(), location.getPosY(), - location.getPosZ()); + location.getPosZ()); BlockData matData = block.getState().getBlockData(); if (matData instanceof Orientable) { Orientable rotatable = (Orientable) matData; diff --git a/spigot/src/main/java/com/sekwah/advancedportals/spigot/importer/LegacyImporter.java b/spigot/src/main/java/com/sekwah/advancedportals/spigot/importer/LegacyImporter.java index 7d960d5b..810faa34 100644 --- a/spigot/src/main/java/com/sekwah/advancedportals/spigot/importer/LegacyImporter.java +++ b/spigot/src/main/java/com/sekwah/advancedportals/spigot/importer/LegacyImporter.java @@ -12,10 +12,8 @@ import com.sekwah.advancedportals.core.serializeddata.config.WarpEffectConfig; import com.sekwah.advancedportals.core.services.DestinationServices; import com.sekwah.advancedportals.core.services.PortalServices; import com.sekwah.advancedportals.spigot.AdvancedPortalsPlugin; - import java.util.*; import java.util.stream.Collectors; - import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.FileConfiguration; @@ -44,7 +42,8 @@ public class LegacyImporter { config.getInt(portalName + ".pos2.Z")); List args = new ArrayList<>(); args.add(new DataTag("name", portalName)); - String triggerblock = config.getString(portalName + ".triggerblock"); + String triggerblock = + config.getString(portalName + ".triggerblock"); if (triggerblock != null) args.add(new DataTag("triggerblock", triggerblock.split(","))); // It's called bungee as that's the implementation behind it @@ -103,7 +102,8 @@ public class LegacyImporter { args.removeIf(dataTag -> dataTag.NAME.equals("delayed")); } - AdvancedPortal portal = portalServices.createPortal(null, pos1, pos2, args); + AdvancedPortal portal = + portalServices.createPortal(null, pos1, pos2, args); if (portal != null) count++; @@ -130,7 +130,7 @@ public class LegacyImporter { config.getDouble(destiPos + ".Z"), (float) config.getDouble(destiPos + ".yaw"), (float) config.getDouble(destiPos + ".pitch")), - Collections.singletonList(new DataTag("name", destiName))); + Collections.singletonList(new DataTag("name", destiName))); if (desti != null) count++; } diff --git a/spigot/src/main/java/com/sekwah/advancedportals/spigot/tags/ConditionsTag.java b/spigot/src/main/java/com/sekwah/advancedportals/spigot/tags/ConditionsTag.java index f97b70cc..82c6e2ca 100644 --- a/spigot/src/main/java/com/sekwah/advancedportals/spigot/tags/ConditionsTag.java +++ b/spigot/src/main/java/com/sekwah/advancedportals/spigot/tags/ConditionsTag.java @@ -151,25 +151,25 @@ public class ConditionsTag implements Tag.Activation, Tag.Split, Tag.Creation { } @Override - public boolean created(TagTarget target, PlayerContainer player, String[] argData) { + public boolean created(TagTarget target, PlayerContainer player, + String[] argData) { for (String condition : argData) { - if (player instanceof SpigotPlayerContainer) { - SpigotPlayerContainer spigotPlayer = - (SpigotPlayerContainer) player; - if (!checkConditions(condition, - spigotPlayer.getPlayer())) { - spigotPlayer.sendMessage( - Lang.getNegativePrefix() - + Lang.translate("tag.conditions.invalid")); - return false; - } - } - } - return true; - } - - @Override - public void destroyed(TagTarget target, PlayerContainer player, - String[] argData) { + if (player instanceof SpigotPlayerContainer) { + SpigotPlayerContainer spigotPlayer = + (SpigotPlayerContainer) player; + if (!checkConditions(condition, spigotPlayer.getPlayer())) { + spigotPlayer.sendMessage( + Lang.getNegativePrefix() + + Lang.translate("tag.conditions.invalid")); + return false; + } } } + return true; + } + + @Override + public void destroyed(TagTarget target, PlayerContainer player, + String[] argData) { + } +} diff --git a/spigot/src/main/java/com/sekwah/advancedportals/spigot/warpeffects/EnderWarpEffect.java b/spigot/src/main/java/com/sekwah/advancedportals/spigot/warpeffects/EnderWarpEffect.java index 1bffe884..93dcc78a 100644 --- a/spigot/src/main/java/com/sekwah/advancedportals/spigot/warpeffects/EnderWarpEffect.java +++ b/spigot/src/main/java/com/sekwah/advancedportals/spigot/warpeffects/EnderWarpEffect.java @@ -10,8 +10,7 @@ public class EnderWarpEffect implements WarpEffect.Visual, WarpEffect.Sound { @Override public void onWarpSound(PlayerContainer playerContainer, WarpEffect.Action action) { - if (playerContainer - instanceof SpigotPlayerContainer) { + if (playerContainer instanceof SpigotPlayerContainer) { SpigotPlayerContainer spigotPlayerContainer = (SpigotPlayerContainer) playerContainer; org.bukkit.entity.Player player = spigotPlayerContainer.getPlayer(); @@ -24,8 +23,7 @@ public class EnderWarpEffect implements WarpEffect.Visual, WarpEffect.Sound { @Override public void onWarpVisual(PlayerContainer playerContainer, WarpEffect.Action action) { - if (playerContainer - instanceof SpigotPlayerContainer) { + if (playerContainer instanceof SpigotPlayerContainer) { SpigotPlayerContainer spigotPlayerContainer = (SpigotPlayerContainer) playerContainer; Player player = spigotPlayerContainer.getPlayer(); diff --git a/velocity/src/main/java/com/sekwah/advancedportals/velocity/AdvancedPortalsVelocityPlugin.java b/velocity/src/main/java/com/sekwah/advancedportals/velocity/AdvancedPortalsVelocityPlugin.java index 149d4c04..ca094933 100644 --- a/velocity/src/main/java/com/sekwah/advancedportals/velocity/AdvancedPortalsVelocityPlugin.java +++ b/velocity/src/main/java/com/sekwah/advancedportals/velocity/AdvancedPortalsVelocityPlugin.java @@ -50,9 +50,9 @@ public class AdvancedPortalsVelocityPlugin { @Subscribe public void onPluginMessage(PluginMessageEvent event) { if (event.getIdentifier().equals(AP_CHANNEL)) { - if (event.getSource() - instanceof ServerConnection) { - ServerConnection serverConnection = (ServerConnection) event.getSource(); + if (event.getSource() instanceof ServerConnection) { + ServerConnection serverConnection = + (ServerConnection) event.getSource(); this.proxyCore.incomingMessage( new VelocityProxyPlayerContainer( serverConnection.getPlayer(), AP_CHANNEL), diff --git a/velocity/src/main/java/com/sekwah/advancedportals/velocity/connector/container/VelocityProxyContainer.java b/velocity/src/main/java/com/sekwah/advancedportals/velocity/connector/container/VelocityProxyContainer.java index 67b57d5a..c53d3ab1 100644 --- a/velocity/src/main/java/com/sekwah/advancedportals/velocity/connector/container/VelocityProxyContainer.java +++ b/velocity/src/main/java/com/sekwah/advancedportals/velocity/connector/container/VelocityProxyContainer.java @@ -15,10 +15,9 @@ public class VelocityProxyContainer implements ProxyContainer { @Override public void invokeCommand(ProxyPlayerContainer proxyPlayer, String command) { - if (proxyPlayer - instanceof VelocityProxyPlayerContainer) { - VelocityProxyPlayerContainer playerContainer - = (VelocityProxyPlayerContainer) proxyPlayer; + if (proxyPlayer instanceof VelocityProxyPlayerContainer) { + VelocityProxyPlayerContainer playerContainer = + (VelocityProxyPlayerContainer) proxyPlayer; this.proxy.getCommandManager().executeAsync( playerContainer.getPlayer(), command); } @@ -27,18 +26,18 @@ public class VelocityProxyContainer implements ProxyContainer { @Override public void transferPlayer(ProxyPlayerContainer proxyPlayer, String serverName) { - if (proxyPlayer - instanceof VelocityProxyPlayerContainer) { - VelocityProxyPlayerContainer playerContainer - = (VelocityProxyPlayerContainer) proxyPlayer; + if (proxyPlayer instanceof VelocityProxyPlayerContainer) { + VelocityProxyPlayerContainer playerContainer = + (VelocityProxyPlayerContainer) proxyPlayer; this.proxy.getServer(serverName); if (this.proxy.getServer(serverName).isPresent()) { playerContainer.getPlayer() - .createConnectionRequest(this.proxy.getServer(serverName).get()) - .fireAndForget(); + .createConnectionRequest( + this.proxy.getServer(serverName).get()) + .fireAndForget(); } else { playerContainer.getPlayer().sendMessage( - Component.text("Could not find server: " + serverName)); + Component.text("Could not find server: " + serverName)); } } }