Remove lightEngineMaxBatchSize rule (#1771)

This commit is contained in:
altrisi authored and GitHub committed 2023-07-28 21:10:17 +02:00
1 parent fedccb4d61
commit a29b84ec0d
5 files changed
-56

No files matched your search

-37
View File
@@ -866,43 +866,6 @@ public class CarpetSettings
)
public static int spawnChunksSize = MinecraftServer.START_CHUNK_RADIUS;
public static class LightBatchValidator extends Validator<Integer> {
public static void applyLightBatchSizes(MinecraftServer server, int maxBatchSize)
{
for (ServerLevel world : server.getAllLevels())
{
//world.getChunkSource().getLightEngine().setTaskPerBatch(maxBatchSize);
}
}
@Override public Integer validate(CommandSourceStack source, CarpetRule<Integer> currentRule, Integer newValue, String string) {
if (source == null) return newValue;
if (newValue < 0)
{
Messenger.m(source, "r light batch size has to be at least 0");
return null;
}
if (currentRule.value().intValue() == newValue.intValue())
{
//must been some startup thing
return newValue;
}
applyLightBatchSizes(source.getServer(), newValue); // Apply new settings
return newValue;
}
}
@Rule(
desc = "Changes maximum light tasks batch size",
extra = {"Allows for a higher light suppression tolerance", "setting it to 5 - Default limit defined by the game"},
category = {EXPERIMENTAL, OPTIMIZATION},
strict = false,
options = {"5", "50", "100", "200"},
validate = LightBatchValidator.class
)
public static int lightEngineMaxBatchSize = 5;
public enum RenewableCoralMode {
FALSE,
EXPANDED,
@@ -67,7 +67,5 @@ public abstract class MinecraftServer_coreMixin
{
if (CarpetSettings.spawnChunksSize != 11)
SpawnChunks.changeSpawnSize(overworld(), CarpetSettings.spawnChunksSize);
CarpetSettings.LightBatchValidator.applyLightBatchSizes((MinecraftServer) (Object) this, CarpetSettings.lightEngineMaxBatchSize);
}
}