stonecutter: support 1.21.8

This commit is contained in:
Martin Prokoph
2025-11-19 18:15:19 +01:00
parent c2e4008871
commit 36bc344b94
6 changed files with 64 additions and 16 deletions

View File

@@ -36,9 +36,16 @@ repositories {
maven("https://maven.shedaniel.me/") maven("https://maven.shedaniel.me/")
maven("https://maven.quiltmc.org/repository/release/") maven("https://maven.quiltmc.org/repository/release/")
} }
val mappingsAttribute = Attribute.of("net.minecraft.mappings", String::class.java)
dependencies { dependencies {
attributesSchema {
attribute(mappingsAttribute)
}
minecraft("com.mojang:minecraft:$minecraft") minecraft("com.mojang:minecraft:$minecraft")
// Jigsaw modules (GUI compat mods)
modCompileOnlyApi ("maven.modrinth:cull-leaves:${mod.jigsaw("cull_leaves_version")}") modCompileOnlyApi ("maven.modrinth:cull-leaves:${mod.jigsaw("cull_leaves_version")}")
modCompileOnlyApi ("maven.modrinth:iris:${mod.jigsaw("iris_version")}") modCompileOnlyApi ("maven.modrinth:iris:${mod.jigsaw("iris_version")}")
modCompileOnly ("maven.modrinth:cit-resewn:${mod.jigsaw("cit_resewn_version")}") modCompileOnly ("maven.modrinth:cit-resewn:${mod.jigsaw("cit_resewn_version")}")
@@ -53,20 +60,17 @@ dependencies {
modCompileOnlyApi ("maven.modrinth:completeconfig:${mod.jigsaw("complete_config_version")}") modCompileOnlyApi ("maven.modrinth:completeconfig:${mod.jigsaw("complete_config_version")}")
//modImplementation ("maven.modrinth:exordium:${project.exordium_version}") //modImplementation ("maven.modrinth:exordium:${project.exordium_version}")
modCompileOnlyApi ("maven.modrinth:lambdynamiclights:${mod.jigsaw("ldl_version")}")
modCompileOnly("dev.lambdaurora.lambdynamiclights:lambdynamiclights-api:${mod.jigsaw("ldl_version")}")
modCompileOnlyApi ("maven.modrinth:lambdabettergrass:${mod.jigsaw("lbg_version")}") modCompileOnlyApi ("maven.modrinth:lambdabettergrass:${mod.jigsaw("lbg_version")}")
modCompileOnlyApi ("dev.lambdaurora:spruceui:${mod.jigsaw("spruceui_version")}") modCompileOnlyApi ("dev.lambdaurora:spruceui:${mod.jigsaw("spruceui_version")}")
// Required for Lambda's mods (DO NOT DEPEND ON OTHERWISE) // Required for Lambda's mods (DO NOT DEPEND ON OTHERWISE)
modCompileOnly ("org.quiltmc:quilt-loader:${mod.jigsaw("quilt_loader_version")}") modCompileOnly ("dev.yumi.mc.core:yumi-mc-foundation:1.0.0-alpha.15+1.21.1")
modCompileOnlyApi ("org.quiltmc.quilted-fabric-api:quilted-fabric-api:${mod.jigsaw("quilt_fabric_api_version")}")
modCompileOnlyApi ("org.aperlambda:lambdajcommon:1.8.1") { modCompileOnlyApi ("org.aperlambda:lambdajcommon:1.8.1") {
exclude(group = "com.google.code.gson") exclude(group = "com.google.code.gson")
exclude(group = "com.google.guava") exclude(group = "com.google.guava")
} }
// MidnightLib
modImplementation ("eu.midnightdust:midnightlib:${mod.dep("midnightlib_version")}+${minecraft}-${loader}") modImplementation ("eu.midnightdust:midnightlib:${mod.dep("midnightlib_version")}+${minecraft}-${loader}")
if (loader == "fabric") { if (loader == "fabric") {
@@ -75,12 +79,26 @@ dependencies {
// Fabric API is required to load modded resources // Fabric API is required to load modded resources
modImplementation("net.fabricmc.fabric-api:fabric-api:${mod.dep("fabric_version")}") modImplementation("net.fabricmc.fabric-api:fabric-api:${mod.dep("fabric_version")}")
modCompileOnly ("dev.lambdaurora.lambdynamiclights:lambdynamiclights-api:${mod.jigsaw("ldl_version")}")
modCompileOnly ("dev.lambdaurora.lambdynamiclights:lambdynamiclights-runtime:${mod.jigsaw("ldl_version")}")
} }
if (loader == "forge") { if (loader == "forge") {
"forge"("net.minecraftforge:forge:${minecraft}-${mod.dep("forge_loader")}") "forge"("net.minecraftforge:forge:${minecraft}-${mod.dep("forge_loader")}")
} }
if (loader == "neoforge") { if (loader == "neoforge") {
"neoForge"("net.neoforged:neoforge:${mod.dep("neoforge_loader")}") "neoForge"("net.neoforged:neoforge:${mod.dep("neoforge_loader")}")
modCompileOnly ("dev.lambdaurora.lambdynamiclights:lambdynamiclights-api:${mod.jigsaw("ldl_version")}") {
attributes {
attribute(mappingsAttribute, "mojmap")
}
}
modCompileOnly ("dev.lambdaurora.lambdynamiclights:lambdynamiclights-runtime:${mod.jigsaw("ldl_version")}") {
attributes {
attribute(mappingsAttribute, "mojmap")
}
}
} }
mappings (loom.officialMojangMappings()) mappings (loom.officialMojangMappings())
} }

View File

@@ -35,9 +35,9 @@ deps.midnightlib_version=1.9.0-alpha.1
# Mod integrations # Mod integrations
jigsaws.cull_leaves_version = 3.0.2-fabric jigsaws.cull_leaves_version = 3.0.2-fabric
jigsaws.ldl_version = 4.0.0+1.21.4 jigsaws.ldl_version = 4.8.6+1.21.10
jigsaws.lbg_version = 1.5.2+1.20.1 jigsaws.lbg_version = 2.5.0+1.21.9
jigsaws.iris_version = 1.8.0-beta.3+1.21-fabric jigsaws.iris_version = 1.9.6+1.21.10-fabric
jigsaws.continuity_version = 3.0.0-beta.5+1.21 jigsaws.continuity_version = 3.0.0-beta.5+1.21
jigsaws.animatica_version = 0.6.1+1.21 jigsaws.animatica_version = 0.6.1+1.21
jigsaws.colormatic_version = 3.1.2 jigsaws.colormatic_version = 3.1.2

View File

@@ -1,7 +1,9 @@
package net.puzzlemc.core; package net.puzzlemc.core;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.puzzlemc.gui.screen.PuzzleOptionsScreen; import net.puzzlemc.gui.screen.PuzzleOptionsScreen;
import net.puzzlemc.splashscreen.PuzzleSplashScreen; import net.puzzlemc.splashscreen.PuzzleSplashScreen;
@@ -11,8 +13,14 @@ import static net.puzzlemc.core.PuzzleCore.MOD_ID;
import com.terraformersmc.modmenu.api.ConfigScreenFactory; import com.terraformersmc.modmenu.api.ConfigScreenFactory;
import com.terraformersmc.modmenu.api.ModMenuApi; import com.terraformersmc.modmenu.api.ModMenuApi;
import net.fabricmc.api.ClientModInitializer; import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.resource.v1.ResourceLoader;
import net.minecraft.server.packs.PackType; import net.minecraft.server.packs.PackType;
//? if >= 1.21.9 {
import net.fabricmc.fabric.api.resource.v1.ResourceLoader;
//?} else {
/*import net.fabricmc.fabric.api.resource.ResourceManagerHelper;
import net.fabricmc.fabric.api.resource.SimpleSynchronousResourceReloadListener;
import net.minecraft.server.packs.resources.ResourceManager;
*///?}
public class PuzzleClient implements ClientModInitializer, ModMenuApi { public class PuzzleClient implements ClientModInitializer, ModMenuApi {
@@ -26,7 +34,20 @@ public class PuzzleClient implements ClientModInitializer, ModMenuApi {
PuzzleCore.initModules(); PuzzleCore.initModules();
//ResourceManagerHelper.get(PackType.CLIENT_RESOURCES).registerReloadListener //ResourceManagerHelper.get(PackType.CLIENT_RESOURCES).registerReloadListener
//? if >= 1.21.9 {
ResourceLoader.get(PackType.CLIENT_RESOURCES).registerReloader(ResourceLocation.fromNamespaceAndPath(MOD_ID, "splash_screen"), PuzzleSplashScreen.ReloadListener.INSTANCE); ResourceLoader.get(PackType.CLIENT_RESOURCES).registerReloader(ResourceLocation.fromNamespaceAndPath(MOD_ID, "splash_screen"), PuzzleSplashScreen.ReloadListener.INSTANCE);
//?} else {
/*ResourceManagerHelper.get(PackType.CLIENT_RESOURCES).registerReloadListener(new SimpleSynchronousResourceReloadListener() {
@Override
public ResourceLocation getFabricId() {
return ResourceLocation.fromNamespaceAndPath(MOD_ID, "splash_screen");
}
@Override
public void onResourceManagerReload(ResourceManager manager) {
PuzzleSplashScreen.ReloadListener.INSTANCE.onResourceManagerReload(manager);
}
});
*///?}
} }
} }
//?} //?}

View File

@@ -12,6 +12,7 @@ import static net.puzzlemc.gui.PuzzleGui.YES;
public class ColormaticCompat { public class ColormaticCompat {
public static void init() { public static void init() {
//? if fabric {
PuzzleApi.addToResourceOptions(new PuzzleWidget(Component.literal("\uD83C\uDF08 Colormatic"))); PuzzleApi.addToResourceOptions(new PuzzleWidget(Component.literal("\uD83C\uDF08 Colormatic")));
ColormaticConfig colormaticConfig = Colormatic.config(); ColormaticConfig colormaticConfig = Colormatic.config();
PuzzleApi.addToResourceOptions(new PuzzleWidget(Component.translatable("colormatic.config.option.clearSky"), (button) -> button.setMessage(colormaticConfig.clearSky ? YES : NO), (button) -> { PuzzleApi.addToResourceOptions(new PuzzleWidget(Component.translatable("colormatic.config.option.clearSky"), (button) -> button.setMessage(colormaticConfig.clearSky ? YES : NO), (button) -> {
@@ -42,5 +43,6 @@ public class ColormaticCompat {
} }
catch (NumberFormatException ignored) {} catch (NumberFormatException ignored) {}
})); }));
//?}
} }
} }

