making sure custom structure limits are always working.
This commit is contained in:
1 parent
edd203a1f8
commit
fd84a5a6d0
2 files changed
+4
-3
No files matched your search
@@ -52,6 +52,7 @@ public class CarpetSettings
|
|||||||
public static boolean doChainStone = false;
|
public static boolean doChainStone = false;
|
||||||
public static boolean chainStoneStickToAll = false;
|
public static boolean chainStoneStickToAll = false;
|
||||||
public static Block structureBlockIgnoredBlock = Blocks.STRUCTURE_VOID;
|
public static Block structureBlockIgnoredBlock = Blocks.STRUCTURE_VOID;
|
||||||
|
public static final int vanillaStructureBlockLimit = 48;
|
||||||
|
|
||||||
private static class LanguageValidator extends Validator<String> {
|
private static class LanguageValidator extends Validator<String> {
|
||||||
@Override public String validate(ServerCommandSource source, ParsedRule<String> currentRule, String newValue, String 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> {
|
public static class StructureBlockLimitValidator extends Validator<Integer> {
|
||||||
|
|
||||||
@Override public Integer validate(ServerCommandSource source, ParsedRule<Integer> currentRule, Integer newValue, String string) {
|
@Override public Integer validate(ServerCommandSource source, ParsedRule<Integer> currentRule, Integer newValue, String string) {
|
||||||
return (newValue >= 48) ? newValue : null;
|
return (newValue >= vanillaStructureBlockLimit) ? newValue : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -823,7 +824,7 @@ public class CarpetSettings
|
|||||||
validate = StructureBlockLimitValidator.class,
|
validate = StructureBlockLimitValidator.class,
|
||||||
strict = false
|
strict = false
|
||||||
)
|
)
|
||||||
public static int structureBlockLimit = 48;
|
public static int structureBlockLimit = vanillaStructureBlockLimit;
|
||||||
|
|
||||||
public static class StructureBlockIgnoredValidator extends Validator<String> {
|
public static class StructureBlockIgnoredValidator extends Validator<String> {
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ public class UpdateStructureBlockC2SPacketMixin {
|
|||||||
)
|
)
|
||||||
private void structureBlockLimitsWrite(PacketByteBuf buf, CallbackInfo ci) {
|
private void structureBlockLimitsWrite(PacketByteBuf buf, CallbackInfo ci) {
|
||||||
//client method, only applicable if with carpet is on the server, or running locally
|
//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.getX());
|
||||||
buf.writeInt(this.offset.getY());
|
buf.writeInt(this.offset.getY());
|
||||||
|
|||||||
Reference in new issue
Block a user