Add pingPlayerListLimit setting (#704)
* Update CarpetSettings.java * Add pingPlayerListLimit * Fix formatting & fail softer
This commit is contained in:
1 parent
ca4db433c1
commit
69a0eeed7d
3 files changed
+28
No files matched your search
@@ -532,6 +532,14 @@ public class CarpetSettings
|
||||
)
|
||||
public static int maxEntityCollisions = 0;
|
||||
|
||||
@Rule(
|
||||
desc = "Customizable server list ping (Multiplayer menu) playerlist sample limit",
|
||||
options = {"0", "12", "20", "40"},
|
||||
category = CREATIVE,
|
||||
strict = false,
|
||||
validate = Validator.NONNEGATIVE_NUMBER.class
|
||||
)
|
||||
public static int pingPlayerListLimit = 12;
|
||||
/*
|
||||
|
||||
@Rule(
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package carpet.mixins;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.Constant;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||
|
||||
import carpet.CarpetSettings;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
|
||||
@Mixin(MinecraftServer.class)
|
||||
public abstract class MinecraftServer_pingPlayerSampleLimit
|
||||
{
|
||||
|
||||
@ModifyConstant(method = "tick", constant = @Constant(intValue = 12), require = 0, allow = 1)
|
||||
private int modifyPlayerSampleLimit(int value)
|
||||
{
|
||||
return CarpetSettings.pingPlayerListLimit;
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,7 @@
|
||||
"ServerPlayNetworkHandler_interactionUpdatesMixin",
|
||||
|
||||
"ServerMetadata_motdMixin",
|
||||
"MinecraftServer_pingPlayerSampleLimit",
|
||||
|
||||
"MinecraftServer_coreMixin",
|
||||
|
||||
|
||||
Reference in new issue
Block a user