3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-25 07:40:08 +01:00

Hold config values in fields

Dieser Commit ist enthalten in:
KennyTV 2019-11-22 22:00:41 +01:00
Ursprung faaa252fa8
Commit 907516eb71
7 geänderte Dateien mit 215 neuen und 125 gelöschten Zeilen

Datei anzeigen

@ -1,7 +1,7 @@
package us.myles.ViaVersion.bukkit.platform; package us.myles.ViaVersion.bukkit.platform;
import org.bukkit.plugin.Plugin;
import us.myles.ViaVersion.AbstractViaConfig; import us.myles.ViaVersion.AbstractViaConfig;
import us.myles.ViaVersion.ViaVersionPlugin;
import us.myles.ViaVersion.api.Via; import us.myles.ViaVersion.api.Via;
import java.io.File; import java.io.File;
@ -12,13 +12,25 @@ import java.util.Map;
public class BukkitViaConfig extends AbstractViaConfig { public class BukkitViaConfig extends AbstractViaConfig {
private static final List<String> UNSUPPORTED = Arrays.asList("bungee-ping-interval", "bungee-ping-save", "bungee-servers", "velocity-ping-interval", "velocity-ping-save", "velocity-servers"); private static final List<String> UNSUPPORTED = Arrays.asList("bungee-ping-interval", "bungee-ping-save", "bungee-servers", "velocity-ping-interval", "velocity-ping-save", "velocity-servers");
private boolean antiXRay;
private boolean quickMoveActionFix;
private boolean hitboxFix1_9;
private boolean hitboxFix1_14;
public BukkitViaConfig() { public BukkitViaConfig() {
super(new File(((ViaVersionPlugin) Via.getPlatform()).getDataFolder(), "config.yml")); super(new File(((Plugin) Via.getPlatform()).getDataFolder(), "config.yml"));
// Load config
reloadConfig(); reloadConfig();
} }
@Override
protected void loadFields() {
super.loadFields();
antiXRay = getBoolean("anti-xray-patch", true);
quickMoveActionFix = getBoolean("quick-move-action-fix", false);
hitboxFix1_9 = getBoolean("change-1_9-hitbox", false);
hitboxFix1_14 = getBoolean("change-1_14-hitbox", false);
}
@Override @Override
public URL getDefaultConfigURL() { public URL getDefaultConfigURL() {
return BukkitViaConfig.class.getClassLoader().getResource("assets/viaversion/config.yml"); return BukkitViaConfig.class.getClassLoader().getResource("assets/viaversion/config.yml");
@ -28,6 +40,26 @@ public class BukkitViaConfig extends AbstractViaConfig {
protected void handleConfig(Map<String, Object> config) { protected void handleConfig(Map<String, Object> config) {
} }
@Override
public boolean isAntiXRay() {
return antiXRay;
}
@Override
public boolean is1_12QuickMoveActionFix() {
return quickMoveActionFix;
}
@Override
public boolean is1_9HitboxFix() {
return hitboxFix1_9;
}
@Override
public boolean is1_14HitboxFix() {
return hitboxFix1_14;
}
@Override @Override
public List<String> getUnsupportedOptions() { public List<String> getUnsupportedOptions() {
return UNSUPPORTED; return UNSUPPORTED;

Datei anzeigen

@ -10,13 +10,23 @@ import java.util.*;
public class BungeeViaConfig extends AbstractViaConfig { public class BungeeViaConfig extends AbstractViaConfig {
private static final List<String> UNSUPPORTED = Arrays.asList("nms-player-ticking", "item-cache", "anti-xray-patch", "quick-move-action-fix", "velocity-ping-interval", "velocity-ping-save", "velocity-servers", "blockconnection-method", "change-1_9-hitbox", "change-1_14-hitbox"); private static final List<String> UNSUPPORTED = Arrays.asList("nms-player-ticking", "item-cache", "anti-xray-patch", "quick-move-action-fix", "velocity-ping-interval", "velocity-ping-save", "velocity-servers", "blockconnection-method", "change-1_9-hitbox", "change-1_14-hitbox");
private int bungeePingInterval;
private boolean bungeePingSave;
private Map<String, Integer> bungeeServerProtocols;
public BungeeViaConfig(File configFile) { public BungeeViaConfig(File configFile) {
super(new File(configFile, "config.yml")); super(new File(configFile, "config.yml"));
// Load config
reloadConfig(); reloadConfig();
} }
@Override
protected void loadFields() {
super.loadFields();
bungeePingInterval = getInt("bungee-ping-interval", 60);
bungeePingSave = getBoolean("bungee-ping-save", true);
bungeeServerProtocols = get("bungee-servers", Map.class, new HashMap<>());
}
@Override @Override
public URL getDefaultConfigURL() { public URL getDefaultConfigURL() {
return BungeeViaConfig.class.getClassLoader().getResource("assets/viaversion/config.yml"); return BungeeViaConfig.class.getClassLoader().getResource("assets/viaversion/config.yml");
@ -59,11 +69,6 @@ public class BungeeViaConfig extends AbstractViaConfig {
return UNSUPPORTED; return UNSUPPORTED;
} }
@Override
public boolean isAntiXRay() {
return false;
}
@Override @Override
public boolean isItemCache() { public boolean isItemCache() {
return false; return false;
@ -74,26 +79,11 @@ public class BungeeViaConfig extends AbstractViaConfig {
return false; return false;
} }
@Override
public boolean is1_12QuickMoveActionFix() {
return false;
}
@Override @Override
public String getBlockConnectionMethod() { public String getBlockConnectionMethod() {
return "packet"; return "packet";
} }
@Override
public boolean is1_9HitboxFix() {
return false;
}
@Override
public boolean is1_14HitboxFix() {
return false;
}
/** /**
* What is the interval for checking servers via ping * What is the interval for checking servers via ping
* -1 for disabled * -1 for disabled
@ -101,7 +91,7 @@ public class BungeeViaConfig extends AbstractViaConfig {
* @return Ping interval in seconds * @return Ping interval in seconds
*/ */
public int getBungeePingInterval() { public int getBungeePingInterval() {
return getInt("bungee-ping-interval", 60); return bungeePingInterval;
} }
/** /**
@ -110,7 +100,7 @@ public class BungeeViaConfig extends AbstractViaConfig {
* @return True if it should save * @return True if it should save
*/ */
public boolean isBungeePingSave() { public boolean isBungeePingSave() {
return getBoolean("bungee-ping-save", true); return bungeePingSave;
} }
/** /**
@ -120,6 +110,6 @@ public class BungeeViaConfig extends AbstractViaConfig {
* @return Map of String, Integer * @return Map of String, Integer
*/ */
public Map<String, Integer> getBungeeServerProtocols() { public Map<String, Integer> getBungeeServerProtocols() {
return get("bungee-servers", Map.class, new HashMap<>()); return bungeeServerProtocols;
} }
} }

Datei anzeigen

@ -4,252 +4,351 @@ import us.myles.ViaVersion.api.ViaVersionConfig;
import us.myles.ViaVersion.util.Config; import us.myles.ViaVersion.util.Config;
import java.io.File; import java.io.File;
import java.util.List; import java.util.HashSet;
import java.util.Set;
public abstract class AbstractViaConfig extends Config implements ViaVersionConfig { public abstract class AbstractViaConfig extends Config implements ViaVersionConfig {
private boolean checkForUpdates;
private boolean preventCollision;
private boolean useNewEffectIndicator;
private boolean useNewDeathmessages;
private boolean suppressMetadataErrors;
private boolean shieldBlocking;
private boolean hologramPatch;
private boolean pistonAnimationPatch;
private boolean bossbarPatch;
private boolean bossbarAntiFlicker;
private double hologramOffset;
private int maxPPS;
private String maxPPSKickMessage;
private int trackingPeriod;
private int warningPPS;
private int maxPPSWarnings;
private String maxPPSWarningsKickMessage;
private boolean sendSupportedVersions;
private boolean simulatePlayerTick;
private boolean itemCache;
private boolean nmsPlayerTicking;
private boolean replacePistons;
private int pistonReplacementId;
private boolean autoTeam;
private boolean forceJsonTransform;
private boolean nbtArrayFix;
private Set<Integer> blockedProtocols;
private String blockedDisconnectMessage;
private String reloadDisconnectMessage;
private boolean suppress1_13ConversionErrors;
private boolean disable1_13TabComplete;
private boolean minimizeCooldown;
private boolean teamColourFix;
private boolean serversideBlockConnections;
private String blockConnectionMethod;
private boolean reduceBlockStorageMemory;
private boolean flowerStemWhenBlockAbove;
private boolean snowCollisionFix;
private int tabCompleteDelay;
private boolean truncate1_14Books;
private boolean leftHandedHandling;
private boolean fullBlockLightFix;
private boolean healthNaNFix;
private boolean instantRespawn;
protected AbstractViaConfig(File configFile) { protected AbstractViaConfig(File configFile) {
super(configFile); super(configFile);
} }
@Override
public void reloadConfig() {
super.reloadConfig();
loadFields();
}
protected void loadFields() {
checkForUpdates = getBoolean("checkforupdates", true);
preventCollision = getBoolean("prevent-collision", true);
useNewEffectIndicator = getBoolean("use-new-effect-indicator", true);
useNewDeathmessages = getBoolean("use-new-deathmessages", true);
suppressMetadataErrors = getBoolean("suppress-metadata-errors", false);
shieldBlocking = getBoolean("shield-blocking", true);
hologramPatch = getBoolean("hologram-patch", false);
pistonAnimationPatch = getBoolean("piston-animation-patch", false);
bossbarPatch = getBoolean("bossbar-patch", true);
bossbarAntiFlicker = getBoolean("bossbar-anti-flicker", false);
hologramOffset = getDouble("hologram-y", -0.96D);
maxPPS = getInt("max-pps", 800);
maxPPSKickMessage = getString("max-pps-kick-msg", "Sending packets too fast? lag?");
trackingPeriod = getInt("tracking-period", 6);
warningPPS = getInt("tracking-warning-pps", 120);
maxPPSWarnings = getInt("tracking-max-warnings", 3);
maxPPSWarningsKickMessage = getString("tracking-max-kick-msg", "You are sending too many packets, :(");
sendSupportedVersions = getBoolean("send-supported-versions", false);
simulatePlayerTick = getBoolean("simulate-pt", true);
itemCache = getBoolean("item-cache", true);
nmsPlayerTicking = getBoolean("nms-player-ticking", true);
replacePistons = getBoolean("replace-pistons", false);
pistonReplacementId = getInt("replacement-piston-id", 0);
autoTeam = getBoolean("auto-team", true);
forceJsonTransform = getBoolean("force-json-transform", false);
nbtArrayFix = getBoolean("chat-nbt-fix", true);
blockedProtocols = new HashSet<>(getIntegerList("block-protocols"));
blockedDisconnectMessage = getString("block-disconnect-msg", "You are using an unsupported Minecraft version!");
reloadDisconnectMessage = getString("reload-disconnect-msg", "Server reload, please rejoin!");
suppress1_13ConversionErrors = getBoolean("minimize-cooldown", true);
disable1_13TabComplete = getBoolean("team-colour-fix", true);
minimizeCooldown = getBoolean("suppress-1_13-conversion-errors", false);
teamColourFix = getBoolean("disable-1_13-auto-complete", false);
serversideBlockConnections = getBoolean("serverside-blockconnections", false);
blockConnectionMethod = getString("blockconnection-method", "packet");
reduceBlockStorageMemory = getBoolean("reduce-blockstorage-memory", false);
flowerStemWhenBlockAbove = getBoolean("flowerstem-when-block-above", false);
snowCollisionFix = getBoolean("fix-low-snow-collision", false);
tabCompleteDelay = getInt("1_13-tab-complete-delay", 0);
truncate1_14Books = getBoolean("truncate-1_14-books", false);
leftHandedHandling = getBoolean("left-handed-handling", true);
fullBlockLightFix = getBoolean("fix-non-full-blocklight", false);
healthNaNFix = getBoolean("fix-1_14-health-nan", true);
instantRespawn = getBoolean("use-1_15-instant-respawn", false);
}
@Override @Override
public boolean isCheckForUpdates() { public boolean isCheckForUpdates() {
return getBoolean("checkforupdates", true); return checkForUpdates;
} }
@Override @Override
public boolean isPreventCollision() { public boolean isPreventCollision() {
return getBoolean("prevent-collision", true); return preventCollision;
} }
@Override @Override
public boolean isNewEffectIndicator() { public boolean isNewEffectIndicator() {
return getBoolean("use-new-effect-indicator", true); return useNewEffectIndicator;
} }
@Override @Override
public boolean isShowNewDeathMessages() { public boolean isShowNewDeathMessages() {
return getBoolean("use-new-deathmessages", true); return useNewDeathmessages;
} }
@Override @Override
public boolean isSuppressMetadataErrors() { public boolean isSuppressMetadataErrors() {
return getBoolean("suppress-metadata-errors", false); return suppressMetadataErrors;
} }
@Override @Override
public boolean isShieldBlocking() { public boolean isShieldBlocking() {
return getBoolean("shield-blocking", true); return shieldBlocking;
} }
@Override @Override
public boolean isHologramPatch() { public boolean isHologramPatch() {
return getBoolean("hologram-patch", false); return hologramPatch;
} }
@Override @Override
public boolean isPistonAnimationPatch() { public boolean isPistonAnimationPatch() {
return getBoolean("piston-animation-patch", false); return pistonAnimationPatch;
} }
@Override @Override
public boolean isBossbarPatch() { public boolean isBossbarPatch() {
return getBoolean("bossbar-patch", true); return bossbarPatch;
} }
@Override @Override
public boolean isBossbarAntiflicker() { public boolean isBossbarAntiflicker() {
return getBoolean("bossbar-anti-flicker", false); return bossbarAntiFlicker;
} }
@Override @Override
public double getHologramYOffset() { public double getHologramYOffset() {
return getDouble("hologram-y", -0.96D); return hologramOffset;
} }
@Override @Override
public int getMaxPPS() { public int getMaxPPS() {
return getInt("max-pps", 800); return maxPPS;
} }
@Override @Override
public String getMaxPPSKickMessage() { public String getMaxPPSKickMessage() {
return getString("max-pps-kick-msg", "Sending packets too fast? lag?"); return maxPPSKickMessage;
} }
@Override @Override
public int getTrackingPeriod() { public int getTrackingPeriod() {
return getInt("tracking-period", 6); return trackingPeriod;
} }
@Override @Override
public int getWarningPPS() { public int getWarningPPS() {
return getInt("tracking-warning-pps", 120); return warningPPS;
} }
@Override @Override
public int getMaxWarnings() { public int getMaxWarnings() {
return getInt("tracking-max-warnings", 3); return maxPPSWarnings;
} }
@Override @Override
public String getMaxWarningsKickMessage() { public String getMaxWarningsKickMessage() {
return getString("tracking-max-kick-msg", "You are sending too many packets, :("); return maxPPSWarningsKickMessage;
} }
@Override @Override
public boolean isAntiXRay() { public boolean isAntiXRay() {
return getBoolean("anti-xray-patch", true); return false;
} }
@Override @Override
public boolean isSendSupportedVersions() { public boolean isSendSupportedVersions() {
return getBoolean("send-supported-versions", false); return sendSupportedVersions;
} }
@Override @Override
public boolean isStimulatePlayerTick() { public boolean isStimulatePlayerTick() {
return getBoolean("simulate-pt", true); return simulatePlayerTick;
} }
@Override @Override
public boolean isItemCache() { public boolean isItemCache() {
return getBoolean("item-cache", true); return itemCache;
} }
@Override @Override
public boolean isNMSPlayerTicking() { public boolean isNMSPlayerTicking() {
return getBoolean("nms-player-ticking", true); return nmsPlayerTicking;
} }
@Override @Override
public boolean isReplacePistons() { public boolean isReplacePistons() {
return getBoolean("replace-pistons", false); return replacePistons;
} }
@Override @Override
public int getPistonReplacementId() { public int getPistonReplacementId() {
return getInt("replacement-piston-id", 0); return pistonReplacementId;
} }
@Override @Override
public boolean isAutoTeam() { public boolean isAutoTeam() {
// Collision has to be enabled first // Collision has to be enabled first
return isPreventCollision() && getBoolean("auto-team", true); return isPreventCollision() && autoTeam;
} }
@Override @Override
public boolean isForceJsonTransform() { public boolean isForceJsonTransform() {
return getBoolean("force-json-transform", false); return forceJsonTransform;
} }
@Override @Override
public boolean is1_12NBTArrayFix() { public boolean is1_12NBTArrayFix() {
return getBoolean("chat-nbt-fix", true); return nbtArrayFix;
} }
@Override @Override
public boolean is1_12QuickMoveActionFix() { public boolean is1_12QuickMoveActionFix() {
return getBoolean("quick-move-action-fix", false); return false;
} }
@Override @Override
public List<Integer> getBlockedProtocols() { public Set<Integer> getBlockedProtocols() {
return getIntegerList("block-protocols"); return blockedProtocols;
} }
@Override @Override
public String getBlockedDisconnectMsg() { public String getBlockedDisconnectMsg() {
return getString("block-disconnect-msg", "You are using an unsupported Minecraft version!"); return blockedDisconnectMessage;
} }
@Override @Override
public String getReloadDisconnectMsg() { public String getReloadDisconnectMsg() {
return getString("reload-disconnect-msg", "Server reload, please rejoin!"); return reloadDisconnectMessage;
} }
@Override @Override
public boolean isMinimizeCooldown() { public boolean isMinimizeCooldown() {
return getBoolean("minimize-cooldown", true); return suppress1_13ConversionErrors;
} }
@Override @Override
public boolean is1_13TeamColourFix() { public boolean is1_13TeamColourFix() {
return getBoolean("team-colour-fix", true); return disable1_13TabComplete;
} }
@Override @Override
public boolean isSuppress1_13ConversionErrors() { public boolean isSuppress1_13ConversionErrors() {
return getBoolean("suppress-1_13-conversion-errors", false); return minimizeCooldown;
} }
@Override @Override
public boolean isDisable1_13AutoComplete() { public boolean isDisable1_13AutoComplete() {
return getBoolean("disable-1_13-auto-complete", false); return teamColourFix;
} }
@Override @Override
public boolean isServersideBlockConnections() { public boolean isServersideBlockConnections() {
return getBoolean("serverside-blockconnections", false); return serversideBlockConnections;
} }
@Override @Override
public String getBlockConnectionMethod() { public String getBlockConnectionMethod() {
return getString("blockconnection-method", "packet"); return blockConnectionMethod;
} }
@Override @Override
public boolean isReduceBlockStorageMemory() { public boolean isReduceBlockStorageMemory() {
return getBoolean("reduce-blockstorage-memory", false); return reduceBlockStorageMemory;
} }
@Override @Override
public boolean isStemWhenBlockAbove() { public boolean isStemWhenBlockAbove() {
return getBoolean("flowerstem-when-block-above", false); return flowerStemWhenBlockAbove;
} }
@Override @Override
public boolean isSnowCollisionFix() { public boolean isSnowCollisionFix() {
return getBoolean("fix-low-snow-collision", false); return snowCollisionFix;
} }
@Override @Override
public int get1_13TabCompleteDelay() { public int get1_13TabCompleteDelay() {
return getInt("1_13-tab-complete-delay", 0); return tabCompleteDelay;
} }
@Override @Override
public boolean isTruncate1_14Books() { public boolean isTruncate1_14Books() {
return getBoolean("truncate-1_14-books", false); return truncate1_14Books;
} }
@Override @Override
public boolean isLeftHandedHandling() { public boolean isLeftHandedHandling() {
return getBoolean("left-handed-handling", true); return leftHandedHandling;
} }
@Override @Override
public boolean is1_9HitboxFix() { public boolean is1_9HitboxFix() {
return getBoolean("change-1_9-hitbox", false); return false;
} }
@Override @Override
public boolean is1_14HitboxFix() { public boolean is1_14HitboxFix() {
return getBoolean("change-1_14-hitbox", false); return false;
} }
@Override @Override
public boolean isNonFullBlockLightFix() { public boolean isNonFullBlockLightFix() {
return getBoolean("fix-non-full-blocklight", false); return fullBlockLightFix;
} }
@Override @Override
public boolean is1_14HealthNaNFix() { public boolean is1_14HealthNaNFix() {
return getBoolean("fix-1_14-health-nan", true); return healthNaNFix;
} }
@Override @Override
public boolean is1_15InstantRespawn() { public boolean is1_15InstantRespawn() {
return getBoolean("use-1_15-instant-respawn", false); return instantRespawn;
} }
} }

Datei anzeigen

@ -1,6 +1,6 @@
package us.myles.ViaVersion.api; package us.myles.ViaVersion.api;
import java.util.List; import java.util.Set;
public interface ViaVersionConfig { public interface ViaVersionConfig {
@ -213,7 +213,7 @@ public interface ViaVersionConfig {
* *
* @return An Integer list * @return An Integer list
*/ */
List<Integer> getBlockedProtocols(); Set<Integer> getBlockedProtocols();
/** /**
* Get the custom disconnect message * Get the custom disconnect message

Datei anzeigen

@ -24,7 +24,7 @@ public abstract class Config implements ConfigurationProvider {
private final CommentStore commentStore = new CommentStore('.', 2); private final CommentStore commentStore = new CommentStore('.', 2);
private final File configFile; private final File configFile;
private ConcurrentSkipListMap<String, Object> config; private Map<String, Object> config;
/** /**
* Create a new Config instance, this will *not* load the config by default. * Create a new Config instance, this will *not* load the config by default.

Datei anzeigen

@ -18,7 +18,6 @@ public class SpongeViaConfig extends AbstractViaConfig {
public SpongeViaConfig(PluginContainer pluginContainer, File configFile) { public SpongeViaConfig(PluginContainer pluginContainer, File configFile) {
super(new File(configFile, "config.yml")); super(new File(configFile, "config.yml"));
this.pluginContainer = pluginContainer; this.pluginContainer = pluginContainer;
// Load config
reloadConfig(); reloadConfig();
} }
@ -39,24 +38,4 @@ public class SpongeViaConfig extends AbstractViaConfig {
public List<String> getUnsupportedOptions() { public List<String> getUnsupportedOptions() {
return UNSUPPORTED; return UNSUPPORTED;
} }
@Override
public boolean isAntiXRay() {
return false;
}
@Override
public boolean is1_12QuickMoveActionFix() {
return false;
}
@Override
public boolean is1_9HitboxFix() {
return false;
}
@Override
public boolean is1_14HitboxFix() {
return false;
}
} }

Datei anzeigen

@ -9,13 +9,23 @@ import java.util.*;
public class VelocityViaConfig extends AbstractViaConfig { public class VelocityViaConfig extends AbstractViaConfig {
private static final List<String> UNSUPPORTED = Arrays.asList("nms-player-ticking", "item-cache", "anti-xray-patch", "quick-move-action-fix", "bungee-ping-interval", "bungee-ping-save", "bungee-servers", "blockconnection-method", "change-1_9-hitbox", "change-1_14-hitbox"); private static final List<String> UNSUPPORTED = Arrays.asList("nms-player-ticking", "item-cache", "anti-xray-patch", "quick-move-action-fix", "bungee-ping-interval", "bungee-ping-save", "bungee-servers", "blockconnection-method", "change-1_9-hitbox", "change-1_14-hitbox");
private int velocityPingInterval;
private boolean velocityPingSave;
private Map<String, Integer> velocityServerProtocols;
public VelocityViaConfig(File configFile) { public VelocityViaConfig(File configFile) {
super(new File(configFile, "config.yml")); super(new File(configFile, "config.yml"));
// Load config
reloadConfig(); reloadConfig();
} }
@Override
protected void loadFields() {
super.loadFields();
velocityPingInterval = getInt("velocity-ping-interval", 60);
velocityPingSave = getBoolean("velocity-ping-save", true);
velocityServerProtocols = get("velocity-servers", Map.class, new HashMap<>());
}
@Override @Override
public URL getDefaultConfigURL() { public URL getDefaultConfigURL() {
return getClass().getClassLoader().getResource("assets/viaversion/config.yml"); return getClass().getClassLoader().getResource("assets/viaversion/config.yml");
@ -64,11 +74,6 @@ public class VelocityViaConfig extends AbstractViaConfig {
return UNSUPPORTED; return UNSUPPORTED;
} }
@Override
public boolean isAntiXRay() {
return false;
}
@Override @Override
public boolean isItemCache() { public boolean isItemCache() {
return false; return false;
@ -79,26 +84,11 @@ public class VelocityViaConfig extends AbstractViaConfig {
return false; return false;
} }
@Override
public boolean is1_12QuickMoveActionFix() {
return false;
}
@Override @Override
public String getBlockConnectionMethod() { public String getBlockConnectionMethod() {
return "packet"; return "packet";
} }
@Override
public boolean is1_9HitboxFix() {
return false;
}
@Override
public boolean is1_14HitboxFix() {
return false;
}
/** /**
* What is the interval for checking servers via ping * What is the interval for checking servers via ping
* -1 for disabled * -1 for disabled
@ -106,7 +96,7 @@ public class VelocityViaConfig extends AbstractViaConfig {
* @return Ping interval in seconds * @return Ping interval in seconds
*/ */
public int getVelocityPingInterval() { public int getVelocityPingInterval() {
return getInt("velocity-ping-interval", 60); return velocityPingInterval;
} }
/** /**
@ -115,7 +105,7 @@ public class VelocityViaConfig extends AbstractViaConfig {
* @return True if it should save * @return True if it should save
*/ */
public boolean isVelocityPingSave() { public boolean isVelocityPingSave() {
return getBoolean("velocity-ping-save", true); return velocityPingSave;
} }
/** /**
@ -125,6 +115,6 @@ public class VelocityViaConfig extends AbstractViaConfig {
* @return Map of String, Integer * @return Map of String, Integer
*/ */
public Map<String, Integer> getVelocityServerProtocols() { public Map<String, Integer> getVelocityServerProtocols() {
return get("velocity-servers", Map.class, new HashMap<>()); return velocityServerProtocols;
} }
} }