Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/sh/ndy/ToggleNametagsClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void onInitializeClient() {
//? if < 26.2 {
// context.getSource().getClient().schedule(() -> c.setScreen(new ConfigScreen(null, null)));
//?} else
context.getSource().getClient().schedule(() -> c.setScreenAndShow(new ConfigScreen(null, null)));
context.getSource().getClient().schedule(() -> c.gui.setScreen(new ConfigScreen(null, null)));

return 1;
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@

//? if < 26.2 {
/* @Mixin(NameTagFeatureRenderer.Storage.class) */
//?} else {
//?}

//? if >= 26.2 {
@Mixin(NameTagFeatureRenderer.class)
//?}
public class MixinNametagsBackgroundOpacity {
//? if < 26.2 {
/* @Unique private static final String TARGET = "Lnet/minecraft/client/renderer/state/OptionsRenderState;getBackgroundOpacity(F)F"; */
//?} else
//?} else {
@Unique private static final String TARGET = "Lnet/minecraft/client/gui/Font;prepareText(Lnet/minecraft/util/FormattedCharSequence;FFIZZI)Lnet/minecraft/client/gui/Font$PreparedText;";
//?}

//? if < 26.2 {
/* @ModifyExpressionValue(
Expand All @@ -32,7 +35,9 @@ public class MixinNametagsBackgroundOpacity {
private float changeOpacity(float original) {
return (float) Config.getOptions().getNametagOpacity();
}
*///?} else {
*///?}

//? if >= 26.2 {
@ModifyArg(
method = "prepareText",
at = @At(
Expand Down
22 changes: 11 additions & 11 deletions src/main/java/sh/ndy/mixin/client/MixinNametagsTextShadow.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,25 @@

@Mixin(NameTagFeatureRenderer.class)
public class MixinNametagsTextShadow {
private static final NametagsTextShadowListener listener = new NametagsTextShadowListener();

//? if < 26.2 {
/* @Unique private static final String TARGET =
"Lnet/minecraft/client/gui/Font;drawInBatch(Lnet/minecraft/network/chat/Component;FFIZLorg/joml/Matrix4fc;Lnet/minecraft/client/renderer/MultiBufferSource;Lnet/minecraft/client/gui/Font$DisplayMode;II)V";
*///?} else {
"Lnet/minecraft/client/gui/Font;drawInBatch(Lnet/minecraft/network/chat/Component;FFIZLorg/joml/Matrix4fc;Lnet/minecraft/client/renderer/MultiBufferSource;Lnet/minecraft/client/gui/Font$DisplayMode;II)V"; */
//?} else {
@Unique private static final String TARGET =
"Lnet/minecraft/client/gui/Font;prepareText(Lnet/minecraft/util/FormattedCharSequence;FFIZZI)Lnet/minecraft/client/gui/Font$PreparedText;";
//?}

private static final NametagsTextShadowListener listener = new NametagsTextShadowListener();

//? if < 26.2 {
/*
@ModifyArg(method = "renderTranslucent", at = @At(value = "INVOKE", target = TARGET))
private boolean render(boolean original) {
return listener.handleMixin();
}
*/
//?} else {
@ModifyArg(method = "renderTranslucent", at = @At(value = "INVOKE", target = TARGET))
private boolean render(boolean original) {
return listener.handleMixin();
}
*///?}

//? if >= 26.2 {
@ModifyArg(method = "prepareText",
at = @At(value = "INVOKE", target = TARGET),
index = 4
Expand All @@ -35,5 +36,4 @@ private static boolean render(boolean drawShadow) {
return listener.handleMixin();
}
//?}

}
2 changes: 1 addition & 1 deletion src/main/java/sh/ndy/screens/ConfigScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,6 @@ public void onClose() {
//? if < 26.2 {
// this.minecraft.setScreen(parent);
//?} else
this.minecraft.setScreenAndShow(parent);
this.minecraft.gui.setScreen(parent);
}
}
Loading