diff --git a/src/main/java/org/sgrewritten/stargate/api/network/PortalBuilder.java b/src/main/java/org/sgrewritten/stargate/api/network/PortalBuilder.java index 9973bb91..397cc960 100644 --- a/src/main/java/org/sgrewritten/stargate/api/network/PortalBuilder.java +++ b/src/main/java/org/sgrewritten/stargate/api/network/PortalBuilder.java @@ -312,7 +312,7 @@ public RealPortal build() throws TranslatableException, GateConflictException, N String unformattedMessage = stargateAPI.getLanguageManager().getMessage(TranslatableMessage.CREATE); msg = TranslatableMessageFormatter.formatNetwork(unformattedMessage, network.getName()); } - if (flags.contains(PortalFlag.FANCY_INTER_SERVER)) { + if (flags.contains(PortalFlag.INTER_SERVER)) { msg = msg + " " + stargateAPI.getLanguageManager().getString(TranslatableMessage.UNIMPLEMENTED_INTER_SERVER); } MessageUtils.sendMessageFromPortal(portal, messageTarget, msg, MessageType.CREATE); @@ -356,7 +356,7 @@ private void finalChecks(RealPortal portal, Network network) { if (SpawnDetectionHelper.isInterferingWithSpawnProtection(gateAPI)) { MessageUtils.sendMessage(messageTarget, stargateAPI.getLanguageManager().getWarningMessage(TranslatableMessage.SPAWN_CHUNKS_CONFLICTING)); } - if (portal.hasFlag(PortalFlag.FANCY_INTER_SERVER)) { + if (portal.hasFlag(PortalFlag.INTER_SERVER)) { Network inflictingNetwork = NetworkCreationHelper.getInterServerLocalConflict(network, stargateAPI.getRegistry()); MessageUtils.sendMessage(messageTarget, TranslatableMessageFormatter.formatUnimplementedConflictMessage(network, inflictingNetwork, stargateAPI.getLanguageManager())); @@ -376,7 +376,7 @@ private void economyCheck(RealPortal portal) throws LocalisedMessageException { private void flagChecks(Set flags) throws TranslatableException { //Display an error if trying to create portals across servers while the feature is disabled - if ((flags.contains(PortalFlag.BUNGEE) || flags.contains(PortalFlag.FANCY_INTER_SERVER)) + if ((flags.contains(PortalFlag.BUNGEE) || flags.contains(PortalFlag.INTER_SERVER)) && !ConfigurationHelper.getBoolean(ConfigurationOption.USING_BUNGEE)) { MessageUtils.sendMessage(messageTarget, stargateAPI.getLanguageManager().getWarningMessage(TranslatableMessage.BUNGEE_DISABLED)); throw new TranslatableException("Bungee is disabled") { @@ -386,7 +386,7 @@ protected TranslatableMessage getTranslatableMessage() { } }; } - if (flags.contains(PortalFlag.FANCY_INTER_SERVER) && !ConfigurationHelper.getBoolean( + if (flags.contains(PortalFlag.INTER_SERVER) && !ConfigurationHelper.getBoolean( ConfigurationOption.USING_REMOTE_DATABASE)) { MessageUtils.sendMessage(messageTarget, stargateAPI.getLanguageManager().getWarningMessage(TranslatableMessage.INTER_SERVER_DISABLED)); throw new TranslatableException("Bungee networks are disabled") { diff --git a/src/main/java/org/sgrewritten/stargate/api/network/portal/PortalFlag.java b/src/main/java/org/sgrewritten/stargate/api/network/portal/PortalFlag.java index 0aeb45e6..814f741c 100644 --- a/src/main/java/org/sgrewritten/stargate/api/network/portal/PortalFlag.java +++ b/src/main/java/org/sgrewritten/stargate/api/network/portal/PortalFlag.java @@ -23,7 +23,7 @@ public enum PortalFlag { /** * An across-server stargate using the new and better protocol */ - FANCY_INTER_SERVER('I', true, false), + INTER_SERVER('I', true, false), /** * A stargate which is always on and always open diff --git a/src/main/java/org/sgrewritten/stargate/database/SQLDatabase.java b/src/main/java/org/sgrewritten/stargate/database/SQLDatabase.java index 54867902..576e6542 100644 --- a/src/main/java/org/sgrewritten/stargate/database/SQLDatabase.java +++ b/src/main/java/org/sgrewritten/stargate/database/SQLDatabase.java @@ -364,7 +364,7 @@ private boolean registerVirtualPortal(StorageType portalType, PortalData portalD * @return

The resulting network, or null if invalid

*/ private Network getNetwork(PortalData portalData, RegistryAPI registry, NetworkManager networkManager) { - StorageType storageType = portalData.flags().contains(PortalFlag.FANCY_INTER_SERVER) ? StorageType.INTER_SERVER : StorageType.LOCAL; + StorageType storageType = portalData.flags().contains(PortalFlag.INTER_SERVER) ? StorageType.INTER_SERVER : StorageType.LOCAL; String targetNetwork = portalData.networkName(); if (portalData.flags().contains(PortalFlag.BUNGEE)) { targetNetwork = ConfigurationHelper.getString(ConfigurationOption.LEGACY_BUNGEE_NETWORK); diff --git a/src/main/java/org/sgrewritten/stargate/manager/StargatePermissionManager.java b/src/main/java/org/sgrewritten/stargate/manager/StargatePermissionManager.java index a6d86038..b31b57ac 100644 --- a/src/main/java/org/sgrewritten/stargate/manager/StargatePermissionManager.java +++ b/src/main/java/org/sgrewritten/stargate/manager/StargatePermissionManager.java @@ -238,7 +238,7 @@ private String determineTranslatableMessageFromPermission(String permissionNode) } if (permissionNode.contains("type")) { PortalFlag flag = PortalFlag.valueOf(permissionNode.split(".type.")[1].charAt(0)); - if (flag == PortalFlag.BUNGEE || flag == PortalFlag.FANCY_INTER_SERVER) { + if (flag == PortalFlag.BUNGEE || flag == PortalFlag.INTER_SERVER) { return languageManager.getErrorMessage(TranslatableMessage.BUNGEE_DENY); } } diff --git a/src/main/java/org/sgrewritten/stargate/network/StargateNetworkManager.java b/src/main/java/org/sgrewritten/stargate/network/StargateNetworkManager.java index 23698e4d..2b2c7ab1 100644 --- a/src/main/java/org/sgrewritten/stargate/network/StargateNetworkManager.java +++ b/src/main/java/org/sgrewritten/stargate/network/StargateNetworkManager.java @@ -58,7 +58,7 @@ public StargateNetworkManager(RegistryAPI registryAPI, StorageAPI storageAPI) { HighlightingStyle highlight = HighlightingStyle.getHighlightType(name); String unHighlightedName = NameHelper.getNormalizedName(HighlightingStyle.getNameFromHighlightedText(name)); TwoTuple data; - StorageType storageType = flags.contains(PortalFlag.FANCY_INTER_SERVER) ? StorageType.INTER_SERVER : StorageType.LOCAL; + StorageType storageType = flags.contains(PortalFlag.INTER_SERVER) ? StorageType.INTER_SERVER : StorageType.LOCAL; if (flags.contains(NetworkType.TERMINAL.getRelatedFlag())) { data = new TwoTuple<>(NetworkType.TERMINAL, unHighlightedName); @@ -185,7 +185,7 @@ public void run() { @Override public Network createNetwork(String targetNetwork, Set flags, boolean isForced) throws InvalidNameException, NameLengthException, NameConflictException, UnimplementedFlagException { - return this.createNetwork(targetNetwork, NetworkType.getNetworkTypeFromFlags(flags), flags.contains(PortalFlag.FANCY_INTER_SERVER) ? StorageType.INTER_SERVER : StorageType.LOCAL, isForced); + return this.createNetwork(targetNetwork, NetworkType.getNetworkTypeFromFlags(flags), flags.contains(PortalFlag.INTER_SERVER) ? StorageType.INTER_SERVER : StorageType.LOCAL, isForced); } diff --git a/src/main/java/org/sgrewritten/stargate/network/portal/StargatePortal.java b/src/main/java/org/sgrewritten/stargate/network/portal/StargatePortal.java index 99c41705..a32a3d2a 100644 --- a/src/main/java/org/sgrewritten/stargate/network/portal/StargatePortal.java +++ b/src/main/java/org/sgrewritten/stargate/network/portal/StargatePortal.java @@ -51,9 +51,7 @@ import org.sgrewritten.stargate.util.portal.PortalHelper; import java.util.ArrayList; -import java.util.Arrays; import java.util.EnumSet; -import java.util.HashSet; import java.util.List; import java.util.Objects; import java.util.Set; @@ -558,7 +556,7 @@ public String getMetadata() { @Override public StorageType getStorageType() { - return (flags.contains(PortalFlag.FANCY_INTER_SERVER) ? StorageType.INTER_SERVER : StorageType.LOCAL); + return (flags.contains(PortalFlag.INTER_SERVER) ? StorageType.INTER_SERVER : StorageType.LOCAL); } @Override diff --git a/src/main/java/org/sgrewritten/stargate/network/portal/VirtualPortal.java b/src/main/java/org/sgrewritten/stargate/network/portal/VirtualPortal.java index 3cf2cd36..ec537e68 100644 --- a/src/main/java/org/sgrewritten/stargate/network/portal/VirtualPortal.java +++ b/src/main/java/org/sgrewritten/stargate/network/portal/VirtualPortal.java @@ -216,7 +216,7 @@ public String getServer() { } public StorageType getStorageType() { - return (flags.contains(PortalFlag.FANCY_INTER_SERVER) ? StorageType.INTER_SERVER : StorageType.LOCAL); + return (flags.contains(PortalFlag.INTER_SERVER) ? StorageType.INTER_SERVER : StorageType.LOCAL); } @Override diff --git a/src/main/java/org/sgrewritten/stargate/network/portal/formatting/LineColorFormatter.java b/src/main/java/org/sgrewritten/stargate/network/portal/formatting/LineColorFormatter.java index 1a7eea94..9a29e53a 100644 --- a/src/main/java/org/sgrewritten/stargate/network/portal/formatting/LineColorFormatter.java +++ b/src/main/java/org/sgrewritten/stargate/network/portal/formatting/LineColorFormatter.java @@ -163,7 +163,7 @@ private ChatColor getFlagColor(Portal portal) { return null; } if (portal instanceof VirtualPortal) { - return ColorRegistry.FLAG_COLORS.get(PortalFlag.FANCY_INTER_SERVER); + return ColorRegistry.FLAG_COLORS.get(PortalFlag.INTER_SERVER); } for (PortalFlag flag : flagPriority) { if (portal.hasFlag(flag)) { diff --git a/src/main/java/org/sgrewritten/stargate/util/LegacyPortalStorageLoader.java b/src/main/java/org/sgrewritten/stargate/util/LegacyPortalStorageLoader.java index d5f3aba0..9859586f 100644 --- a/src/main/java/org/sgrewritten/stargate/util/LegacyPortalStorageLoader.java +++ b/src/main/java/org/sgrewritten/stargate/util/LegacyPortalStorageLoader.java @@ -107,7 +107,7 @@ private static Portal readPortal(String line, World world, StargateAPI stargateA } Network network = stargateAPI.getRegistry().getNetwork(portalData.networkName(), - portalData.flags().contains(PortalFlag.FANCY_INTER_SERVER) ? StorageType.INTER_SERVER : StorageType.LOCAL); + portalData.flags().contains(PortalFlag.INTER_SERVER) ? StorageType.INTER_SERVER : StorageType.LOCAL); Stargate.log(Level.INFO, "fetched networkName: " + portalData.networkName()); if (network == null) { diff --git a/src/test/java/org/sgrewritten/stargate/network/portal/TestPortalBuilder.java b/src/test/java/org/sgrewritten/stargate/network/portal/TestPortalBuilder.java index f3adcc52..8d51f130 100644 --- a/src/test/java/org/sgrewritten/stargate/network/portal/TestPortalBuilder.java +++ b/src/test/java/org/sgrewritten/stargate/network/portal/TestPortalBuilder.java @@ -120,9 +120,9 @@ public RealPortal build() throws InvalidStructureException, GateConflictExceptio unrecognisedFlags = new HashSet<>(); } if (storageType == StorageType.LOCAL) { - flags.remove(PortalFlag.FANCY_INTER_SERVER); + flags.remove(PortalFlag.INTER_SERVER); } else { - flags.add(PortalFlag.FANCY_INTER_SERVER); + flags.add(PortalFlag.INTER_SERVER); } flags.add(network.getType().getRelatedFlag()); if (name == null) {