Issues with Increasing anvil Limit due to Enigmatic-Legacy
wolflord212312 opened this issue ยท 2 comments
Hello,
Today on my server We just added color coding with Hex to items.
But due to Enigmatic-legacy we are limited to 64 Chars
We are increasing the amount of chars supported by a anvil through Mixin's.
And I'm trying to figure out the reason that Enigmatic-legacy is creating a new anvil Screen with a limit of 64 characters.
And if we could figure something out.
Below is how Im going about increasing the max length.
@Mixin(AnvilMenu.class)
public abstract class AnvilScreenHandlerMixin {
@Inject(method = "validateName", at = @At("HEAD"), cancellable = true)
private static void validateName(String text, CallbackInfoReturnable<String> cir) {
//replace all instances of "\n" with the line feed character
text = text.replace("\\n", "\n");
String string = SharedConstants.filterText(text, true);
if (string.length() <= 32767) {
cir.setReturnValue(string);
return;
}
cir.setReturnValue(null);
}
}
@Mixin(AnvilScreen.class)
public abstract class AnvilScreenMixin {
@ModifyArg(
method = "subInit",
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/components/EditBox;setMaxLength(I)V"),
index = 0
)
private int setMaxLength(int maxLength) {
return 32767;
}
}
Anyways A solution would be a possible config to change the max to a higher number????
Or maybe see if that section is really needed.