Skip to content

Commit

Permalink
Ensure consistent application of mixin as Caxton will sometimes rando…
Browse files Browse the repository at this point in the history
…mly be prioritised (visible starting in version 1.21.4)
  • Loading branch information
Wetterquarz committed Jan 31, 2025
1 parent 25de0f7 commit 5947ea6
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ public abstract class MixinTextHandler implements ITextHandler {
@Shadow
public float getWidth(OrderedText text) { return 0f; }

@Inject(method = "getWidth(Ljava/lang/String;)F", at = @At("HEAD"), cancellable = true)
@Inject(method = "getWidth(Ljava/lang/String;)F", at = @At("HEAD"), cancellable = true, order = 900)
public void injectGetWidth(String text, CallbackInfoReturnable<Float> info) {
onGetWidthOrderedText(Utils.orderedFrom(text), info);
}

@Inject(method = "getWidth(Lnet/minecraft/text/StringVisitable;)F", at = @At("HEAD"), cancellable = true)
@Inject(method = "getWidth(Lnet/minecraft/text/StringVisitable;)F", at = @At("HEAD"), cancellable = true, order = 900)
public void injectGetWidth(StringVisitable text, CallbackInfoReturnable<Float> info) {
onGetWidthOrderedText(Utils.orderedFrom(text), info);
}

@Inject(method = "getWidth(Lnet/minecraft/text/OrderedText;)F", at = @At("HEAD"), cancellable = true)
@Inject(method = "getWidth(Lnet/minecraft/text/OrderedText;)F", at = @At("HEAD"), cancellable = true, order = 900)
private void onGetWidthOrderedText(OrderedText text, CallbackInfoReturnable<Float> cir) {
if (!getWidthMutex) {
getWidthMutex = true;
Expand Down

0 comments on commit 5947ea6

Please sign in to comment.