Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 338bfb9f9e | |||
| 37cb00b8e2 |
@@ -31,7 +31,7 @@ public final class ModInfo
|
||||
public static final String DEDICATED_SERVER_INITIAL_PATH = "dedicated_server_initial";
|
||||
|
||||
/** Incremented every time any packets are added, changed or removed, with a few exceptions. */
|
||||
public static final int PROTOCOL_VERSION = 11;
|
||||
public static final int PROTOCOL_VERSION = 12;
|
||||
public static final String WRAPPER_PACKET_PATH = "message";
|
||||
|
||||
/** The internal mod name */
|
||||
|
||||
@@ -1705,6 +1705,15 @@ public class Config
|
||||
|
||||
|
||||
// Common
|
||||
public static ConfigEntry<Boolean> allowLocalChunkUse = new ConfigEntry.Builder<Boolean>()
|
||||
.setChatCommandName("common.allowLocalChunkUse")
|
||||
.setAppearance(EConfigEntryAppearance.ONLY_IN_FILE)
|
||||
.set(true)
|
||||
.comment(""
|
||||
+ "If true, clients will be able to update LODs using chunks they load."
|
||||
+ "")
|
||||
.build();
|
||||
|
||||
public static ConfigEntry<Integer> maxDataTransferSpeed = new ConfigEntry.Builder<Integer>()
|
||||
.setChatCommandName("common.maxDataTransferSpeed")
|
||||
.setMinDefaultMax(0, 500, 1000000 /* 1 GB/s */)
|
||||
|
||||
@@ -340,7 +340,17 @@ public class DhClientLevel extends AbstractDhLevel implements IDhClientLevel
|
||||
return true;
|
||||
}
|
||||
|
||||
return !this.networkState.sessionConfig.isRealTimeUpdatesEnabled() || this.loadedOnceChunks.add(chunkPos);
|
||||
if (!this.networkState.sessionConfig.isLocalChunkUseAllowed())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.networkState.sessionConfig.isRealTimeUpdatesEnabled())
|
||||
{
|
||||
return this.loadedOnceChunks.add(chunkPos);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+9
-7
@@ -33,9 +33,9 @@ public class SessionConfig implements INetworkObject
|
||||
|
||||
registerConfigEntry(Config.Common.WorldGenerator.enableDistantGeneration, Boolean::logicalAnd);
|
||||
registerConfigEntry(Config.Server.maxGenerationRequestDistance, Math::min);
|
||||
registerConfigEntry(Config.Server.generationBoundsX, (x, y) -> y);
|
||||
registerConfigEntry(Config.Server.generationBoundsZ, (x, y) -> y);
|
||||
registerConfigEntry(Config.Server.generationBoundsRadius, (x, y) -> y);
|
||||
registerConfigEntry(Config.Server.generationBoundsX, (clientValue, serverValue) -> serverValue);
|
||||
registerConfigEntry(Config.Server.generationBoundsZ, (clientValue, serverValue) -> serverValue);
|
||||
registerConfigEntry(Config.Server.generationBoundsRadius, (clientValue, serverValue) -> serverValue);
|
||||
registerConfigEntry(Config.Server.generationRequestRateLimit, Math::min);
|
||||
|
||||
registerConfigEntry(Config.Server.enableRealTimeUpdates, Boolean::logicalAnd);
|
||||
@@ -45,15 +45,16 @@ public class SessionConfig implements INetworkObject
|
||||
registerConfigEntry(Config.Server.maxSyncOnLoadRequestDistance, Math::min);
|
||||
registerConfigEntry(Config.Server.syncOnLoadRateLimit, Math::min);
|
||||
|
||||
registerConfigEntry(Config.Server.maxDataTransferSpeed, (x, y) -> {
|
||||
if (x == 0 && y == 0)
|
||||
registerConfigEntry(Config.Server.allowLocalChunkUse, (clientValue, serverValue) -> serverValue);
|
||||
registerConfigEntry(Config.Server.maxDataTransferSpeed, (clientValue, serverValue) -> {
|
||||
if (clientValue == 0 && serverValue == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return Math.min(
|
||||
x > 0 ? x : Integer.MAX_VALUE,
|
||||
y > 0 ? y : Integer.MAX_VALUE
|
||||
clientValue > 0 ? clientValue : Integer.MAX_VALUE,
|
||||
serverValue > 0 ? serverValue : Integer.MAX_VALUE
|
||||
);
|
||||
});
|
||||
}
|
||||
@@ -80,6 +81,7 @@ public class SessionConfig implements INetworkObject
|
||||
public int getMaxSyncOnLoadDistance() { return this.getValue(Config.Server.maxSyncOnLoadRequestDistance); }
|
||||
public int getSyncOnLoginRateLimit() { return this.getValue(Config.Server.syncOnLoadRateLimit); }
|
||||
|
||||
public boolean isLocalChunkUseAllowed() { return this.getValue(Config.Server.allowLocalChunkUse); }
|
||||
public int getMaxDataTransferSpeed() { return this.getValue(Config.Server.maxDataTransferSpeed); }
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user