View File

@@ -11,7 +11,6 @@ import static net.puzzlemc.gui.PuzzleGui.YES;
public class LDLCompat { public class LDLCompat {
public static void init() { public static void init() {
//? fabric {
DynamicLightsConfig ldlConfig = LambDynLights.get().config; DynamicLightsConfig ldlConfig = LambDynLights.get().config;
PuzzleApi.addToGraphicsOptions(new PuzzleWidget(Component.literal("\uD83D\uDCA1 LambDynamicLights"))); PuzzleApi.addToGraphicsOptions(new PuzzleWidget(Component.literal("\uD83D\uDCA1 LambDynamicLights")));
@@ -20,6 +19,5 @@ public class LDLCompat {
PuzzleApi.addToGraphicsOptions(new PuzzleWidget(Component.empty().append("DynLights: ").append(Component.translatable("entity.minecraft.creeper")), (button) -> button.setMessage(ldlConfig.getCreeperLightingMode().getTranslatedText()), (button) -> ldlConfig.setCreeperLightingMode(ldlConfig.getCreeperLightingMode().next()))); PuzzleApi.addToGraphicsOptions(new PuzzleWidget(Component.empty().append("DynLights: ").append(Component.translatable("entity.minecraft.creeper")), (button) -> button.setMessage(ldlConfig.getCreeperLightingMode().getTranslatedText()), (button) -> ldlConfig.setCreeperLightingMode(ldlConfig.getCreeperLightingMode().next())));
PuzzleApi.addToGraphicsOptions(new PuzzleWidget(Component.empty().append("DynLights: ").append(Component.translatable("block.minecraft.tnt")), (button) -> button.setMessage(ldlConfig.getTntLightingMode().getTranslatedText()), (button) -> ldlConfig.setTntLightingMode(ldlConfig.getTntLightingMode().next()))); PuzzleApi.addToGraphicsOptions(new PuzzleWidget(Component.empty().append("DynLights: ").append(Component.translatable("block.minecraft.tnt")), (button) -> button.setMessage(ldlConfig.getTntLightingMode().getTranslatedText()), (button) -> ldlConfig.setTntLightingMode(ldlConfig.getTntLightingMode().next())));
PuzzleApi.addToGraphicsOptions(new PuzzleWidget(Component.empty().append("DynLights: ").append(Component.translatable("lambdynlights.option.light_sources.water_sensitive_check")), (button) -> button.setMessage(ldlConfig.getWaterSensitiveCheck().get() ? YES : NO), (button) -> ldlConfig.getWaterSensitiveCheck().set(!ldlConfig.getWaterSensitiveCheck().get()))); PuzzleApi.addToGraphicsOptions(new PuzzleWidget(Component.empty().append("DynLights: ").append(Component.translatable("lambdynlights.option.light_sources.water_sensitive_check")), (button) -> button.setMessage(ldlConfig.getWaterSensitiveCheck().get() ? YES : NO), (button) -> ldlConfig.getWaterSensitiveCheck().set(!ldlConfig.getWaterSensitiveCheck().get())));
//?}
} }
} }

View File

@@ -7,11 +7,13 @@ import net.minecraft.client.gui.components.tabs.Tab;
import net.minecraft.client.gui.components.tabs.TabManager; import net.minecraft.client.gui.components.tabs.TabManager;
import net.minecraft.client.gui.components.tabs.TabNavigationBar; import net.minecraft.client.gui.components.tabs.TabNavigationBar;
import net.minecraft.client.gui.screens.Screen; import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.input.KeyEvent;
import net.minecraft.network.chat.Component; import net.minecraft.network.chat.Component;
import net.puzzlemc.gui.PuzzleApi; import net.puzzlemc.gui.PuzzleApi;
import net.puzzlemc.gui.PuzzleGui; import net.puzzlemc.gui.PuzzleGui;
import net.puzzlemc.gui.screen.widget.*; import net.puzzlemc.gui.screen.widget.*;
//? if >= 1.21.9
import net.minecraft.client.input.KeyEvent;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
@@ -77,10 +79,6 @@ public class PuzzleOptionsScreen extends Screen {
list.addAll(options); list.addAll(options);
} }
@Override @Override
public boolean keyPressed(KeyEvent input) {
return this.tabNavigation.keyPressed(input) || super.keyPressed(input);
}
@Override
public void tick() { public void tick() {
super.tick(); super.tick();
if (prevTab != null && prevTab != tabManager.getCurrentTab()) { if (prevTab != null && prevTab != tabManager.getCurrentTab()) {
@@ -90,4 +88,15 @@ public class PuzzleOptionsScreen extends Screen {
list.setScrollAmount(0); list.setScrollAmount(0);
} }
} }
@Override
//? if >= 1.21.9 {
public boolean keyPressed(KeyEvent input) {
return this.tabNavigation.keyPressed(input) || super.keyPressed(input);
}
//?} else {
/*public boolean keyPressed(int key, int scanCode, int modifiers) {
return this.tabNavigation.keyPressed(key) || super.keyPressed(key, scanCode, modifiers);
}
*///?}
} }