Basic chat commands
This commit is contained in:
@@ -155,7 +155,7 @@ public class Config
|
||||
.build();
|
||||
|
||||
public static ConfigEntry<Integer> lodChunkRenderDistanceRadius = new ConfigEntry.Builder<Integer>()
|
||||
.enableOnServer()
|
||||
.setServersideShortName("renderDistanceRadius")
|
||||
.setMinDefaultMax(32, 128, 4096)
|
||||
.comment("The radius of the mod's render distance. (measured in chunks)")
|
||||
.setPerformance(EConfigEntryPerformance.HIGH)
|
||||
@@ -661,7 +661,7 @@ public class Config
|
||||
public static class WorldGenerator
|
||||
{
|
||||
public static ConfigEntry<Boolean> enableDistantGeneration = new ConfigEntry.Builder<Boolean>()
|
||||
.enableOnServer()
|
||||
.setServersideShortName("enableDistantGeneration")
|
||||
.set(true)
|
||||
.comment(""
|
||||
+ " Should Distant Horizons slowly generate LODs \n"
|
||||
@@ -672,7 +672,7 @@ public class Config
|
||||
.build();
|
||||
|
||||
public static ConfigEntry<EDhApiDistantGeneratorMode> distantGeneratorMode = new ConfigEntry.Builder<EDhApiDistantGeneratorMode>()
|
||||
.enableOnServer()
|
||||
.setServersideShortName("distantGeneratorMode")
|
||||
.set(EDhApiDistantGeneratorMode.FEATURES)
|
||||
.comment(""
|
||||
+ "How detailed should LODs be generated outside the vanilla render distance? \n"
|
||||
@@ -714,7 +714,7 @@ public class Config
|
||||
.build();
|
||||
|
||||
public static ConfigEntry<Integer> worldGenerationTimeoutLengthInSeconds = new ConfigEntry.Builder<Integer>()
|
||||
.enableOnServer()
|
||||
.setServersideShortName("worldGenerationTimeout")
|
||||
.setMinDefaultMax(5, 60, 60 * 10/*10 minutes*/ )
|
||||
.comment(""
|
||||
+ "How long should a world generator thread run for before timing out? \n"
|
||||
@@ -758,7 +758,7 @@ public class Config
|
||||
public static class LodBuilding
|
||||
{
|
||||
public static ConfigEntry<Integer> minTimeBetweenChunkUpdatesInSeconds = new ConfigEntry.Builder<Integer>()
|
||||
.enableOnServer()
|
||||
.setServersideShortName("minTimeBetweenChunkUpdates")
|
||||
.setMinDefaultMax(0, 1, 60)
|
||||
.comment(""
|
||||
+ "Determines how long must pass between LOD chunk updates before another. \n"
|
||||
@@ -824,7 +824,7 @@ public class Config
|
||||
public static class ServerNetworking
|
||||
{
|
||||
public static ConfigEntry<Boolean> enableServerNetworking = new ConfigEntry.Builder<Boolean>()
|
||||
.enableOnServer()
|
||||
.setServersideShortName("enableServerNetworking")
|
||||
.set(true)
|
||||
.comment(""
|
||||
+ "Attention: \n"
|
||||
@@ -839,7 +839,7 @@ public class Config
|
||||
.build();
|
||||
|
||||
public static ConfigEntry<Integer> requestRateLimit = new ConfigEntry.Builder<Integer>()
|
||||
.enableOnServer()
|
||||
.setServersideShortName("requestRateLimit")
|
||||
.setMinDefaultMax(1, 20, 100)
|
||||
.comment(""
|
||||
+ "Limits the amount of sent/processed LOD requests concurrently. \n"
|
||||
@@ -849,7 +849,7 @@ public class Config
|
||||
.build();
|
||||
|
||||
public static ConfigEntry<Boolean> enableRealTimeUpdates = new ConfigEntry.Builder<Boolean>()
|
||||
.enableOnServer()
|
||||
.setServersideShortName("enableRealTimeUpdates")
|
||||
.set(false)
|
||||
.comment(""
|
||||
+ "Enables real time updates from server."
|
||||
@@ -857,7 +857,7 @@ public class Config
|
||||
.build();
|
||||
|
||||
public static ConfigEntry<Boolean> enablePostRelogUpdate = new ConfigEntry.Builder<Boolean>()
|
||||
.enableOnServer()
|
||||
.setServersideShortName("enablePostRelogUpdate")
|
||||
.set(false)
|
||||
.comment(""
|
||||
+ "Enables updating of LODs after relog."
|
||||
@@ -865,8 +865,8 @@ public class Config
|
||||
.build();
|
||||
|
||||
public static ConfigEntry<Integer> serverPort = new ConfigEntry.Builder<Integer>()
|
||||
.enableOnServer()
|
||||
.set(25049)
|
||||
.setServersideShortName("serverPort")
|
||||
.setMinDefaultMax(1, 25049, 65535)
|
||||
.comment(""
|
||||
+ "The port on the server that's used for sending LOD data."
|
||||
+ "")
|
||||
|
||||
+2
-2
@@ -192,7 +192,7 @@ public class ConfigFileHandling
|
||||
public void saveEntry(ConfigEntry<?> entry, CommentedFileConfig workConfig)
|
||||
{
|
||||
if (!entry.getAppearance().showInFile) return;
|
||||
if (SingletonInjector.INSTANCE.get(IMinecraftSharedWrapper.class).isDedicatedServer() && !entry.isEnabledOnServer())
|
||||
if (SingletonInjector.INSTANCE.get(IMinecraftSharedWrapper.class).isDedicatedServer() && entry.getServersideShortName() == null)
|
||||
return;
|
||||
if (entry.getTrueValue() == null)
|
||||
throw new IllegalArgumentException("Entry [" + entry.getNameWCategory() + "] is null, this may be a problem with [" + configBase.modName + "]. Please contact the authors");
|
||||
@@ -256,7 +256,7 @@ public class ConfigFileHandling
|
||||
)
|
||||
return;
|
||||
|
||||
if (SingletonInjector.INSTANCE.get(IMinecraftSharedWrapper.class).isDedicatedServer() && !entry.isEnabledOnServer())
|
||||
if (SingletonInjector.INSTANCE.get(IMinecraftSharedWrapper.class).isDedicatedServer() && entry.getServersideShortName() == null)
|
||||
return;
|
||||
|
||||
nightConfig.setComment(entry.getNameWCategory(), " " + entry.getComment().replaceAll("\n", "\n ") + "\n ");
|
||||
|
||||
@@ -44,7 +44,7 @@ public class ConfigEntry<T> extends AbstractConfigType<T, ConfigEntry<T>> implem
|
||||
private T min;
|
||||
private T max;
|
||||
private final ArrayList<IConfigListener> listenerList;
|
||||
private final boolean enabledOnServer;
|
||||
private final String serversideShortName;
|
||||
|
||||
// API control //
|
||||
/**
|
||||
@@ -58,14 +58,14 @@ public class ConfigEntry<T> extends AbstractConfigType<T, ConfigEntry<T>> implem
|
||||
|
||||
|
||||
/** Creates the entry */
|
||||
private ConfigEntry(EConfigEntryAppearance appearance, T value, String comment, T min, T max, boolean enabledOnServer, boolean allowApiOverride, EConfigEntryPerformance performance, ArrayList<IConfigListener> listenerList)
|
||||
private ConfigEntry(EConfigEntryAppearance appearance, T value, String comment, T min, T max, String serversideShortName, boolean allowApiOverride, EConfigEntryPerformance performance, ArrayList<IConfigListener> listenerList)
|
||||
{
|
||||
super(appearance, value);
|
||||
|
||||
this.comment = comment;
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
this.enabledOnServer = enabledOnServer;
|
||||
this.serversideShortName = serversideShortName;
|
||||
this.allowApiOverride = allowApiOverride;
|
||||
this.performance = performance;
|
||||
this.listenerList = listenerList;
|
||||
@@ -181,7 +181,7 @@ public class ConfigEntry<T> extends AbstractConfigType<T, ConfigEntry<T>> implem
|
||||
if (validness == 1) this.value = (T) NumberUtil.getMaximum(this.value.getClass());
|
||||
}
|
||||
|
||||
public boolean isEnabledOnServer() { return this.enabledOnServer; }
|
||||
public String getServersideShortName() { return this.serversideShortName; }
|
||||
|
||||
@Override
|
||||
public String getComment() { return this.comment; }
|
||||
@@ -301,7 +301,7 @@ public class ConfigEntry<T> extends AbstractConfigType<T, ConfigEntry<T>> implem
|
||||
private String tmpComment = null;
|
||||
private T tmpMin = null;
|
||||
private T tmpMax = null;
|
||||
protected boolean tmpEnabledOnServer = false;
|
||||
protected String tmpServersideShortName = null;
|
||||
private boolean tmpUseApiOverwrite = true;
|
||||
private EConfigEntryPerformance tmpPerformance = EConfigEntryPerformance.DONT_SHOW;
|
||||
protected ArrayList<IConfigListener> tmpIConfigListener = new ArrayList<>();
|
||||
@@ -339,9 +339,9 @@ public class ConfigEntry<T> extends AbstractConfigType<T, ConfigEntry<T>> implem
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder<T> enableOnServer()
|
||||
public Builder<T> setServersideShortName(String name)
|
||||
{
|
||||
this.tmpEnabledOnServer = true;
|
||||
this.tmpServersideShortName = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -387,7 +387,7 @@ public class ConfigEntry<T> extends AbstractConfigType<T, ConfigEntry<T>> implem
|
||||
|
||||
public ConfigEntry<T> build()
|
||||
{
|
||||
return new ConfigEntry<>(this.tmpAppearance, this.tmpValue, this.tmpComment, this.tmpMin, this.tmpMax, this.tmpEnabledOnServer, this.tmpUseApiOverwrite, this.tmpPerformance, this.tmpIConfigListener);
|
||||
return new ConfigEntry<>(this.tmpAppearance, this.tmpValue, this.tmpComment, this.tmpMin, this.tmpMax, this.tmpServersideShortName, this.tmpUseApiOverwrite, this.tmpPerformance, this.tmpIConfigListener);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user