thorium

thorium

333k Downloads

Fix for MC-210318 can be simplified

NoahvdAa opened this issue ยท 0 comments

commented

Currently, we replace the entire bookTitleSelectionManager. This can however be simplified to a simple @ModifyConstant, changing the int value 16 to 17, which has the same affect as changing the < to <=.

@Inject(method = "<init>", at = @At(value = "TAIL"))
private void modifyBookTitleSelectionManager(PlayerEntity player, ItemStack itemStack, Hand hand, CallbackInfo ci) {
this.bookTitleSelectionManager = new SelectionManager(() -> this.title, (title) -> this.title = title, this::getClipboard, this::setClipboard, (string) -> string.length() <= 16);
}