removed spawn chunks size rule. Hack for network stuff - may stay. 24w03a
This commit is contained in:
1 parent
4aec8114c9
commit
d524df5a0b
25 files changed
+116
-194
No files matched your search
@@ -9,7 +9,6 @@ import carpet.settings.Rule;
|
||||
import carpet.utils.Translations;
|
||||
import carpet.utils.CommandHelper;
|
||||
import carpet.utils.Messenger;
|
||||
import carpet.utils.SpawnChunks;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
@@ -770,37 +769,6 @@ public class CarpetSettings
|
||||
)
|
||||
public static int simulationDistance = 0;
|
||||
|
||||
public static class ChangeSpawnChunksValidator extends Validator<Integer> {
|
||||
@Override public Integer validate(CommandSourceStack source, CarpetRule<Integer> currentRule, Integer newValue, String string) {
|
||||
if (source == null) return newValue;
|
||||
if (newValue < 0 || newValue > 32)
|
||||
{
|
||||
Messenger.m(source, "r spawn chunk size has to be between 0 and 32");
|
||||
return null;
|
||||
}
|
||||
if (currentRule.value().intValue() == newValue.intValue())
|
||||
{
|
||||
//must been some startup thing
|
||||
return newValue;
|
||||
}
|
||||
ServerLevel currentOverworld = source.getServer().overworld();
|
||||
if (currentOverworld != null)
|
||||
{
|
||||
SpawnChunks.changeSpawnSize(currentOverworld, newValue);
|
||||
}
|
||||
return newValue;
|
||||
}
|
||||
}
|
||||
@Rule(
|
||||
desc = "Changes size of spawn chunks",
|
||||
extra = {"Defines new radius", "setting it to 0 - disables spawn chunks"},
|
||||
category = CREATIVE,
|
||||
strict = false,
|
||||
options = {"0", "11"},
|
||||
validate = ChangeSpawnChunksValidator.class
|
||||
)
|
||||
public static int spawnChunksSize = MinecraftServer.START_CHUNK_RADIUS;
|
||||
|
||||
public enum RenewableCoralMode {
|
||||
FALSE,
|
||||
EXPANDED,
|
||||
|
||||
Reference in new issue
Block a user