making sure custom structure limits are always working.

This commit is contained in:
gnembon committed 2021-02-18 22:14:50 -04:00
1 parent edd203a1f8
commit fd84a5a6d0
2 files changed
+4 -3

No files matched your search

+3 -2
View File
@@ -52,6 +52,7 @@ public class CarpetSettings
public static boolean doChainStone = false;
public static boolean chainStoneStickToAll = false;
public static Block structureBlockIgnoredBlock = Blocks.STRUCTURE_VOID;
public static final int vanillaStructureBlockLimit = 48;
private static class LanguageValidator extends Validator<String> {
@Override public String validate(ServerCommandSource source, ParsedRule<String> currentRule, String newValue, String string) {
@@ -802,7 +803,7 @@ public class CarpetSettings
public static class StructureBlockLimitValidator extends Validator<Integer> {
@Override public Integer validate(ServerCommandSource source, ParsedRule<Integer> currentRule, Integer newValue, String string) {
return (newValue >= 48) ? newValue : null;
return (newValue >= vanillaStructureBlockLimit) ? newValue : null;
}
@Override
@@ -823,7 +824,7 @@ public class CarpetSettings
validate = StructureBlockLimitValidator.class,
strict = false
)
public static int structureBlockLimit = 48;
public static int structureBlockLimit = vanillaStructureBlockLimit;
public static class StructureBlockIgnoredValidator extends Validator<String> {
@@ -38,7 +38,7 @@ public class UpdateStructureBlockC2SPacketMixin {
)
private void structureBlockLimitsWrite(PacketByteBuf buf, CallbackInfo ci) {
//client method, only applicable if with carpet is on the server, or running locally
if (CarpetSettings.structureBlockLimit >= 128)
if (CarpetSettings.structureBlockLimit != CarpetSettings.vanillaStructureBlockLimit)
{
buf.writeInt(this.offset.getX());
buf.writeInt(this.offset.getY());