Skip to content

Commit d67df45

Browse files
committed
1.21.4 preprocessing works
1 parent 8cdc3c3 commit d67df45

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

modern/templates/java/io/github/notenoughupdates/moulconfig/platform/MoulConfigPlatform.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ private static void setTextureData(NativeImageBackedTexture texture, BufferedIma
131131
@Override
132132
public DynamicTextureReference generateDynamicTexture(BufferedImage img) {
133133
var identifier = Identifier.of("moulconfig", "dynamic/${java.util.concurrent.ThreadLocalRandom.current().nextLong()}");
134-
var texture = new NativeImageBackedTexture(identifier.getPath(), img.getWidth(), img.getHeight(), true);
134+
var texture = new NativeImageBackedTexture(#if MC>12104 identifier.getPath(), #endif img.getWidth(), img.getHeight(), true);
135135
setTextureData(texture, img);
136136
texture.upload();
137137
mc.getTextureManager().registerTexture(identifier, texture);
@@ -221,8 +221,8 @@ public void sendClickableChatMessage(StructuredText message, String action, @Nul
221221
var text = MoulConfigText.unwrap(message);
222222
if (type != null) {
223223
text = text.copy().styled(it -> it.withClickEvent(switch (type) {
224-
case OPEN_LINK -> new ClickEvent.OpenUrl(URI.create(action));
225-
case RUN_COMMAND -> new ClickEvent.RunCommand(action);
224+
case OPEN_LINK -> #if MC > 12104 new ClickEvent.OpenUrl(URI.create(action)) #else new ClickEvent(ClickEvent.Action.OPEN_URL, action) #endif;
225+
case RUN_COMMAND -> #if MC > 12104 new ClickEvent.RunCommand(action) #else new ClickEvent(ClickEvent.Action.RUN_COMMAND, action) #endif;
226226
}));
227227
}
228228
MinecraftClient.getInstance().inGameHud.getChatHud().addMessage(text);

modern/templates/java/io/github/notenoughupdates/moulconfig/platform/MoulConfigRenderContext.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
package io.github.notenoughupdates.moulconfig.platform;
22

3+
#if MC > 12104
34
import com.mojang.blaze3d.pipeline.RenderPipeline;
5+
import net.minecraft.client.gl.RenderPipelines;
6+
#endif
47
import io.github.notenoughupdates.moulconfig.common.*;
58
import io.github.notenoughupdates.moulconfig.common.text.StructuredText;
69
import io.github.notenoughupdates.moulconfig.internal.FilterAssertionCache;
@@ -9,7 +12,6 @@
912
import lombok.Getter;
1013
import lombok.Value;
1114
import net.minecraft.client.MinecraftClient;
12-
import net.minecraft.client.gl.RenderPipelines;
1315
import net.minecraft.client.gui.DrawContext;
1416
import net.minecraft.client.gui.ScreenRect;
1517
import net.minecraft.client.gui.tooltip.HoveredTooltipPositioner;

0 commit comments

Comments
 (0)