mirror of
https://github.com/PuzzleMC/Puzzle.git
synced 2025-12-15 19:35:10 +01:00
Compare commits
8 Commits
6b51595caa
...
multiversi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5117c886e0 | ||
|
|
185e2f9a7c | ||
|
|
11c8ba6837 | ||
|
|
2611a29107 | ||
|
|
9dd384359f | ||
|
|
7149307f1f | ||
|
|
1d52a5e3de | ||
|
|
30e09acfb7 |
14
CHANGELOG.md
14
CHANGELOG.md
@@ -0,0 +1,14 @@
|
||||
## Puzzle v2.2.1
|
||||
- Add support for 1.21.11 (Mounts of Mayhem)
|
||||
- Fix crash when ModMenu is missing
|
||||
- Fix 1.21.4 support by providing an extra build
|
||||
- This is the first 1.21.4 build with working splashscreen logo blending!
|
||||
- Load splashscreen textures earlier on NeoForge
|
||||
- Update to MidnightLib 1.9.2
|
||||
|
||||
# Puzzle v2.2.0
|
||||
- Setup a **multiversion** build environment
|
||||
- Puzzle will now always be up-to-date on all relevant versions of Minecraft
|
||||
(Fabric/Forge 1.20.1; Fabric/NeoForge 1.21.1, 1.21.5, 1.21.8, 1.21.10)
|
||||
- Migrate to Mojang mappings in preparation for upcoming non-obfuscated releases
|
||||
- Updated Entity Model/Texture Features compatibility
|
||||
@@ -3,6 +3,7 @@ plugins {
|
||||
id("architectury-plugin")
|
||||
id("me.modmuss50.mod-publish-plugin")
|
||||
id("com.github.johnrengelman.shadow")
|
||||
`maven-publish`
|
||||
}
|
||||
|
||||
val minecraft = stonecutter.current.version
|
||||
@@ -22,7 +23,7 @@ repositories {
|
||||
maven("https://maven.nucleoid.xyz/")
|
||||
|
||||
// MidnightLib
|
||||
maven("https://maven.midnightdust.eu/snapshots/")
|
||||
maven("https://maven.midnightdust.eu/releases/")
|
||||
|
||||
// Jigsaw modules
|
||||
maven("https://api.modrinth.com/maven")
|
||||
@@ -71,7 +72,13 @@ dependencies {
|
||||
}
|
||||
|
||||
// MidnightLib
|
||||
modImplementation ("eu.midnightdust:midnightlib:${mod.dep("midnightlib_version")}+${minecraft}-${loader}")
|
||||
val midnightlib = if (mod.dep("midnightlib_version").contains("+")) "eu.midnightdust:midnightlib:${mod.dep("midnightlib_version")}"
|
||||
else "eu.midnightdust:midnightlib:${mod.dep("midnightlib_version")}+${minecraft}-${loader}"
|
||||
modImplementation(midnightlib) {
|
||||
exclude(group = "net.fabricmc.fabric-api")
|
||||
exclude(group = "com.terraformersmc")
|
||||
}
|
||||
include(midnightlib)
|
||||
|
||||
if (loader == "fabric") {
|
||||
modImplementation("net.fabricmc:fabric-loader:${mod.dep("fabric_loader")}")
|
||||
@@ -121,21 +128,24 @@ publishMods {
|
||||
file = project.tasks.remapJar.get().archiveFile
|
||||
dryRun = modrinthToken == null || curseforgeToken == null
|
||||
|
||||
displayName = "${mod.name} ${loader.replaceFirstChar { it.uppercase() }} ${property("mod.mc_title")}-${mod.version}"
|
||||
version = mod.version
|
||||
displayName = "${mod.name} ${mod.version} - ${loader.replaceFirstChar { it.uppercase() }} ${property("mod.mc_title")}"
|
||||
version = "${mod.version}+${property("mod.mc_title")}-${loader}"
|
||||
changelog = rootProject.file("CHANGELOG.md").readText()
|
||||
type = BETA
|
||||
type = STABLE
|
||||
|
||||
modLoaders.add(loader)
|
||||
if (loader == "fabric") {
|
||||
modLoaders.add("quilt")
|
||||
}
|
||||
|
||||
val targets = property("mod.mc_targets").toString().split(' ')
|
||||
modrinth {
|
||||
projectId = property("publish.modrinth").toString()
|
||||
accessToken = modrinthToken
|
||||
targets.forEach(minecraftVersions::add)
|
||||
requires("midnightlib")
|
||||
if (loader == "fabric") {
|
||||
requires("fabric-api")
|
||||
optional("modmenu")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,21 +153,41 @@ publishMods {
|
||||
projectId = property("publish.curseforge").toString()
|
||||
accessToken = curseforgeToken.toString()
|
||||
targets.forEach(minecraftVersions::add)
|
||||
requires("midnightlib")
|
||||
if (loader == "fabric") {
|
||||
requires("fabric-api")
|
||||
optional("modmenu")
|
||||
}
|
||||
}
|
||||
|
||||
github {
|
||||
accessToken = githubToken
|
||||
repository = "TeamMidnightDust/MidnightLib"
|
||||
commitish = "multiversion" // This is the branch the release tag will be created from
|
||||
// github {
|
||||
// accessToken = githubToken
|
||||
// repository = "TeamMidnightDust/MidnightLib"
|
||||
// commitish = "multiversion" // This is the branch the release tag will be created from
|
||||
//
|
||||
// tagName = "v" + properties["mod.version"]
|
||||
//
|
||||
// // Allow the release to be initially created without any files.
|
||||
// allowEmptyFiles = true
|
||||
// }
|
||||
}
|
||||
publishing {
|
||||
repositories {
|
||||
maven {
|
||||
name = "MidnightDust"
|
||||
url = uri("https://maven.midnightdust.eu/releases")
|
||||
credentials(PasswordCredentials::class)
|
||||
}
|
||||
}
|
||||
publications {
|
||||
create<MavenPublication>("mavenJava") {
|
||||
pom {
|
||||
groupId = "eu.midnightdust"
|
||||
artifactId = project.mod.id
|
||||
version = "${project.version}-${loader}"
|
||||
|
||||
tagName = "v" + properties["mod.version"]
|
||||
|
||||
// Allow the release to be initially created without any files.
|
||||
allowEmptyFiles = true
|
||||
from(components["java"])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,19 +278,27 @@ stonecutter {
|
||||
replace("context.renderComponentTooltip(", "context.setComponentTooltipForNextFrame(")
|
||||
}
|
||||
replacements.string {
|
||||
direction = eval(current.version, ">=1.21.5")
|
||||
direction = eval(current.version, ">=1.21.4")
|
||||
replace("getTextureImage", "loadContents")
|
||||
}
|
||||
replacements.string {
|
||||
direction = eval(current.version, ">=1.21.5")
|
||||
direction = eval(current.version, ">=1.21.4")
|
||||
replace("TextureImage", "TextureContents")
|
||||
}
|
||||
replacements.string {
|
||||
direction = eval(current.version, ">=1.21.5")
|
||||
direction = eval(current.version, ">=1.21.4")
|
||||
replace("SimpleTexture", "ReloadableTexture")
|
||||
}
|
||||
replacements.string {
|
||||
direction = eval(current.version, ">=1.21.11")
|
||||
replace("ResourceLocation", "Identifier")
|
||||
}
|
||||
replacements.string {
|
||||
direction = eval(current.version, ">=1.21")
|
||||
replace("new ResourceLocation", "ResourceLocation.fromNamespaceAndPath")
|
||||
}
|
||||
replacements.string {
|
||||
direction = eval(current.version, ">=1.21.11")
|
||||
replace("net.minecraft.Util", "net.minecraft.util.Util")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ org.gradle.parallel=false
|
||||
#org.gradle.configureondemand=true
|
||||
|
||||
# Mod properties
|
||||
mod.version=2.2.0
|
||||
mod.version=2.2.1
|
||||
mod.group=eu.midnightdust
|
||||
mod.id=puzzle
|
||||
mod.name=Puzzle
|
||||
@@ -31,7 +31,7 @@ deps.neoforge_patch=[VERSIONED]
|
||||
# Mod dependencies
|
||||
deps.yarn_build=[VERSIONED]
|
||||
deps.modmenu_version=[VERSIONED]
|
||||
deps.midnightlib_version=1.9.0-alpha.1
|
||||
deps.midnightlib_version=1.9.2
|
||||
|
||||
# Mod integrations
|
||||
jigsaws.cull_leaves_version = 3.0.2-fabric
|
||||
@@ -47,12 +47,9 @@ jigsaws.toml4j_version = 0.7.2
|
||||
jigsaws.cit_resewn_version = 1.1.3+1.20
|
||||
jigsaws.complete_config_version = 2.3.0
|
||||
jigsaws.spruceui_version=5.0.0+1.20
|
||||
jigsaws.emf_version=2.4.1
|
||||
jigsaws.etf_version=6.2.10
|
||||
jigsaws.emf_version=[VERSIONED]
|
||||
jigsaws.etf_version=[VERSIONED]
|
||||
jigsaws.exordium_version=1.2.1-1.20.2
|
||||
# Required for LBG
|
||||
jigsaws.quilt_loader_version=0.19.0-beta.18
|
||||
jigsaws.quilt_fabric_api_version=7.0.1+0.83.0-1.20
|
||||
|
||||
# Publishing
|
||||
publish.modrinth=3IuO68q1
|
||||
|
||||
@@ -21,10 +21,9 @@ stonecutter {
|
||||
fun mc(loader: String, vararg versions: String) {
|
||||
for (version in versions) vers("$version-$loader", version)
|
||||
}
|
||||
//i would recommend to use neoforge for mc > 1.20.1, i haven't tested template for forge on versions higher than that
|
||||
mc("fabric","1.20.1", "1.21.1", "1.21.5", "1.21.8", "1.21.10")
|
||||
mc("fabric","1.20.1", "1.21.1", "1.21.4", "1.21.5", "1.21.8", "1.21.10", "1.21.11")
|
||||
//WARNING: neoforge uses mods.toml instead of neoforge.mods.toml for versions 1.20.4 (?) and earlier
|
||||
mc("neoforge", "1.21.1", "1.21.5", "1.21.8", "1.21.10")
|
||||
mc("neoforge", "1.21.1", "1.21.4", "1.21.5", "1.21.8", "1.21.10", "1.21.11")
|
||||
}
|
||||
create(rootProject)
|
||||
}
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
package net.puzzlemc.core;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.resources.Identifier;
|
||||
|
||||
import net.puzzlemc.gui.screen.PuzzleOptionsScreen;
|
||||
import net.puzzlemc.splashscreen.PuzzleSplashScreen;
|
||||
|
||||
import static net.puzzlemc.core.PuzzleCore.MOD_ID;
|
||||
|
||||
//? fabric {
|
||||
import com.terraformersmc.modmenu.api.ConfigScreenFactory;
|
||||
import com.terraformersmc.modmenu.api.ModMenuApi;
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.minecraft.server.packs.PackType;
|
||||
//? if >= 1.21.9 {
|
||||
@@ -20,25 +17,19 @@ import net.fabricmc.fabric.api.resource.SimpleSynchronousResourceReloadListener;
|
||||
import net.minecraft.server.packs.resources.ResourceManager;
|
||||
*///?}
|
||||
|
||||
public class PuzzleClient implements ClientModInitializer, ModMenuApi {
|
||||
|
||||
@Override
|
||||
public ConfigScreenFactory<?> getModConfigScreenFactory() {
|
||||
return PuzzleOptionsScreen::new;
|
||||
}
|
||||
|
||||
public class PuzzleClient implements ClientModInitializer {
|
||||
@Override
|
||||
public void onInitializeClient() {
|
||||
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);
|
||||
ResourceLoader.get(PackType.CLIENT_RESOURCES).registerReloader(Identifier.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");
|
||||
public Identifier getFabricId() {
|
||||
return Identifier.fromNamespaceAndPath(MOD_ID, "splash_screen");
|
||||
}
|
||||
@Override
|
||||
public void onResourceManagerReload(ResourceManager manager) {
|
||||
@@ -56,7 +47,7 @@ import net.neoforged.bus.api.SubscribeEvent;
|
||||
import net.neoforged.fml.ModList;
|
||||
import net.neoforged.fml.common.EventBusSubscriber;
|
||||
import net.neoforged.fml.common.Mod;
|
||||
|
||||
import net.puzzlemc.gui.screen.PuzzleOptionsScreen;
|
||||
import net.neoforged.neoforge.client.gui.IConfigScreenFactory;
|
||||
//? if >= 1.21.5 {
|
||||
import net.neoforged.neoforge.client.event.AddClientReloadListenersEvent;
|
||||
@@ -76,7 +67,7 @@ public class PuzzleClient {
|
||||
//? if >= 1.21.5 {
|
||||
@SubscribeEvent
|
||||
public static void onResourceReload(AddClientReloadListenersEvent event) {
|
||||
event.addListener(ResourceLocation.fromNamespaceAndPath(MOD_ID, "splash_screen"), PuzzleSplashScreen.ReloadListener.INSTANCE);
|
||||
event.addListener(Identifier.fromNamespaceAndPath(MOD_ID, "splash_screen"), PuzzleSplashScreen.ReloadListener.INSTANCE);
|
||||
}
|
||||
//?} else {
|
||||
/^@SubscribeEvent
|
||||
|
||||
14
src/main/java/net/puzzlemc/core/PuzzleModMenu.java
Normal file
14
src/main/java/net/puzzlemc/core/PuzzleModMenu.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package net.puzzlemc.core;
|
||||
|
||||
//? fabric {
|
||||
import com.terraformersmc.modmenu.api.ConfigScreenFactory;
|
||||
import com.terraformersmc.modmenu.api.ModMenuApi;
|
||||
import net.puzzlemc.gui.screen.PuzzleOptionsScreen;
|
||||
|
||||
public class PuzzleModMenu implements ModMenuApi {
|
||||
@Override
|
||||
public ConfigScreenFactory<?> getModConfigScreenFactory() {
|
||||
return PuzzleOptionsScreen::new;
|
||||
}
|
||||
}
|
||||
//?}
|
||||
@@ -4,7 +4,7 @@ import eu.midnightdust.core.MidnightLib;
|
||||
import eu.midnightdust.lib.util.PlatformFunctions;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.resources.Identifier;
|
||||
import net.puzzlemc.core.config.PuzzleConfig;
|
||||
import net.puzzlemc.gui.compat.*;
|
||||
import net.puzzlemc.gui.screen.widget.PuzzleWidget;
|
||||
@@ -17,7 +17,7 @@ import static net.puzzlemc.core.PuzzleCore.MOD_ID;
|
||||
public class PuzzleGui {
|
||||
public static final Component YES = Component.translatable("gui.yes").withStyle(ChatFormatting.GREEN);
|
||||
public static final Component NO = Component.translatable("gui.no").withStyle(ChatFormatting.RED);
|
||||
public static final ResourceLocation PUZZLE_BUTTON = ResourceLocation.fromNamespaceAndPath(MOD_ID, "icon/button");
|
||||
public static final Identifier PUZZLE_BUTTON = Identifier.fromNamespaceAndPath(MOD_ID, "icon/button");
|
||||
|
||||
public static void init() {
|
||||
MidnightLib.hiddenMods.add(MOD_ID);
|
||||
@@ -32,10 +32,12 @@ public class PuzzleGui {
|
||||
PuzzleConfig.write(MOD_ID);
|
||||
Minecraft.getInstance().getTextureManager()./*? if >= 1.21.5 {*/ registerAndLoad /*?} else {*//*register*//*?}*/(PuzzleSplashScreen.LOGO, new PuzzleSplashScreen.LogoTexture(PuzzleSplashScreen.LOGO));
|
||||
}));
|
||||
PuzzleApi.addToResourceOptions(new PuzzleWidget(Component.translatable("puzzle.option.unlimited_model_rotations"), (button) -> button.setMessage(PuzzleConfig.unlimitedRotations ? YES : NO), (button) -> {
|
||||
//? if < 1.21.11 {
|
||||
/*PuzzleApi.addToResourceOptions(new PuzzleWidget(Component.translatable("puzzle.option.unlimited_model_rotations"), (button) -> button.setMessage(PuzzleConfig.unlimitedRotations ? YES : NO), (button) -> {
|
||||
PuzzleConfig.unlimitedRotations = !PuzzleConfig.unlimitedRotations;
|
||||
PuzzleConfig.write(MOD_ID);
|
||||
}));
|
||||
*///?}
|
||||
PuzzleApi.addToResourceOptions(new PuzzleWidget(Component.translatable("puzzle.option.bigger_custom_models"), (button) -> button.setMessage(PuzzleConfig.biggerModels ? YES : NO), (button) -> {
|
||||
PuzzleConfig.biggerModels = !PuzzleConfig.biggerModels;
|
||||
PuzzleConfig.write(MOD_ID);
|
||||
@@ -53,7 +55,7 @@ public class PuzzleGui {
|
||||
if (isActive("lambdabettergrass")) LBGCompat.init();
|
||||
if (isActive("continuity")) ContinuityCompat.init();
|
||||
try {
|
||||
if (isActive("entity_Componenture_features")) ETFCompat.init();
|
||||
if (isActive("entity_texture_features")) ETFCompat.init();
|
||||
if (isActive("entity_model_features")) EMFCompat.init();
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("ETF/EMF config structure changed. Again...", e);
|
||||
|
||||
@@ -1,32 +1,54 @@
|
||||
package net.puzzlemc.gui.compat;
|
||||
|
||||
import eu.midnightdust.lib.util.PlatformFunctions;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.puzzlemc.gui.PuzzleApi;
|
||||
import net.puzzlemc.gui.screen.widget.PuzzleWidget;
|
||||
import traben.entity_model_features.EMF;
|
||||
import traben.entity_model_features.config.EMFConfig;
|
||||
import traben.entity_texture_features.config.ETFConfig;
|
||||
import traben.entity_texture_features.config.screens.ETFConfigScreenMain;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.NavigableSet;
|
||||
import java.util.Objects;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import static net.puzzlemc.gui.PuzzleGui.NO;
|
||||
import static net.puzzlemc.gui.PuzzleGui.YES;
|
||||
|
||||
public class EMFCompat {
|
||||
public static void init() {
|
||||
PuzzleApi.addToResourceOptions(new PuzzleWidget(Component.literal("\uD83D\uDC37 ").append(Component.translatable("entity_model_features.title"))));
|
||||
EMFConfig emfConfig = EMF.config().getConfig();
|
||||
if (PlatformFunctions.isModLoaded("physicsmod")) {
|
||||
PuzzleApi.addToResourceOptions(new PuzzleWidget(Component.translatable("entity_model_features.config.physics"), (button) -> button.setMessage(emfConfig.attemptPhysicsModPatch_2 != EMFConfig.PhysicsModCompatChoice.OFF ?
|
||||
Component.translatable("entity_model_features.config." + (emfConfig.attemptPhysicsModPatch_2 == EMFConfig.PhysicsModCompatChoice.VANILLA ? "physics.1" : "physics.2")) : CommonComponents.OPTION_OFF), (button) -> {
|
||||
final NavigableSet<EMFConfig.PhysicsModCompatChoice> set =
|
||||
new TreeSet<>(EnumSet.allOf(EMFConfig.PhysicsModCompatChoice.class));
|
||||
|
||||
emfConfig.attemptPhysicsModPatch_2 = Objects.requireNonNullElseGet(
|
||||
set.higher(emfConfig.attemptPhysicsModPatch_2), set::first);
|
||||
EMF.config().saveToFile();
|
||||
}));
|
||||
}
|
||||
PuzzleApi.addToResourceOptions(new PuzzleWidget(Component.translatable("entity_model_features.config.update"), (button) -> button.setMessage(Component.literal(emfConfig.modelUpdateFrequency.toString())), (button) -> {
|
||||
final NavigableSet<ETFConfig.UpdateFrequency> set = new TreeSet<>(EnumSet.allOf(ETFConfig.UpdateFrequency.class));
|
||||
emfConfig.modelUpdateFrequency = Objects.requireNonNullElseGet(set.higher(emfConfig.modelUpdateFrequency), set::first);
|
||||
EMF.config().saveToFile();
|
||||
}));
|
||||
PuzzleApi.addToResourceOptions(new PuzzleWidget(0, 65, Component.translatable("entity_model_features.config.lod"), () -> emfConfig.animationLODDistance,
|
||||
(button) -> button.setMessage(lodMessage(emfConfig.animationLODDistance)),
|
||||
(slider) -> {
|
||||
try {
|
||||
emfConfig.animationLODDistance = slider.getInt();
|
||||
} catch (NumberFormatException ignored) {}
|
||||
EMF.config().saveToFile();
|
||||
}));
|
||||
PuzzleApi.addToGraphicsOptions(new PuzzleWidget(Component.translatable("entity_model_features.config.low_fps_lod"), (button) -> button.setMessage(emfConfig.retainDetailOnLowFps ? YES : NO), (button) -> {
|
||||
emfConfig.retainDetailOnLowFps = !emfConfig.retainDetailOnLowFps;
|
||||
EMF.config().saveToFile();
|
||||
}));
|
||||
PuzzleApi.addToGraphicsOptions(new PuzzleWidget(Component.translatable("entity_model_features.config.large_mob_lod"), (button) -> button.setMessage(emfConfig.retainDetailOnLargerMobs ? YES : NO), (button) -> {
|
||||
emfConfig.retainDetailOnLargerMobs = !emfConfig.retainDetailOnLargerMobs;
|
||||
EMF.config().saveToFile();
|
||||
}));
|
||||
PuzzleApi.addToResourceOptions(new PuzzleWidget(Component.translatable("puzzle.action.open_config_screen"), (button) -> button.setMessage(Component.nullToEmpty("OPEN")), button -> Minecraft.getInstance().setScreen(new ETFConfigScreenMain(Minecraft.getInstance().screen))));
|
||||
}
|
||||
public static Component lodMessage(int value) {
|
||||
if (value == 20) return Component.literal(value + " (Default)");
|
||||
else if (value == 0 || value == 65) return CommonComponents.OPTION_OFF.copy().withStyle(ChatFormatting.RED);
|
||||
else return Component.literal(String.valueOf(value)).withStyle(ChatFormatting.AQUA);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package net.puzzlemc.gui.compat;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.puzzlemc.gui.PuzzleApi;
|
||||
import net.puzzlemc.gui.screen.widget.PuzzleWidget;
|
||||
import traben.entity_texture_features.ETFApi;
|
||||
import traben.entity_texture_features.config.ETFConfig;
|
||||
import traben.entity_texture_features.config.screens.ETFConfigScreenMain;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.NavigableSet;
|
||||
@@ -43,5 +45,6 @@ public class ETFCompat {
|
||||
etfConfig.skinFeaturesEnabled = !etfConfig.skinFeaturesEnabled;
|
||||
ETFApi.saveETFConfigChangesAndResetETF();
|
||||
}));
|
||||
PuzzleApi.addToResourceOptions(new PuzzleWidget(Component.translatable("puzzle.action.open_config_screen"), (button) -> button.setMessage(Component.nullToEmpty("OPEN")), button -> Minecraft.getInstance().setScreen(new ETFConfigScreenMain(Minecraft.getInstance().screen))));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ import net.puzzlemc.gui.PuzzleGui;
|
||||
//?} else {
|
||||
/*import net.minecraft.client.gui.screens.OptionsScreen;
|
||||
import net.minecraft.client.gui.components.TextAndImageButton;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.resources.Identifier;
|
||||
|
||||
import static net.puzzlemc.core.PuzzleCore.MOD_ID;
|
||||
*///?}
|
||||
@@ -66,7 +66,7 @@ public abstract class MixinOptionsScreen extends Screen {
|
||||
puzzle$button.setPosition(this.width / 2 - 178 + i, layout.getY() + layout.getFooterHeight() - 4);
|
||||
}
|
||||
//?} else {
|
||||
/*@Unique TextAndImageButton puzzle$button = TextAndImageButton.builder(Component.translatable("midnightlib.overview.title"), ResourceLocation.fromNamespaceAndPath(MOD_ID, "icon/button.png"),
|
||||
/*@Unique TextAndImageButton puzzle$button = TextAndImageButton.builder(Component.translatable("midnightlib.overview.title"), Identifier.fromNamespaceAndPath(MOD_ID, "icon/button.png"),
|
||||
button -> Objects.requireNonNull(minecraft).setScreen(new PuzzleOptionsScreen(this))).textureSize(19, 19).usedTextureSize(16, 16).offset(-2, 0).build();
|
||||
|
||||
@Inject(at = @At("HEAD"), method = "init")
|
||||
|
||||
@@ -14,9 +14,19 @@ public class PuzzleButtonWidget extends Button {
|
||||
this.title = title;
|
||||
}
|
||||
@Override
|
||||
public void renderWidget(GuiGraphics context, int mouseX, int mouseY, float delta) {
|
||||
//? if < 1.21.11 {
|
||||
/*public void renderWidget(GuiGraphics context, int mouseX, int mouseY, float delta) {
|
||||
*///?} else {
|
||||
public void renderContents(GuiGraphics context, int mouseX, int mouseY, float delta) {
|
||||
//?}
|
||||
try { title.setTitle(this);
|
||||
} catch (Exception e) {e.fillInStackTrace(); this.visible = false;}
|
||||
super.renderWidget(context, mouseX, mouseY, delta);
|
||||
|
||||
//? if < 1.21.11 {
|
||||
/*super.renderWidget(context, mouseX, mouseY, delta);
|
||||
*///?} else {
|
||||
this.renderDefaultSprite(context);
|
||||
this.renderDefaultLabel(context.textRendererForWidget(this, GuiGraphics.HoveredTextEffects.NONE));
|
||||
//?}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ public class PuzzleOptionListWidget extends MidnightConfigListWidget {
|
||||
ButtonEntry e = this.getHovered();
|
||||
if (minecraft.screen instanceof PuzzleOptionsScreen page && e != null && !e.buttons.isEmpty() &&
|
||||
e.text.getContents() instanceof TranslatableContents content) {
|
||||
AbstractWidget button = e.buttons.getFirst();
|
||||
AbstractWidget button = e.buttons.get(0);
|
||||
String key = null;
|
||||
if (I18n.exists(content.getKey() + ".tooltip")) key = content.getKey() + ".tooltip";
|
||||
else if (I18n.exists(content.getKey() + ".desc")) key = content.getKey() + ".desc";
|
||||
|
||||
@@ -3,7 +3,6 @@ package net.puzzlemc.models.mixin;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParseException;
|
||||
import net.minecraft.client.renderer.block.model.BlockElement;
|
||||
import net.minecraft.util.GsonHelper;
|
||||
import net.puzzlemc.core.config.PuzzleConfig;
|
||||
import org.joml.Vector3f;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
@@ -11,10 +10,13 @@ import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
//? if < 1.21.11
|
||||
/*import net.minecraft.util.GsonHelper;*/
|
||||
|
||||
@Mixin(BlockElement.Deserializer.class)
|
||||
public abstract class MixinModelElementDeserializer {
|
||||
@Shadow protected abstract Vector3f getVector3f(JsonObject jsonObject, String string);
|
||||
//? if < 1.21.11 {
|
||||
/*@Shadow protected abstract Vector3f getVector3f(JsonObject jsonObject, String string);
|
||||
|
||||
@Inject(at = @At("HEAD"),method = "getAngle", cancellable = true)
|
||||
private void puzzle$deserializeRotationAngle(JsonObject object, CallbackInfoReturnable<Float> cir) {
|
||||
@@ -45,4 +47,22 @@ public abstract class MixinModelElementDeserializer {
|
||||
}
|
||||
}
|
||||
}
|
||||
*///?} else {
|
||||
@Shadow
|
||||
private static Vector3f getVector3f(JsonObject jsonObject, String string) {
|
||||
throw new RuntimeException("MixinModelElementDeserializer from Puzzle could not be loaded properly");
|
||||
}
|
||||
|
||||
@Inject(at = @At("HEAD"),method = "getPosition", cancellable = true)
|
||||
private static void puzzle$deserializePos(JsonObject object, String string, CallbackInfoReturnable<Vector3f> cir) {
|
||||
if (PuzzleConfig.biggerModels) {
|
||||
Vector3f vec3f = getVector3f(object, string);
|
||||
if (!(vec3f.x < -32.0F) && !(vec3f.y < -32.0F) && !(vec3f.z < -32.0F) && !(vec3f.x > 48.0F) && !(vec3f.y > 48.0F) && !(vec3f.z > 48.0F)) {
|
||||
cir.setReturnValue(vec3f);
|
||||
} else {
|
||||
throw new JsonParseException("'%s' specifier exceeds the allowed boundaries: %s".formatted(string, vec3f));
|
||||
}
|
||||
}
|
||||
}
|
||||
//?}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
package net.puzzlemc.splashscreen;
|
||||
|
||||
import com.mojang.blaze3d.pipeline.RenderPipeline;
|
||||
import com.mojang.blaze3d.platform.NativeImage;
|
||||
import eu.midnightdust.lib.util.MidnightColorUtil;
|
||||
import eu.midnightdust.lib.util.PlatformFunctions;
|
||||
import net.minecraft.Util;
|
||||
import net.minecraft.util.Util;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.DynamicTexture;
|
||||
import net.minecraft.client.renderer.texture.ReloadableTexture;
|
||||
import net.minecraft.client.resources.metadata.texture.TextureMetadataSection;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.resources.Identifier;
|
||||
import net.minecraft.server.packs.PackType;
|
||||
import net.minecraft.server.packs.VanillaPackResources;
|
||||
import net.minecraft.server.packs.resources.ResourceManager;
|
||||
@@ -29,6 +28,7 @@ import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
//? if >= 1.21.5 {
|
||||
import com.mojang.blaze3d.pipeline.RenderPipeline;
|
||||
import com.mojang.blaze3d.pipeline.BlendFunction;
|
||||
import com.mojang.blaze3d.platform.DepthTestFunction;
|
||||
import com.mojang.blaze3d.platform.DestFactor;
|
||||
@@ -37,26 +37,39 @@ import net.minecraft.client.renderer.texture.TextureContents;
|
||||
import net.puzzlemc.splashscreen.mixin.RenderPipelinesAccessor;
|
||||
//?}
|
||||
|
||||
//? if = 1.21.5 {
|
||||
//? if = 1.21.4 || = 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 net.minecraft.client.renderer.texture.TextureContents;
|
||||
*///?}
|
||||
|
||||
//? if = 1.21.4 {
|
||||
/*import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import com.mojang.blaze3d.vertex.DefaultVertexFormat;
|
||||
import com.mojang.blaze3d.vertex.VertexFormat;
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import static net.minecraft.client.renderer.RenderStateShard.*;
|
||||
*///?}
|
||||
|
||||
//? if >= 1.21.11
|
||||
import net.minecraft.client.renderer.texture.MipmapStrategy;
|
||||
|
||||
import static net.puzzlemc.core.PuzzleCore.LOGGER;
|
||||
import static net.puzzlemc.core.PuzzleCore.MOD_ID;
|
||||
|
||||
public class PuzzleSplashScreen {
|
||||
public static final ResourceLocation LOGO = ResourceLocation.fromNamespaceAndPath("minecraft", "textures/gui/title/mojangstudios.png");
|
||||
public static final ResourceLocation BACKGROUND = ResourceLocation.fromNamespaceAndPath("minecraft", "puzzle/splash_background.png");
|
||||
public static final Identifier LOGO = Identifier.fromNamespaceAndPath("minecraft", "textures/gui/title/mojangstudios.png");
|
||||
public static final Identifier BACKGROUND = Identifier.fromNamespaceAndPath("minecraft", "puzzle/splash_background.png");
|
||||
public static File CONFIG_PATH = new File(String.valueOf(PlatformFunctions.getConfigDirectory().resolve(".puzzle_cache")));
|
||||
public static Path LOGO_TEXTURE = Paths.get(CONFIG_PATH + "/mojangstudios.png");
|
||||
public static Path BACKGROUND_TEXTURE = Paths.get(CONFIG_PATH + "/splash_background.png");
|
||||
private static Minecraft client = Minecraft.getInstance();
|
||||
private static boolean keepBackground = false;
|
||||
//? if >= 1.21.5
|
||||
public static RenderPipeline CUSTOM_LOGO_PIPELINE;
|
||||
//? if = 1.21.5
|
||||
//? if = 1.21.5 || = 1.21.4
|
||||
/*public static RenderType CUSTOM_LOGO_LAYER;*/
|
||||
|
||||
public static void init() {
|
||||
@@ -68,13 +81,14 @@ public class PuzzleSplashScreen {
|
||||
}
|
||||
}
|
||||
}
|
||||
//? if >= 1.21.5
|
||||
//? if >= 1.21.4
|
||||
buildRenderLayer();
|
||||
}
|
||||
|
||||
//? if >= 1.21.5 {
|
||||
//? if >= 1.21.4 {
|
||||
public static void buildRenderLayer() {
|
||||
if (PuzzleConfig.resourcepackSplashScreen) {
|
||||
//? if >= 1.21.5 {
|
||||
BlendFunction blendFunction = new BlendFunction(SourceFactor.SRC_ALPHA, DestFactor.ONE);
|
||||
if (PuzzleConfig.disableBlend) blendFunction = null;
|
||||
else if (PuzzleConfig.customBlendFunction.size() == 4) {
|
||||
@@ -96,12 +110,38 @@ 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 {
|
||||
//? 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));
|
||||
*///?} else if = 1.21.4 {
|
||||
/*RenderStateShard.TransparencyStateShard transparency = new RenderStateShard.TransparencyStateShard("puzzle_logo_transparency", () -> {
|
||||
RenderSystem.enableBlend();
|
||||
if (PuzzleConfig.disableBlend) RenderSystem.disableBlend();
|
||||
else if (PuzzleConfig.customBlendFunction.size() == 4) {
|
||||
try {
|
||||
RenderSystem.blendFuncSeparate(
|
||||
GlStateManager.SourceFactor.valueOf(PuzzleConfig.customBlendFunction.get(0)),
|
||||
GlStateManager.DestFactor.valueOf(PuzzleConfig.customBlendFunction.get(1)),
|
||||
GlStateManager.SourceFactor.valueOf(PuzzleConfig.customBlendFunction.get(2)),
|
||||
GlStateManager.DestFactor.valueOf(PuzzleConfig.customBlendFunction.get(3)));
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("Incorrect blend function defined in color.properties: {}{}", PuzzleConfig.customBlendFunction, e.getMessage());
|
||||
}
|
||||
}
|
||||
}, () -> {
|
||||
RenderSystem.disableBlend();
|
||||
RenderSystem.defaultBlendFunc();
|
||||
});
|
||||
CUSTOM_LOGO_LAYER = RenderType.create("mojang_logo", DefaultVertexFormat.POSITION_TEX_COLOR, VertexFormat.Mode.QUADS, 786432, RenderType.CompositeState.builder().setTextureState(new RenderStateShard.TextureStateShard(LoadingOverlay.MOJANG_STUDIOS_LOGO_LOCATION, TriState.DEFAULT, false))
|
||||
.setShaderState(POSITION_TEXTURE_COLOR_SHADER)
|
||||
.setTransparencyState(transparency)
|
||||
.setDepthTestState(NO_DEPTH_TEST)
|
||||
.setWriteMaskState(COLOR_WRITE)
|
||||
.createCompositeState(false));
|
||||
*///?}
|
||||
}
|
||||
}
|
||||
@@ -117,8 +157,8 @@ public class PuzzleSplashScreen {
|
||||
client = Minecraft.getInstance();
|
||||
if (PuzzleConfig.resourcepackSplashScreen) {
|
||||
PuzzleSplashScreen.resetColors();
|
||||
client.getTextureManager()./*? if >= 1.21.5 {*/ registerAndLoad /*?} else {*//*register*//*?}*/(LOGO, new LogoTexture(LOGO));
|
||||
client.getTextureManager()./*? if >= 1.21.5 {*/ registerAndLoad /*?} else {*//*register*//*?}*/(BACKGROUND, new LogoTexture(BACKGROUND));
|
||||
client.getTextureManager()./*? if >= 1.21.4 {*/ registerAndLoad /*?} else {*//*register*//*?}*/(LOGO, new LogoTexture(LOGO));
|
||||
client.getTextureManager()./*? if >= 1.21.4 {*/ registerAndLoad /*?} else {*//*register*//*?}*/(BACKGROUND, new LogoTexture(BACKGROUND));
|
||||
|
||||
manager.listResources("optifine", path -> path.getPath().contains("color.properties")).forEach((id, resource) -> {
|
||||
try (InputStream stream = resource.open()) {
|
||||
@@ -156,7 +196,7 @@ public class PuzzleSplashScreen {
|
||||
manager.listResources("textures", path -> path.getPath().contains("mojangstudios.png")).forEach((id, resource) -> {
|
||||
try (InputStream stream = resource.open()) {
|
||||
Files.copy(stream, LOGO_TEXTURE, StandardCopyOption.REPLACE_EXISTING);
|
||||
client.getTextureManager()./*? if >= 1.21.5 {*/ registerAndLoad /*?} else {*//*register*//*?}*/(LOGO, new DynamicLogoTexture());
|
||||
client.getTextureManager()./*? if >= 1.21.4 {*/ registerAndLoad /*?} else {*//*register*//*?}*/(LOGO, new DynamicLogoTexture());
|
||||
if (logoCount.get() > 0) PuzzleConfig.hasCustomSplashScreen = true;
|
||||
logoCount.getAndIncrement();
|
||||
} catch (Exception e) {
|
||||
@@ -167,7 +207,7 @@ public class PuzzleSplashScreen {
|
||||
try (InputStream stream = resource.open()) {
|
||||
Files.copy(stream, BACKGROUND_TEXTURE, StandardCopyOption.REPLACE_EXISTING);
|
||||
InputStream input = new FileInputStream(String.valueOf(PuzzleSplashScreen.BACKGROUND_TEXTURE));
|
||||
client.getTextureManager().register(BACKGROUND, new DynamicTexture(/*? if >= 1.21.5 {*/() -> "splash_screen_background",/*?}*/ NativeImage.read(input)));
|
||||
client.getTextureManager().register(BACKGROUND, new DynamicTexture(/*? if >= 1.21.5 {*/ () -> "splash_screen_background", /*?}*/ NativeImage.read(input)));
|
||||
keepBackground = true;
|
||||
PuzzleConfig.hasCustomSplashScreen = true;
|
||||
} catch (Exception e) {
|
||||
@@ -199,7 +239,7 @@ public class PuzzleSplashScreen {
|
||||
|
||||
|
||||
public static class LogoTexture extends ReloadableTexture {
|
||||
public LogoTexture(ResourceLocation logo) {
|
||||
public LogoTexture(Identifier logo) {
|
||||
super(logo);
|
||||
}
|
||||
|
||||
@@ -208,9 +248,9 @@ public class PuzzleSplashScreen {
|
||||
Minecraft client = Minecraft.getInstance();
|
||||
VanillaPackResources defaultResourcePack = client.getVanillaPackResources();
|
||||
try (InputStream input = Objects.requireNonNull(defaultResourcePack.getResource(PackType.CLIENT_RESOURCES, LOGO)).get()) {
|
||||
return /*? if >= 1.21.5 {*/ new TextureContents(NativeImage.read(input), new TextureMetadataSection(true, true)) /*?} else {*/ /*new TextureContents(new TextureMetadataSection(true, true), NativeImage.read(input)) *//*?}*/;
|
||||
return /*? if >= 1.21.4 {*/ new TextureContents(NativeImage.read(input), new TextureMetadataSection(true, true /*? if >= 1.21.11 {*/, MipmapStrategy.AUTO, 0 /*?}*/)) /*?} else {*/ /*new TextureContents(new TextureMetadataSection(true, true), NativeImage.read(input)) *//*?}*/;
|
||||
} catch (IOException ex) {
|
||||
return /*? if >= 1.21.5 {*/ TextureContents.createMissing() /*?} else {*/ /*new TextureContents(ex) *//*?}*/;
|
||||
return /*? if >= 1.21.4 {*/ TextureContents.createMissing() /*?} else {*/ /*new TextureContents(ex) *//*?}*/;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -222,10 +262,10 @@ public class PuzzleSplashScreen {
|
||||
@Override
|
||||
public @NotNull TextureContents loadContents(ResourceManager resourceManager) {
|
||||
try (InputStream input = new FileInputStream(String.valueOf(PuzzleSplashScreen.LOGO_TEXTURE))) {
|
||||
return /*? if >= 1.21.5 {*/ new TextureContents(NativeImage.read(input), new TextureMetadataSection(true, true)) /*?} else {*/ /*new TextureContents(new TextureMetadataSection(true, true), NativeImage.read(input)) *//*?}*/;
|
||||
return /*? if >= 1.21.4 {*/ new TextureContents(NativeImage.read(input), new TextureMetadataSection(true, true/*? if >= 1.21.11 {*/, MipmapStrategy.AUTO, 0 /*?}*/)) /*?} else {*/ /*new TextureContents(new TextureMetadataSection(true, true), NativeImage.read(input)) *//*?}*/;
|
||||
} catch (IOException e) {
|
||||
LOGGER.error("Encountered an error during logo loading: ", e);
|
||||
//? if >= 1.21.5 {
|
||||
//? if >= 1.21.4 {
|
||||
try {
|
||||
return TextureContents.load(resourceManager, LOGO);
|
||||
} catch (IOException ex) {
|
||||
|
||||
@@ -5,6 +5,7 @@ package net.puzzlemc.splashscreen.mixin;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.client.gui.screens.LoadingOverlay;
|
||||
import net.minecraft.server.packs.resources.ReloadInstance;
|
||||
import net.neoforged.fml.earlydisplay.DisplayWindow;
|
||||
import net.neoforged.neoforge.client.loading.NeoForgeLoadingOverlay;
|
||||
import net.puzzlemc.core.config.PuzzleConfig;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
@@ -21,8 +22,13 @@ public class MixinNeoForgeLoadingOverlay extends LoadingOverlay {
|
||||
super(arg, arg2, consumer, bl);
|
||||
}
|
||||
|
||||
@Inject(method = "<init>", at = @At("TAIL"))
|
||||
private void puzzle$initTexturesNeoforge(Minecraft mc, ReloadInstance reloader, Consumer<Optional<Throwable>> errorConsumer, DisplayWindow displayWindow, CallbackInfo ci) {
|
||||
LoadingOverlay.registerTextures(/^? if >= 1.21.4 {^/ mc.getTextureManager() /^?} else {^/ /^mc ^//^?}^/);
|
||||
}
|
||||
|
||||
@Inject(method = "render", at = @At("HEAD"), cancellable = true) // Replaces the NeoForge loading screen in later stages with the (customized) vanilla version
|
||||
private void redirectNeoForgeLoading(GuiGraphics context, int mouseX, int mouseY, float tickDelta, CallbackInfo ci) {
|
||||
private void puzzle$redirectNeoForgeLoading(GuiGraphics context, int mouseX, int mouseY, float tickDelta, CallbackInfo ci) {
|
||||
if (PuzzleConfig.resourcepackSplashScreen && PuzzleConfig.hasCustomSplashScreen) {
|
||||
super.render(context, mouseX, mouseY, tickDelta);
|
||||
ci.cancel();
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package net.puzzlemc.splashscreen.mixin;
|
||||
|
||||
import com.mojang.blaze3d.platform.NativeImage;
|
||||
import net.minecraft.Util;
|
||||
import net.minecraft.util.Util;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.client.gui.screens.LoadingOverlay;
|
||||
import net.minecraft.client.gui.screens.Overlay;
|
||||
import net.minecraft.client.renderer.texture.DynamicTexture;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.resources.Identifier;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.puzzlemc.core.config.PuzzleConfig;
|
||||
import net.puzzlemc.splashscreen.PuzzleSplashScreen;
|
||||
@@ -30,7 +30,7 @@ import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
|
||||
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
|
||||
import com.mojang.blaze3d.pipeline.RenderPipeline;
|
||||
import net.minecraft.client.renderer.RenderPipelines;
|
||||
//?} else if >= 1.21.5 {
|
||||
//?} else if >= 1.21.4 {
|
||||
/*import net.minecraft.util.ARGB;
|
||||
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
|
||||
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
|
||||
@@ -45,7 +45,7 @@ import static net.puzzlemc.core.PuzzleCore.LOGGER;
|
||||
*///?}
|
||||
|
||||
import static net.puzzlemc.splashscreen.PuzzleSplashScreen.BACKGROUND;
|
||||
//? if >= 1.21.5
|
||||
//? if >= 1.21.4
|
||||
import static net.minecraft.client.gui.screens.LoadingOverlay.MOJANG_STUDIOS_LOGO_LOCATION;
|
||||
|
||||
@Mixin(value = LoadingOverlay.class, priority = 2000)
|
||||
@@ -58,11 +58,11 @@ public abstract class MixinSplashScreen extends Overlay {
|
||||
private static int replaceAlpha(int color, int alpha) {
|
||||
return 0;
|
||||
}
|
||||
//? if < 1.21.5
|
||||
/*@Shadow @Final static ResourceLocation MOJANG_STUDIOS_LOGO_LOCATION;*/
|
||||
//? if < 1.21.4
|
||||
/*@Shadow @Final static Identifier MOJANG_STUDIOS_LOGO_LOCATION;*/
|
||||
|
||||
@Inject(method = "registerTextures", at = @At("TAIL")) // Load our custom textures at game start //
|
||||
//? if >= 1.21.5 {
|
||||
//? if >= 1.21.4 {
|
||||
private static void puzzle$initSplashscreen(TextureManager textureManager, CallbackInfo ci) {
|
||||
//?} else {
|
||||
/*private static void puzzle$initSplashscreen(Minecraft client, CallbackInfo ci) {
|
||||
@@ -70,12 +70,12 @@ public abstract class MixinSplashScreen extends Overlay {
|
||||
*///?}
|
||||
if (PuzzleConfig.resourcepackSplashScreen) {
|
||||
if (PuzzleSplashScreen.LOGO_TEXTURE.toFile().exists()) {
|
||||
textureManager./*? if >= 1.21.5 {*/ registerAndLoad /*?} else {*//*register*//*?}*/(MOJANG_STUDIOS_LOGO_LOCATION, new PuzzleSplashScreen.DynamicLogoTexture());
|
||||
textureManager./*? if >= 1.21.4 {*/ registerAndLoad /*?} else {*//*register*//*?}*/(MOJANG_STUDIOS_LOGO_LOCATION, new PuzzleSplashScreen.DynamicLogoTexture());
|
||||
}
|
||||
if (PuzzleSplashScreen.BACKGROUND_TEXTURE.toFile().exists()) {
|
||||
try {
|
||||
InputStream input = new FileInputStream(String.valueOf(PuzzleSplashScreen.BACKGROUND_TEXTURE));
|
||||
textureManager.register(BACKGROUND, new DynamicTexture(/*? if >= 1.21.5 {*/ () -> "splash_screen_background", /*?}*/ NativeImage.read(input)));
|
||||
textureManager.register(BACKGROUND, new DynamicTexture(/*? if >= 1.21.5 {*/ () ->"splash_screen_background", /*?}*/ NativeImage.read(input)));
|
||||
} catch (IOException ignored) {}
|
||||
}
|
||||
}
|
||||
@@ -87,15 +87,15 @@ public abstract class MixinSplashScreen extends Overlay {
|
||||
}
|
||||
|
||||
//? if >= 1.21.8 {
|
||||
@WrapOperation(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;blit(Lcom/mojang/blaze3d/pipeline/RenderPipeline;Lnet/minecraft/resources/ResourceLocation;IIFFIIIIIII)V"))
|
||||
private void puzzle$modifyRenderLayer(GuiGraphics context, RenderPipeline pipeline, ResourceLocation sprite, int x, int y, float u, float v, int width, int height, int regionWidth, int regionHeight, int textureWidth, int textureHeight, int color, Operation<Void> original) {
|
||||
@WrapOperation(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;blit(Lcom/mojang/blaze3d/pipeline/RenderPipeline;Lnet/minecraft/resources/Identifier;IIFFIIIIIII)V"))
|
||||
private void puzzle$modifyRenderLayer(GuiGraphics context, RenderPipeline pipeline, Identifier sprite, int x, int y, float u, float v, int width, int height, int regionWidth, int regionHeight, int textureWidth, int textureHeight, int color, Operation<Void> original) {
|
||||
if (PuzzleConfig.resourcepackSplashScreen)
|
||||
context.blit(PuzzleSplashScreen.CUSTOM_LOGO_PIPELINE, sprite, x, y, u, v, width, height, regionWidth, regionHeight, textureWidth, textureHeight, color);
|
||||
else context.blit(pipeline, sprite, x, y, u, v, width, height, textureWidth, textureHeight, color);
|
||||
}
|
||||
//?} else if >= 1.21.5 {
|
||||
/*@WrapOperation(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;blit(Ljava/util/function/Function;Lnet/minecraft/resources/ResourceLocation;IIFFIIIIIII)V"))
|
||||
private void puzzle$modifyRenderLayer(GuiGraphics context, Function<ResourceLocation, RenderType> renderType, ResourceLocation sprite, int x, int y, float u, float v, int width, int height, int regionWidth, int regionHeight, int textureWidth, int textureHeight, int color, Operation<Void> original) {
|
||||
//?} else if >= 1.21.4 {
|
||||
/*@WrapOperation(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;blit(Ljava/util/function/Function;Lnet/minecraft/resources/Identifier;IIFFIIIIIII)V"))
|
||||
private void puzzle$modifyRenderLayer(GuiGraphics context, Function<Identifier, RenderType> renderType, Identifier sprite, int x, int y, float u, float v, int width, int height, int regionWidth, int regionHeight, int textureWidth, int textureHeight, int color, Operation<Void> original) {
|
||||
if (PuzzleConfig.resourcepackSplashScreen)
|
||||
context.blit(id -> PuzzleSplashScreen.CUSTOM_LOGO_LAYER, sprite, x, y, u, v, width, height, regionWidth, regionHeight, textureWidth, textureHeight, color);
|
||||
else context.blit(renderType, sprite, x, y, u, v, width, height, textureWidth, textureHeight, color);
|
||||
@@ -135,7 +135,7 @@ public abstract class MixinSplashScreen extends Overlay {
|
||||
|
||||
//? if >= 1.21.8 {
|
||||
context.blit(RenderPipelines.GUI_TEXTURED, BACKGROUND, 0, 0, 0, 0, width, height, width, height, ARGB.white(s));
|
||||
//?} else if >= 1.21.5 {
|
||||
//?} else if >= 1.21.4 {
|
||||
/*context.blit(RenderType::guiTextured, BACKGROUND, 0, 0, 0, 0, width, height, width, height, ARGB.white(s));
|
||||
*///?} else {
|
||||
/*RenderSystem.enableBlend();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package net.puzzlemc.splashscreen.mixin;
|
||||
|
||||
//? if > 1.21.1 {
|
||||
//? if >= 1.21.5 {
|
||||
import com.mojang.blaze3d.pipeline.RenderPipeline;
|
||||
import net.minecraft.client.renderer.RenderPipelines;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
@@ -32,6 +32,6 @@ side = "CLIENT"
|
||||
[[dependencies.puzzle]]
|
||||
modId = "minecraft"
|
||||
mandatory = true
|
||||
versionRange = "[1.21,)"
|
||||
versionRange = "${minecraft}"
|
||||
ordering = "NONE"
|
||||
side = "CLIENT"
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"accessWidener": "puzzle-models.accesswidener"
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
"puzzle.page.resources":"Resource",
|
||||
"puzzle.page.performance":"Performance",
|
||||
"puzzle.page.misc":"Miscellaneous",
|
||||
"puzzle.action.open_config_screen":"Open config screen",
|
||||
"puzzle.option.check_for_updates":"Check for Updates",
|
||||
"puzzle.option.check_for_updates.tooltip":"Enables Puzzle's built-in update checker",
|
||||
"puzzle.option.show_version_info":"Show Puzzle version info",
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
"net.puzzlemc.core.PuzzleClient"
|
||||
],
|
||||
"modmenu": [
|
||||
"net.puzzlemc.core.PuzzleClient"
|
||||
"net.puzzlemc.core.PuzzleModMenu"
|
||||
]
|
||||
},
|
||||
|
||||
@@ -37,6 +37,10 @@
|
||||
|
||||
"depends": {
|
||||
"fabric": "*",
|
||||
"minecraft": ">=1.20"
|
||||
"minecraft": "${minecraft}"
|
||||
},
|
||||
"breaks": {
|
||||
"entity_texture_features": "<7.0.0",
|
||||
"entity_model_features": "<3.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ plugins {
|
||||
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
|
||||
id("me.modmuss50.mod-publish-plugin") version "0.8.4" apply false
|
||||
}
|
||||
stonecutter active "1.21.10-fabric" /* [SC] DO NOT EDIT */
|
||||
stonecutter active "1.21.11-fabric" /* [SC] DO NOT EDIT */
|
||||
|
||||
// See https://stonecutter.kikugie.dev/wiki/config/params
|
||||
stonecutter parameters {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
mod.mc_dep_fabric==1.20.1
|
||||
mod.mc_dep_fabric=>=1.20 <=1.20.1
|
||||
mod.mc_dep_forgelike=[1.20, 1.20.1]
|
||||
mod.mc_title=1.20.1
|
||||
mod.mc_targets=1.20.1
|
||||
mod.mc_targets=1.20 1.20.1
|
||||
|
||||
deps.forge_loader=47.3.0
|
||||
deps.neoforge_loader=[UNSUPPORTED]
|
||||
@@ -9,4 +9,7 @@ deps.neoforge_loader=[UNSUPPORTED]
|
||||
deps.fabric_version=0.92.3+1.20.1
|
||||
deps.modmenu_version=7.2.2
|
||||
|
||||
jigsaws.emf_version=3.0.6-fabric-1.20.1
|
||||
jigsaws.etf_version=7.0.6-fabric-1.20.1
|
||||
|
||||
loom.platform=fabric
|
||||
|
||||
@@ -10,4 +10,7 @@ deps.fabric_version=0.114.0+1.21.1
|
||||
|
||||
deps.modmenu_version=11.0.3
|
||||
|
||||
jigsaws.emf_version=3.0.6-fabric-1.21
|
||||
jigsaws.etf_version=7.0.6-fabric-1.21
|
||||
|
||||
loom.platform=fabric
|
||||
@@ -10,4 +10,7 @@ deps.fabric_version=0.114.0+1.21.1
|
||||
|
||||
deps.modmenu_version=[UNSUPPORTED]
|
||||
|
||||
jigsaws.emf_version=3.0.6-neoforge-1.21
|
||||
jigsaws.etf_version=7.0.6-neoforge-1.21
|
||||
|
||||
loom.platform=neoforge
|
||||
@@ -1,7 +1,7 @@
|
||||
mod.mc_dep_fabric=>=1.21.9
|
||||
mod.mc_dep_forgelike=[1.21.10,)
|
||||
mod.mc_dep_fabric=>=1.21.9 <=1.21.10
|
||||
mod.mc_dep_forgelike=[1.21.9,1.21.10]
|
||||
mod.mc_title=1.21.10
|
||||
mod.mc_targets=1.21.9, 1.21.10
|
||||
mod.mc_targets=1.21.9 1.21.10
|
||||
|
||||
deps.forge_loader=0
|
||||
deps.neoforge_loader=21.10.47-beta
|
||||
@@ -9,4 +9,7 @@ deps.neoforge_loader=21.10.47-beta
|
||||
deps.fabric_version=0.138.0+1.21.10
|
||||
deps.modmenu_version=16.0.0-rc.1
|
||||
|
||||
jigsaws.emf_version=3.0.6-fabric-1.21.9
|
||||
jigsaws.etf_version=7.0.6-fabric-1.21.9
|
||||
|
||||
loom.platform=fabric
|
||||
@@ -1,7 +1,7 @@
|
||||
mod.mc_dep_fabric=>=1.21.9
|
||||
mod.mc_dep_forgelike=[1.21.10,)
|
||||
mod.mc_dep_fabric=>=1.21.9 <=1.21.10
|
||||
mod.mc_dep_forgelike=[1.21.9,1.21.10]
|
||||
mod.mc_title=1.21.10
|
||||
mod.mc_targets=1.21.9, 1.21.10
|
||||
mod.mc_targets=1.21.9 1.21.10
|
||||
|
||||
deps.forge_loader=0
|
||||
deps.neoforge_loader=21.10.47-beta
|
||||
@@ -9,4 +9,7 @@ deps.neoforge_loader=21.10.47-beta
|
||||
deps.fabric_version=0.138.0+1.21.10
|
||||
deps.modmenu_version=16.0.0-rc.1
|
||||
|
||||
jigsaws.emf_version=3.0.6-neoforge-1.21.9
|
||||
jigsaws.etf_version=7.0.6-neoforge-1.21.9
|
||||
|
||||
loom.platform=neoforge
|
||||
15
versions/1.21.11-fabric/gradle.properties
Normal file
15
versions/1.21.11-fabric/gradle.properties
Normal file
@@ -0,0 +1,15 @@
|
||||
mod.mc_dep_fabric=>=1.21.11
|
||||
mod.mc_dep_forgelike=[1.21.11,)
|
||||
mod.mc_title=1.21.11
|
||||
mod.mc_targets=1.21.11
|
||||
|
||||
deps.forge_loader=0
|
||||
deps.neoforge_loader=21.11.3-beta
|
||||
|
||||
deps.fabric_version=0.139.4+1.21.11
|
||||
deps.modmenu_version=17.0.0-alpha.1
|
||||
|
||||
jigsaws.emf_version=3.0.6-neoforge-1.21.9
|
||||
jigsaws.etf_version=7.0.6-neoforge-1.21.9
|
||||
|
||||
loom.platform=fabric
|
||||
15
versions/1.21.11-neoforge/gradle.properties
Normal file
15
versions/1.21.11-neoforge/gradle.properties
Normal file
@@ -0,0 +1,15 @@
|
||||
mod.mc_dep_fabric=>=1.21.11
|
||||
mod.mc_dep_forgelike=[1.21.11,)
|
||||
mod.mc_title=1.21.11
|
||||
mod.mc_targets=1.21.11
|
||||
|
||||
deps.forge_loader=0
|
||||
deps.neoforge_loader=21.11.3-beta
|
||||
|
||||
deps.fabric_version=0.139.4+1.21.11
|
||||
deps.modmenu_version=17.0.0-alpha.1
|
||||
|
||||
jigsaws.emf_version=3.0.6-neoforge-1.21.9
|
||||
jigsaws.etf_version=7.0.6-neoforge-1.21.9
|
||||
|
||||
loom.platform=neoforge
|
||||
16
versions/1.21.4-fabric/gradle.properties
Normal file
16
versions/1.21.4-fabric/gradle.properties
Normal file
@@ -0,0 +1,16 @@
|
||||
mod.mc_dep_fabric=>=1.21.3 <=1.21.4
|
||||
mod.mc_dep_forgelike=[1.21.3,1.21.4]
|
||||
mod.mc_title=1.21.4
|
||||
mod.mc_targets=1.21.3 1.21.4
|
||||
|
||||
deps.forge_loader=0
|
||||
deps.neoforge_loader=21.4.47-beta
|
||||
|
||||
deps.midnightlib_version=1.9.2+1.21.5-fabric
|
||||
deps.fabric_version=0.119.4+1.21.4
|
||||
deps.modmenu_version=13.0.3
|
||||
|
||||
jigsaws.emf_version=3.0.6-fabric-1.21.4
|
||||
jigsaws.etf_version=7.0.6-fabric-1.21.4
|
||||
|
||||
loom.platform=fabric
|
||||
16
versions/1.21.4-neoforge/gradle.properties
Normal file
16
versions/1.21.4-neoforge/gradle.properties
Normal file
@@ -0,0 +1,16 @@
|
||||
mod.mc_dep_fabric=>=1.21.3 <=1.21.4
|
||||
mod.mc_dep_forgelike=[1.21.3,1.21.4]
|
||||
mod.mc_title=1.21.4
|
||||
mod.mc_targets=1.21.3 1.21.4
|
||||
|
||||
deps.forge_loader=0
|
||||
deps.neoforge_loader=21.4.47-beta
|
||||
|
||||
deps.midnightlib_version=1.9.2+1.21.5-neoforge
|
||||
deps.fabric_version=0.119.4+1.21.4
|
||||
deps.modmenu_version=13.0.3
|
||||
|
||||
jigsaws.emf_version=3.0.6-neoforge-1.21.4
|
||||
jigsaws.etf_version=7.0.6-neoforge-1.21.4
|
||||
|
||||
loom.platform=neoforge
|
||||
@@ -1,5 +1,5 @@
|
||||
mod.mc_dep_fabric==1.21.5
|
||||
mod.mc_dep_forgelike=[1.21.5]
|
||||
mod.mc_dep_forgelike=[1.21.5,]
|
||||
mod.mc_title=1.21.5
|
||||
mod.mc_targets=1.21.5
|
||||
|
||||
@@ -9,4 +9,7 @@ deps.neoforge_loader=21.4.47-beta
|
||||
deps.fabric_version=0.121.0+1.21.5
|
||||
deps.modmenu_version=14.0.0-rc.1
|
||||
|
||||
jigsaws.emf_version=3.0.6-fabric-1.21.5
|
||||
jigsaws.etf_version=7.0.6-fabric-1.21.5
|
||||
|
||||
loom.platform=fabric
|
||||
@@ -1,5 +1,5 @@
|
||||
mod.mc_dep_fabric==1.21.5
|
||||
mod.mc_dep_forgelike=[1.21.5]
|
||||
mod.mc_dep_forgelike=[1.21.5,]
|
||||
mod.mc_title=1.21.5
|
||||
mod.mc_targets=1.21.5
|
||||
|
||||
@@ -9,4 +9,7 @@ deps.neoforge_loader=21.5.54-beta
|
||||
deps.fabric_version=0.121.0+1.21.5
|
||||
deps.modmenu_version=[UNSUPPORTED]
|
||||
|
||||
jigsaws.emf_version=3.0.6-neoforge-1.21.5
|
||||
jigsaws.etf_version=7.0.6-neoforge-1.21.5
|
||||
|
||||
loom.platform=neoforge
|
||||
@@ -1,7 +1,7 @@
|
||||
mod.mc_dep_fabric==1.21.8
|
||||
mod.mc_dep_forgelike=[1.21.8]
|
||||
mod.mc_dep_fabric=>=1.21.6 <=1.21.8
|
||||
mod.mc_dep_forgelike=[1.21.6, 1.21.8]
|
||||
mod.mc_title=1.21.8
|
||||
mod.mc_targets=1.21.8
|
||||
mod.mc_targets=1.21.6 1.21.7 1.21.8
|
||||
|
||||
deps.forge_loader=0
|
||||
deps.neoforge_loader=21.8.50
|
||||
@@ -9,4 +9,7 @@ deps.neoforge_loader=21.8.50
|
||||
deps.fabric_version=0.136.0+1.21.8
|
||||
deps.modmenu_version=15.0.0
|
||||
|
||||
jigsaws.emf_version=3.0.6-fabric-1.21.6
|
||||
jigsaws.etf_version=7.0.6-fabric-1.21.6
|
||||
|
||||
loom.platform=fabric
|
||||
@@ -1,7 +1,7 @@
|
||||
mod.mc_dep_fabric==1.21.5
|
||||
mod.mc_dep_forgelike=[1.21.5]
|
||||
mod.mc_title=1.21.5
|
||||
mod.mc_targets=1.21.5
|
||||
mod.mc_dep_fabric=>=1.21.6 <=1.21.8
|
||||
mod.mc_dep_forgelike=[1.21.6, 1.21.8]
|
||||
mod.mc_title=1.21.8
|
||||
mod.mc_targets=1.21.6 1.21.7 1.21.8
|
||||
|
||||
deps.forge_loader=0
|
||||
deps.neoforge_loader=21.8.50
|
||||
@@ -9,4 +9,7 @@ deps.neoforge_loader=21.8.50
|
||||
deps.fabric_version=0.136.0+1.21.8
|
||||
deps.modmenu_version=[UNSUPPORTED]
|
||||
|
||||
jigsaws.emf_version=3.0.6-neoforge-1.21.6
|
||||
jigsaws.etf_version=7.0.6-neoforge-1.21.6
|
||||
|
||||
loom.platform=neoforge
|
||||
Reference in New Issue
Block a user