mirror of
https://github.com/PuzzleMC/Puzzle.git
synced 2025-12-15 19:35:10 +01:00
stonecutter: support 1.21.8
This commit is contained in:
@@ -36,9 +36,16 @@ repositories {
|
||||
maven("https://maven.shedaniel.me/")
|
||||
maven("https://maven.quiltmc.org/repository/release/")
|
||||
}
|
||||
|
||||
val mappingsAttribute = Attribute.of("net.minecraft.mappings", String::class.java)
|
||||
|
||||
dependencies {
|
||||
attributesSchema {
|
||||
attribute(mappingsAttribute)
|
||||
}
|
||||
minecraft("com.mojang:minecraft:$minecraft")
|
||||
|
||||
// Jigsaw modules (GUI compat mods)
|
||||
modCompileOnlyApi ("maven.modrinth:cull-leaves:${mod.jigsaw("cull_leaves_version")}")
|
||||
modCompileOnlyApi ("maven.modrinth:iris:${mod.jigsaw("iris_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")}")
|
||||
//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 ("dev.lambdaurora:spruceui:${mod.jigsaw("spruceui_version")}")
|
||||
|
||||
// Required for Lambda's mods (DO NOT DEPEND ON OTHERWISE)
|
||||
modCompileOnly ("org.quiltmc:quilt-loader:${mod.jigsaw("quilt_loader_version")}")
|
||||
modCompileOnlyApi ("org.quiltmc.quilted-fabric-api:quilted-fabric-api:${mod.jigsaw("quilt_fabric_api_version")}")
|
||||
modCompileOnly ("dev.yumi.mc.core:yumi-mc-foundation:1.0.0-alpha.15+1.21.1")
|
||||
modCompileOnlyApi ("org.aperlambda:lambdajcommon:1.8.1") {
|
||||
exclude(group = "com.google.code.gson")
|
||||
exclude(group = "com.google.guava")
|
||||
}
|
||||
|
||||
// MidnightLib
|
||||
modImplementation ("eu.midnightdust:midnightlib:${mod.dep("midnightlib_version")}+${minecraft}-${loader}")
|
||||
|
||||
if (loader == "fabric") {
|
||||
@@ -75,12 +79,26 @@ dependencies {
|
||||
|
||||
// Fabric API is required to load modded resources
|
||||
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") {
|
||||
"forge"("net.minecraftforge:forge:${minecraft}-${mod.dep("forge_loader")}")
|
||||
}
|
||||
if (loader == "neoforge") {
|
||||
"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())
|
||||
}
|
||||
|
||||
@@ -35,9 +35,9 @@ deps.midnightlib_version=1.9.0-alpha.1
|
||||
|
||||
# Mod integrations
|
||||
jigsaws.cull_leaves_version = 3.0.2-fabric
|
||||
jigsaws.ldl_version = 4.0.0+1.21.4
|
||||
jigsaws.lbg_version = 1.5.2+1.20.1
|
||||
jigsaws.iris_version = 1.8.0-beta.3+1.21-fabric
|
||||
jigsaws.ldl_version = 4.8.6+1.21.10
|
||||
jigsaws.lbg_version = 2.5.0+1.21.9
|
||||
jigsaws.iris_version = 1.9.6+1.21.10-fabric
|
||||
jigsaws.continuity_version = 3.0.0-beta.5+1.21
|
||||
jigsaws.animatica_version = 0.6.1+1.21
|
||||
jigsaws.colormatic_version = 3.1.2
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package net.puzzlemc.core;
|
||||
|
||||
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
import net.puzzlemc.gui.screen.PuzzleOptionsScreen;
|
||||
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.ModMenuApi;
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.fabricmc.fabric.api.resource.v1.ResourceLoader;
|
||||
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 {
|
||||
|
||||
@@ -26,7 +34,20 @@ public class PuzzleClient implements ClientModInitializer, ModMenuApi {
|
||||
PuzzleCore.initModules();
|
||||
|
||||
//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);
|
||||
//?} 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);
|
||||
}
|
||||
});
|
||||
*///?}
|
||||
}
|
||||
}
|
||||
//?}
|
||||
|
||||
@@ -12,6 +12,7 @@ import static net.puzzlemc.gui.PuzzleGui.YES;
|
||||
|
||||
public class ColormaticCompat {
|
||||
public static void init() {
|
||||
//? if fabric {
|
||||
PuzzleApi.addToResourceOptions(new PuzzleWidget(Component.literal("\uD83C\uDF08 Colormatic")));
|
||||
ColormaticConfig colormaticConfig = Colormatic.config();
|
||||
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) {}
|
||||
}));
|
||||
//?}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ import static net.puzzlemc.gui.PuzzleGui.YES;
|
||||
|
||||
public class LDLCompat {
|
||||
public static void init() {
|
||||
//? fabric {
|
||||
DynamicLightsConfig ldlConfig = LambDynLights.get().config;
|
||||
|
||||
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("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())));
|
||||
//?}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.TabNavigationBar;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.client.input.KeyEvent;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.puzzlemc.gui.PuzzleApi;
|
||||
import net.puzzlemc.gui.PuzzleGui;
|
||||
import net.puzzlemc.gui.screen.widget.*;
|
||||
//? if >= 1.21.9
|
||||
import net.minecraft.client.input.KeyEvent;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
@@ -77,10 +79,6 @@ public class PuzzleOptionsScreen extends Screen {
|
||||
list.addAll(options);
|
||||
}
|
||||
@Override
|
||||
public boolean keyPressed(KeyEvent input) {
|
||||
return this.tabNavigation.keyPressed(input) || super.keyPressed(input);
|
||||
}
|
||||
@Override
|
||||
public void tick() {
|
||||
super.tick();
|
||||
if (prevTab != null && prevTab != tabManager.getCurrentTab()) {
|
||||
@@ -90,4 +88,15 @@ public class PuzzleOptionsScreen extends Screen {
|
||||
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);
|
||||
}
|
||||
*///?}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user