stonecutter: support 1.21.5

This commit is contained in:
Martin Prokoph
2025-11-19 19:04:04 +01:00
parent 36bc344b94
commit 8ed02fef87
4 changed files with 47 additions and 10 deletions

View File

@@ -34,6 +34,13 @@ import java.nio.file.StandardCopyOption;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
//? if <= 1.21.5 {
/*import net.minecraft.client.gui.screens.LoadingOverlay;
import net.minecraft.client.renderer.RenderStateShard;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.util.TriState;
*///?}
import static net.puzzlemc.core.PuzzleCore.LOGGER;
import static net.puzzlemc.core.PuzzleCore.MOD_ID;
@@ -45,7 +52,9 @@ public class PuzzleSplashScreen {
public static Path BACKGROUND_TEXTURE = Paths.get(CONFIG_PATH + "/splash_background.png");
private static Minecraft client = Minecraft.getInstance();
private static boolean keepBackground = false;
private static RenderPipeline CUSTOM_LOGO_PIPELINE;
public static RenderPipeline CUSTOM_LOGO_PIPELINE;
//? if <= 1.21.5
/*public static RenderType CUSTOM_LOGO_LAYER;*/
public static void init() {
if (!CONFIG_PATH.exists()) { // Run when config directory is nonexistent //
@@ -59,10 +68,6 @@ public class PuzzleSplashScreen {
buildRenderLayer();
}
public static RenderPipeline getCustomLogoRenderPipeline() {
return CUSTOM_LOGO_PIPELINE;
}
public static void buildRenderLayer() {
if (PuzzleConfig.resourcepackSplashScreen) {
BlendFunction blendFunction = new BlendFunction(SourceFactor.SRC_ALPHA, DestFactor.ONE);
@@ -86,6 +91,13 @@ public class PuzzleSplashScreen {
CUSTOM_LOGO_PIPELINE_BUILDER = blendFunction != null ? CUSTOM_LOGO_PIPELINE_BUILDER.withBlend(blendFunction) : CUSTOM_LOGO_PIPELINE_BUILDER.withoutBlend();
CUSTOM_LOGO_PIPELINE = CUSTOM_LOGO_PIPELINE_BUILDER.build();
//? if <= 1.21.5 {
/*CUSTOM_LOGO_LAYER = RenderType.create("mojang_logo_puzzle", 786432, CUSTOM_LOGO_PIPELINE,
RenderType.CompositeState.builder()
.setTextureState(new RenderStateShard.TextureStateShard(LoadingOverlay.MOJANG_STUDIOS_LOGO_LOCATION, TriState.DEFAULT, false))
.createCompositeState(false));
*///?}
}
}