Update to 1.18.1, New Icon, CEM integration, Better Iris integration

This commit is contained in:
Motschen
2021-12-30 12:42:18 +01:00
parent 066cc56268
commit d8ce15e5da
26 changed files with 147 additions and 105 deletions

View File

@@ -1,6 +1,6 @@
// Based on https://github.com/OnyxStudios/Cardinal-Components-API/blob/1.17/build.gradle // Based on https://github.com/OnyxStudios/Cardinal-Components-API/blob/1.17/build.gradle
plugins { plugins {
id "fabric-loom" version "0.8-SNAPSHOT" apply false id "fabric-loom" version "0.10-SNAPSHOT" apply false
id "com.matthewprenger.cursegradle" version "1.4.0" id "com.matthewprenger.cursegradle" version "1.4.0"
id "maven-publish" id "maven-publish"
id "java-library" id "java-library"
@@ -17,13 +17,11 @@ subprojects {
archivesBaseName = project.name archivesBaseName = project.name
group = "${rootProject.group}.${rootProject.archivesBaseName}" group = "${rootProject.group}.${rootProject.archivesBaseName}"
//apply from: "https://raw.githubusercontent.com/OnyxStudios/Gradle-Scripts/master/scripts/fabric/basic_project.gradle"
} }
allprojects { allprojects {
apply plugin: "fabric-loom" apply plugin: "fabric-loom"
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_16 sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17
version = System.getenv("TRAVIS_TAG") ?: rootProject.mod_version version = System.getenv("TRAVIS_TAG") ?: rootProject.mod_version
configurations { configurations {
@@ -55,7 +53,7 @@ allprojects {
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
tasks.withType(JavaCompile).configureEach { tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8" it.options.encoding = "UTF-8"
it.options.release = 16 it.options.release = 17
} }
java { java {
@@ -119,10 +117,17 @@ repositories {
includeGroup "curse.maven" includeGroup "curse.maven"
} }
} }
maven {
name = 'JitPack'
url 'https://jitpack.io'
}
maven {
url "https://maven.shedaniel.me/"
}
} }
dependencies { dependencies {
modImplementation "net.fabricmc.fabric-api:fabric-api:0.34.8+1.17" modImplementation ("net.fabricmc.fabric-api:fabric-api:${project.fabric_version}")
modImplementation ("com.terraformersmc:modmenu:${project.mod_menu_version}") { modImplementation ("com.terraformersmc:modmenu:${project.mod_menu_version}") {
exclude group: "net.fabricmc.fabric-api" exclude group: "net.fabricmc.fabric-api"
} }
@@ -133,7 +138,8 @@ dependencies {
modImplementation ("maven.modrinth:cit-resewn:${project.cit_resewn_version}") modImplementation ("maven.modrinth:cit-resewn:${project.cit_resewn_version}")
modImplementation ("maven.modrinth:continuity:${project.continuity_version}") modImplementation ("maven.modrinth:continuity:${project.continuity_version}")
modImplementation ("maven.modrinth:animatica:${project.animatica_version}") modImplementation ("maven.modrinth:animatica:${project.animatica_version}")
modImplementation "curse.maven:custom-entity-models-cem-477078:3440846" modImplementation ("curse.maven:custom-entity-models-cem-477078:${project.cem_version}")
modImplementation "com.gitlab.Lortseam:completeconfig:${project.complete_config_version}"
modImplementation("org.aperlambda:lambdajcommon:1.8.1") { modImplementation("org.aperlambda:lambdajcommon:1.8.1") {
exclude group: 'com.google.code.gson' exclude group: 'com.google.code.gson'

View File

@@ -3,26 +3,28 @@ org.gradle.jvmargs=-Xmx1G
# Fabric Properties # Fabric Properties
# check these on https://fabricmc.net/use # check these on https://fabricmc.net/use
minecraft_version=1.17.1 minecraft_version=1.18.1
yarn_mappings=1.17.1+build.61 yarn_mappings=1.18.1+build.12
loader_version=0.11.7 loader_version=0.12.12
# Mod Properties # Mod Properties
mod_version = 1.1.0 mod_version = 0.1.0-pre1
maven_group = net.puzzlemc maven_group = net.puzzlemc
archives_base_name = puzzle archives_base_name = puzzle
# Dependencies # Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_version=0.40.1+1.17 fabric_version=0.45.0+1.18
mod_menu_version = 2.0.13 mod_menu_version = 2.0.13
cull_leaves_version = 2.3.0 cull_leaves_version = 2.3.2
ldl_version = 2.1.0+1.17 ldl_version = 2.1.0+1.17
lbg_version = 1.2.1+1.17 lbg_version = 1.2.2+1.17
iris_version = mc1.17.1-1.1.2 iris_version = mc1.18.1-1.1.3
continuity_version = 1.0.0+1.17 continuity_version = 1.0.3+1.18
animatica_version = 0.1+1.17 animatica_version = 0.2+1.18
cit_resewn_version = 0.8.1 cit_resewn_version = 0.8.1-1.18
spruceui_version=3.3.0+1.17 cem_version = 3561474
complete_config_version = 1.0.0
spruceui_version=3.3.2+1.17
midnightlib_version=0.3.1 midnightlib_version=0.3.1

View File

@@ -6,13 +6,13 @@ import net.fabricmc.api.ClientModInitializer;
public class PuzzleCore implements ClientModInitializer { public class PuzzleCore implements ClientModInitializer {
public final static String version = "Puzzle R1"; public final static String version = "Puzzle B0";
public final static String name = "Puzzle"; public final static String name = "Puzzle";
public final static String id = "puzzle"; public final static String id = "puzzle";
public final static String website = "https://github.com/PuzzleMC/Puzzle"; public final static String website = "https://github.com/PuzzleMC/Puzzle";
public static String updateURL = website; //+"download"; public static String updateURL = website; //+"download";
public final static String UPDATE_URL = "https://raw.githubusercontent.com/PuzzleMC/Puzzle/1.17/puzzle_versions.json"; public final static String UPDATE_URL = "https://raw.githubusercontent.com/PuzzleMC/Puzzle-Versions/main/puzzle_versions.json";
@Override @Override
public void onInitializeClient() { public void onInitializeClient() {

View File

@@ -14,7 +14,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.util.List; import java.util.List;
@Mixin(DebugHud.class) @Mixin(DebugHud.class)
public class MixinDebugHud extends DrawableHelper { public abstract class MixinDebugHud extends DrawableHelper {
@Inject(at = @At("RETURN"), method = "getRightText", cancellable = true) @Inject(at = @At("RETURN"), method = "getRightText", cancellable = true)
private void puzzle$getRightText(CallbackInfoReturnable<List<String>> cir) { private void puzzle$getRightText(CallbackInfoReturnable<List<String>> cir) {
if (PuzzleConfig.showPuzzleInfo) { if (PuzzleConfig.showPuzzleInfo) {

View File

@@ -20,7 +20,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.util.Objects; import java.util.Objects;
@Mixin(TitleScreen.class) @Mixin(TitleScreen.class)
public class MixinTitleScreen extends Screen { public abstract class MixinTitleScreen extends Screen {
@Shadow @Final private boolean doBackgroundFade; @Shadow @Final private boolean doBackgroundFade;
@Shadow private long backgroundFadeStart; @Shadow private long backgroundFadeStart;

BIN
puzzle-base/src/main/resources/assets/puzzle/icon.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -1,17 +0,0 @@
{
"puzzle.text.update_available":"An update is available!",
"puzzle.screen.title":"Puzzle Settings",
"puzzle.page.graphics":"Graphics Settings",
"puzzle.page.resources":"Resource Settings",
"puzzle.page.performance":"Performance Settings",
"puzzle.page.misc":"Miscellaneous Settings",
"puzzle.option.ctm":"Connected Textures",
"puzzle.option.inside_ctm":"Connect Inside Textures",
"puzzle.midnightconfig.title":"Title",
"puzzle.midnightconfig.showPuzzleInfo":"Show Puzzle Info",
"puzzle.midnightconfig.showPuzzleInfo.tooltip":"Show Puzzle Info",
"test.midnightconfig.title":"I am a title",
"test.midnightconfig.text":"I am a comment *u*",
"test.midnightconfig.showInfo":"Show Info",
"test.midnightconfig.showInfo.tooltip":"Show more information"
}

View File

@@ -3,8 +3,8 @@
"id": "puzzle-base", "id": "puzzle-base",
"version": "${version}", "version": "${version}",
"name": "Puzzle", "name": "Puzzle Base",
"description": "Unites optifine replacement mods in a clean & vanilla-style gui", "description": "Shared code between all Puzzle modules",
"authors": [ "authors": [
"PuzzleMC", "PuzzleMC",
"Motschen" "Motschen"

View File

@@ -1,7 +1,7 @@
{ {
"required": true, "required": true,
"package": "net.puzzlemc.core.mixin", "package": "net.puzzlemc.core.mixin",
"compatibilityLevel": "JAVA_8", "compatibilityLevel": "JAVA_17",
"client": [ "client": [
"MixinTitleScreen", "MixinTitleScreen",
"MixinDebugHud" "MixinDebugHud"

BIN
puzzle-blocks/src/main/resources/assets/puzzle/icon.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -20,6 +20,13 @@ repositories {
includeGroup "curse.maven" includeGroup "curse.maven"
} }
} }
maven {
name = 'JitPack'
url 'https://jitpack.io'
}
maven {
url "https://maven.shedaniel.me/"
}
} }
dependencies { dependencies {
@@ -35,7 +42,8 @@ dependencies {
modImplementation ("maven.modrinth:lambdabettergrass:${project.lbg_version}") modImplementation ("maven.modrinth:lambdabettergrass:${project.lbg_version}")
modImplementation ("maven.modrinth:iris:${project.iris_version}") modImplementation ("maven.modrinth:iris:${project.iris_version}")
modImplementation ("maven.modrinth:cit-resewn:${project.cit_resewn_version}") modImplementation ("maven.modrinth:cit-resewn:${project.cit_resewn_version}")
modImplementation "curse.maven:custom-entity-models-cem-477078:3440846" modImplementation ("curse.maven:custom-entity-models-cem-477078:${project.cem_version}")
modImplementation "com.gitlab.Lortseam:completeconfig:${project.complete_config_version}"
modImplementation("org.aperlambda:lambdajcommon:1.8.1") { modImplementation("org.aperlambda:lambdajcommon:1.8.1") {
exclude group: 'com.google.code.gson' exclude group: 'com.google.code.gson'

View File

@@ -6,7 +6,15 @@ import dev.lambdaurora.lambdynlights.DynamicLightsConfig;
import dev.lambdaurora.lambdynlights.LambDynLights; import dev.lambdaurora.lambdynlights.LambDynLights;
import eu.midnightdust.cullleaves.config.CullLeavesConfig; import eu.midnightdust.cullleaves.config.CullLeavesConfig;
import me.pepperbell.continuity.client.config.ContinuityConfig; import me.pepperbell.continuity.client.config.ContinuityConfig;
import net.coderbot.iris.Iris;
import net.coderbot.iris.config.IrisConfig;
import net.coderbot.iris.gui.screen.ShaderPackScreen;
import net.dorianpb.cem.internal.config.CemConfig;
import net.dorianpb.cem.internal.config.CemConfigFairy;
import net.dorianpb.cem.internal.config.CemOptions;
import net.minecraft.client.gui.screen.ScreenTexts;
import net.puzzlemc.core.config.PuzzleConfig; import net.puzzlemc.core.config.PuzzleConfig;
import net.puzzlemc.gui.mixin.CemConfigAccessor;
import net.puzzlemc.gui.screen.widget.PuzzleWidget; import net.puzzlemc.gui.screen.widget.PuzzleWidget;
import net.fabricmc.api.ClientModInitializer; import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.loader.api.FabricLoader; import net.fabricmc.loader.api.FabricLoader;
@@ -18,6 +26,8 @@ import net.puzzlemc.splashscreen.PuzzleSplashScreen;
import shcm.shsupercm.fabric.citresewn.CITResewn; import shcm.shsupercm.fabric.citresewn.CITResewn;
import shcm.shsupercm.fabric.citresewn.config.CITResewnConfig; import shcm.shsupercm.fabric.citresewn.config.CITResewnConfig;
import java.io.IOException;
public class PuzzleClient implements ClientModInitializer { public class PuzzleClient implements ClientModInitializer {
public final static String id = "puzzle"; public final static String id = "puzzle";
@@ -75,17 +85,32 @@ public class PuzzleClient implements ClientModInitializer {
MinecraftClient.getInstance().worldRenderer.reload(); MinecraftClient.getInstance().worldRenderer.reload();
})); }));
} }
if (FabricLoader.getInstance().isModLoaded("iris")) {
PuzzleApi.addToGraphicsOptions(new PuzzleWidget(Text.of("Iris")));
PuzzleApi.addToGraphicsOptions(new PuzzleWidget(Text.of("Enable Shaders"), (button) -> button.setMessage(Iris.getIrisConfig().areShadersEnabled() ? YES : NO), (button) -> {
IrisConfig irisConfig = Iris.getIrisConfig();
irisConfig.setShadersEnabled(!irisConfig.areShadersEnabled());
try {
Iris.getIrisConfig().save();
} catch (IOException var6) {
Iris.logger.error("Error saving configuration file!");
Iris.logger.catching(var6);
}
if (FabricLoader.getInstance().isModLoaded("lambdynlights")) { try {
DynamicLightsConfig ldlConfig = LambDynLights.get().config; Iris.reload();
PuzzleApi.addToGraphicsOptions(new PuzzleWidget(Text.of("LambDynamicLights"))); } catch (IOException var5) {
PuzzleApi.addToGraphicsOptions(new PuzzleWidget(new TranslatableText("lambdynlights.option.mode"), (button) -> button.setMessage(ldlConfig.getDynamicLightsMode().getTranslatedText()), (button) -> ldlConfig.setDynamicLightsMode(ldlConfig.getDynamicLightsMode().next()))); Iris.logger.error("Error reloading shader pack while applying changes!");
PuzzleApi.addToGraphicsOptions(new PuzzleWidget(new TranslatableText("").append("DynLights: ").append(new TranslatableText("lambdynlights.option.light_sources.entities")), (button) -> button.setMessage(ldlConfig.getEntitiesLightSource().get() ? YES : NO), (button) -> ldlConfig.getEntitiesLightSource().set(!ldlConfig.getEntitiesLightSource().get()))); Iris.logger.catching(var5);
PuzzleApi.addToGraphicsOptions(new PuzzleWidget(new TranslatableText("").append("DynLights: ").append(new TranslatableText("lambdynlights.option.light_sources.block_entities")), (button) -> button.setMessage(ldlConfig.getBlockEntitiesLightSource().get() ? YES : NO), (button) -> ldlConfig.getBlockEntitiesLightSource().set(!ldlConfig.getBlockEntitiesLightSource().get()))); }
PuzzleApi.addToGraphicsOptions(new PuzzleWidget(new TranslatableText("").append("DynLights: ").append(new TranslatableText("entity.minecraft.creeper")), (button) -> button.setMessage(ldlConfig.getCreeperLightingMode().getTranslatedText()), (button) -> ldlConfig.setCreeperLightingMode(ldlConfig.getCreeperLightingMode().next()))); }));
PuzzleApi.addToGraphicsOptions(new PuzzleWidget(new TranslatableText("").append("DynLights: ").append(new TranslatableText("block.minecraft.tnt")), (button) -> button.setMessage(ldlConfig.getTntLightingMode().getTranslatedText()), (button) -> ldlConfig.setTntLightingMode(ldlConfig.getTntLightingMode().next()))); PuzzleApi.addToGraphicsOptions(new PuzzleWidget(new TranslatableText("options.iris.shaderPackSelection.title"), (button) -> button.setMessage(Text.of("OPEN")), (button) -> {
PuzzleApi.addToGraphicsOptions(new PuzzleWidget(new TranslatableText("").append("DynLights: ").append(new TranslatableText("lambdynlights.option.light_sources.water_sensitive_check")), (button) -> button.setMessage(ldlConfig.getWaterSensitiveCheck().get() ? YES : NO), (button) -> ldlConfig.getWaterSensitiveCheck().set(!ldlConfig.getWaterSensitiveCheck().get()))); MinecraftClient client = MinecraftClient.getInstance();
ShaderPackScreen shaderPackPage = new ShaderPackScreen(client.currentScreen);
client.setScreen(shaderPackPage);
}));
} }
if (FabricLoader.getInstance().isModLoaded("continuity")) { if (FabricLoader.getInstance().isModLoaded("continuity")) {
PuzzleApi.addToResourceOptions(new PuzzleWidget(Text.of("Continuity"))); PuzzleApi.addToResourceOptions(new PuzzleWidget(Text.of("Continuity")));
ContinuityConfig contConfig = ContinuityConfig.INSTANCE; ContinuityConfig contConfig = ContinuityConfig.INSTANCE;
@@ -100,17 +125,21 @@ public class PuzzleClient implements ClientModInitializer {
contConfig.save(); contConfig.save();
})); }));
} }
if (FabricLoader.getInstance().isModLoaded("lambdabettergrass")) {
LBGConfig lbgConfig = LambdaBetterGrass.get().config;
PuzzleApi.addToGraphicsOptions(new PuzzleWidget(Text.of("LambdaBetterGrass")));
PuzzleApi.addToGraphicsOptions(new PuzzleWidget(new TranslatableText("lambdabettergrass.option.mode"), (button) -> button.setMessage(lbgConfig.getMode().getTranslatedText()), (button) -> lbgConfig.setMode(lbgConfig.getMode().next())));
PuzzleApi.addToGraphicsOptions(new PuzzleWidget(new TranslatableText("lambdabettergrass.option.better_snow"), (button) -> button.setMessage(lbgConfig.hasBetterLayer() ? YES : NO), (button) -> lbgConfig.setBetterLayer(!lbgConfig.hasBetterLayer())));
}
} }
public static boolean citInitialized = false; public static boolean lateInitDone = false;
public static void initCITResewn() { // CITResewn is initialized after Puzzle, so we can't access it in our ClientModInitializer public static void lateInit() { // Some mods are initialized after Puzzle, so we can't access them in our ClientModInitializer
if (!citInitialized && FabricLoader.getInstance().isModLoaded("citresewn") && CITResewn.INSTANCE != null && CITResewnConfig.INSTANCE() != null) { if (FabricLoader.getInstance().isModLoaded("lambdynlights")) {
DynamicLightsConfig ldlConfig = LambDynLights.get().config;
PuzzleApi.addToGraphicsOptions(new PuzzleWidget(Text.of("LambDynamicLights")));
PuzzleApi.addToGraphicsOptions(new PuzzleWidget(new TranslatableText("lambdynlights.option.mode"), (button) -> button.setMessage(ldlConfig.getDynamicLightsMode().getTranslatedText()), (button) -> ldlConfig.setDynamicLightsMode(ldlConfig.getDynamicLightsMode().next())));
PuzzleApi.addToGraphicsOptions(new PuzzleWidget(new TranslatableText("").append("DynLights: ").append(new TranslatableText("lambdynlights.option.light_sources.entities")), (button) -> button.setMessage(ldlConfig.getEntitiesLightSource().get() ? YES : NO), (button) -> ldlConfig.getEntitiesLightSource().set(!ldlConfig.getEntitiesLightSource().get())));
PuzzleApi.addToGraphicsOptions(new PuzzleWidget(new TranslatableText("").append("DynLights: ").append(new TranslatableText("lambdynlights.option.light_sources.block_entities")), (button) -> button.setMessage(ldlConfig.getBlockEntitiesLightSource().get() ? YES : NO), (button) -> ldlConfig.getBlockEntitiesLightSource().set(!ldlConfig.getBlockEntitiesLightSource().get())));
PuzzleApi.addToGraphicsOptions(new PuzzleWidget(new TranslatableText("").append("DynLights: ").append(new TranslatableText("entity.minecraft.creeper")), (button) -> button.setMessage(ldlConfig.getCreeperLightingMode().getTranslatedText()), (button) -> ldlConfig.setCreeperLightingMode(ldlConfig.getCreeperLightingMode().next())));
PuzzleApi.addToGraphicsOptions(new PuzzleWidget(new TranslatableText("").append("DynLights: ").append(new TranslatableText("block.minecraft.tnt")), (button) -> button.setMessage(ldlConfig.getTntLightingMode().getTranslatedText()), (button) -> ldlConfig.setTntLightingMode(ldlConfig.getTntLightingMode().next())));
PuzzleApi.addToGraphicsOptions(new PuzzleWidget(new TranslatableText("").append("DynLights: ").append(new TranslatableText("lambdynlights.option.light_sources.water_sensitive_check")), (button) -> button.setMessage(ldlConfig.getWaterSensitiveCheck().get() ? YES : NO), (button) -> ldlConfig.getWaterSensitiveCheck().set(!ldlConfig.getWaterSensitiveCheck().get())));
}
if (FabricLoader.getInstance().isModLoaded("citresewn") && CITResewn.INSTANCE != null && CITResewnConfig.INSTANCE() != null) {
PuzzleApi.addToResourceOptions(new PuzzleWidget(Text.of("CIT Resewn"))); PuzzleApi.addToResourceOptions(new PuzzleWidget(Text.of("CIT Resewn")));
CITResewnConfig citConfig = CITResewnConfig.INSTANCE(); CITResewnConfig citConfig = CITResewnConfig.INSTANCE();
PuzzleApi.addToResourceOptions(new PuzzleWidget(new TranslatableText("config.citresewn.enabled.title"), (button) -> button.setMessage(citConfig.enabled ? YES : NO), (button) -> { PuzzleApi.addToResourceOptions(new PuzzleWidget(new TranslatableText("config.citresewn.enabled.title"), (button) -> button.setMessage(citConfig.enabled ? YES : NO), (button) -> {
@@ -139,8 +168,31 @@ public class PuzzleClient implements ClientModInitializer {
catch (NumberFormatException ignored) {} catch (NumberFormatException ignored) {}
citConfig.write(); citConfig.write();
})); }));
citInitialized = true;
} }
if (FabricLoader.getInstance().isModLoaded("lambdabettergrass")) {
LBGConfig lbgConfig = LambdaBetterGrass.get().config;
PuzzleApi.addToGraphicsOptions(new PuzzleWidget(Text.of("LambdaBetterGrass")));
PuzzleApi.addToGraphicsOptions(new PuzzleWidget(new TranslatableText("lambdabettergrass.option.mode"), (button) -> button.setMessage(lbgConfig.getMode().getTranslatedText()), (button) -> lbgConfig.setMode(lbgConfig.getMode().next())));
PuzzleApi.addToGraphicsOptions(new PuzzleWidget(new TranslatableText("lambdabettergrass.option.better_snow"), (button) -> button.setMessage(lbgConfig.hasBetterLayer() ? YES : NO), (button) -> lbgConfig.setBetterLayer(!lbgConfig.hasBetterLayer())));
}
if (FabricLoader.getInstance().isModLoaded("cem") && FabricLoader.getInstance().isModLoaded("completeconfig")) {
PuzzleApi.addToResourceOptions(new PuzzleWidget(Text.of("Custom Entity Models")));
CemConfig cemConfig = (CemConfig) CemConfigFairy.getConfig();
CemOptions cemOptions = CemConfigFairy.getConfig();
PuzzleApi.addToResourceOptions(new PuzzleWidget(new TranslatableText("config.cem.use_optifine_folder"), (button) -> button.setMessage(cemConfig.useOptifineFolder() ? YES : NO), (button) -> {
((CemConfigAccessor)cemOptions).setUseOptifineFolder(!cemConfig.useOptifineFolder());
cemConfig.save();
}));
PuzzleApi.addToResourceOptions(new PuzzleWidget(new TranslatableText("config.cem.use_new_model_creation_fix"), (button) -> button.setMessage(cemConfig.useTransparentParts() ? YES : NO), (button) -> {
((CemConfigAccessor)cemOptions).setUseModelCreationFix(!cemConfig.useTransparentParts());
cemConfig.save();
}));
PuzzleApi.addToResourceOptions(new PuzzleWidget(new TranslatableText("config.cem.use_old_animations"), (button) -> button.setMessage(cemConfig.useOldAnimations() ? YES : NO), (button) -> {
((CemConfigAccessor)cemOptions).setUseOldAnimations(!cemConfig.useOldAnimations());
cemConfig.save();
}));
}
lateInitDone = true;
} }
public static Text message(CITResewnConfig config) { public static Text message(CITResewnConfig config) {
int ticks = config.cache_ms; int ticks = config.cache_ms;

View File

@@ -0,0 +1,17 @@
package net.puzzlemc.gui.mixin;
import net.dorianpb.cem.internal.config.CemConfig;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
@Mixin(value = CemConfig.class, remap = false)
public interface CemConfigAccessor {
@Accessor("use_optifine_folder")
void setUseOptifineFolder(boolean value);
@Accessor("use_new_model_creation_fix")
void setUseModelCreationFix(boolean value);
@Accessor("use_old_animations")
void setUseOldAnimations(boolean value);
}

View File

@@ -16,7 +16,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import java.util.Objects; import java.util.Objects;
@Mixin(OptionsScreen.class) @Mixin(OptionsScreen.class)
public class MixinOptionsScreen extends Screen { public abstract class MixinOptionsScreen extends Screen {
private static final Identifier PUZZLE_ICON_TEXTURE = new Identifier(PuzzleClient.id, "textures/gui/puzzle_button.png"); private static final Identifier PUZZLE_ICON_TEXTURE = new Identifier(PuzzleClient.id, "textures/gui/puzzle_button.png");
protected MixinOptionsScreen(Text title) { protected MixinOptionsScreen(Text title) {

View File

@@ -1,7 +1,6 @@
package net.puzzlemc.gui.screen; package net.puzzlemc.gui.screen;
import net.fabricmc.loader.api.FabricLoader; import net.fabricmc.loader.api.FabricLoader;
import net.puzzlemc.gui.PuzzleApi;
import net.puzzlemc.gui.PuzzleClient; import net.puzzlemc.gui.PuzzleClient;
import net.puzzlemc.gui.screen.page.GraphicsPage; import net.puzzlemc.gui.screen.page.GraphicsPage;
import net.puzzlemc.gui.screen.page.MiscPage; import net.puzzlemc.gui.screen.page.MiscPage;
@@ -26,7 +25,7 @@ public class PuzzleOptionsScreen extends Screen {
@Override @Override
protected void init() { protected void init() {
super.init(); super.init();
PuzzleClient.initCITResewn(); if (!PuzzleClient.lateInitDone) PuzzleClient.lateInit();
GraphicsPage graphicsPage = new GraphicsPage(this); GraphicsPage graphicsPage = new GraphicsPage(this);
MiscPage miscPage = new MiscPage(this); MiscPage miscPage = new MiscPage(this);
PerformancePage performancePage = new PerformancePage(this); PerformancePage performancePage = new PerformancePage(this);
@@ -36,9 +35,9 @@ public class PuzzleOptionsScreen extends Screen {
this.addDrawableChild(new ButtonWidget(this.width / 2 + 5, this.height / 6 + 48 - 6, 150, 20, resourcesPage.getTitle().copy().append("..."), (button) -> Objects.requireNonNull(client).setScreen(resourcesPage))); this.addDrawableChild(new ButtonWidget(this.width / 2 + 5, this.height / 6 + 48 - 6, 150, 20, resourcesPage.getTitle().copy().append("..."), (button) -> Objects.requireNonNull(client).setScreen(resourcesPage)));
this.addDrawableChild(new ButtonWidget(this.width / 2 - 155, this.height / 6 + 72 - 6, 150, 20, performancePage.getTitle().copy().append("..."), (button) -> Objects.requireNonNull(client).setScreen(performancePage))); this.addDrawableChild(new ButtonWidget(this.width / 2 - 155, this.height / 6 + 72 - 6, 150, 20, performancePage.getTitle().copy().append("..."), (button) -> Objects.requireNonNull(client).setScreen(performancePage)));
this.addDrawableChild(new ButtonWidget(this.width / 2 + 5, this.height / 6 + 72 - 6, 150, 20, miscPage.getTitle().copy().append("..."), (button) -> Objects.requireNonNull(client).setScreen(miscPage))); this.addDrawableChild(new ButtonWidget(this.width / 2 + 5, this.height / 6 + 72 - 6, 150, 20, miscPage.getTitle().copy().append("..."), (button) -> Objects.requireNonNull(client).setScreen(miscPage)));
if (FabricLoader.getInstance().isModLoaded("iris")) { // if (FabricLoader.getInstance().isModLoaded("iris")) {
this.addDrawableChild(IrisButton.getButton(this.width / 2 - 155, this.height / 6 + 96 - 6, 150, 20, this, client)); // this.addDrawableChild(IrisButton.getButton(this.width / 2 - 155, this.height / 6 + 96 - 6, 310, 20, this, client));
} // }
this.addDrawableChild(new ButtonWidget(this.width / 2 - 100, this.height / 6 + 168, 200, 20, ScreenTexts.DONE, (button) -> Objects.requireNonNull(client).setScreen(parent))); this.addDrawableChild(new ButtonWidget(this.width / 2 - 100, this.height / 6 + 168, 200, 20, ScreenTexts.DONE, (button) -> Objects.requireNonNull(client).setScreen(parent)));
} }

BIN
puzzle-gui/src/main/resources/assets/puzzle/icon.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -1,17 +0,0 @@
{
"puzzle.text.update_available":"An update is available!",
"puzzle.screen.title":"Puzzle Settings",
"puzzle.page.graphics":"Graphics Settings",
"puzzle.page.resources":"Resource Settings",
"puzzle.page.performance":"Performance Settings",
"puzzle.page.misc":"Miscellaneous Settings",
"puzzle.option.ctm":"Connected Textures",
"puzzle.option.inside_ctm":"Connect Inside Textures",
"puzzle.midnightconfig.title":"Title",
"puzzle.midnightconfig.showPuzzleInfo":"Show Puzzle Info",
"puzzle.midnightconfig.showPuzzleInfo.tooltip":"Show Puzzle Info",
"test.midnightconfig.title":"I am a title",
"test.midnightconfig.text":"I am a comment *u*",
"test.midnightconfig.showInfo":"Show Info",
"test.midnightconfig.showInfo.tooltip":"Show more information"
}

View File

@@ -1,9 +1,10 @@
{ {
"required": true, "required": true,
"package": "net.puzzlemc.gui.mixin", "package": "net.puzzlemc.gui.mixin",
"compatibilityLevel": "JAVA_8", "compatibilityLevel": "JAVA_17",
"client": [ "client": [
"MixinOptionsScreen" "MixinOptionsScreen",
"CemConfigAccessor"
], ],
"injectors": { "injectors": {
"defaultRequire": 1 "defaultRequire": 1

BIN
puzzle-models/src/main/resources/assets/puzzle/icon.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -1,7 +1,7 @@
{ {
"required": true, "required": true,
"package": "net.puzzlemc.models.mixin", "package": "net.puzzlemc.models.mixin",
"compatibilityLevel": "JAVA_8", "compatibilityLevel": "JAVA_17",
"client": [ "client": [
"MixinModelElementDeserializer" "MixinModelElementDeserializer"
], ],

View File

@@ -2,6 +2,7 @@ package net.puzzlemc.splashscreen;
import net.fabricmc.api.ClientModInitializer; import net.fabricmc.api.ClientModInitializer;
import net.minecraft.client.texture.NativeImageBackedTexture; import net.minecraft.client.texture.NativeImageBackedTexture;
import net.minecraft.util.math.ColorHelper;
import net.puzzlemc.core.config.PuzzleConfig; import net.puzzlemc.core.config.PuzzleConfig;
import net.puzzlemc.core.util.ColorUtil; import net.puzzlemc.core.util.ColorUtil;
import net.fabricmc.api.EnvType; import net.fabricmc.api.EnvType;
@@ -10,7 +11,6 @@ import net.fabricmc.fabric.api.resource.ResourceManagerHelper;
import net.fabricmc.fabric.api.resource.SimpleSynchronousResourceReloadListener; import net.fabricmc.fabric.api.resource.SimpleSynchronousResourceReloadListener;
import net.fabricmc.loader.api.FabricLoader; import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.hud.BackgroundHelper;
import net.minecraft.client.resource.metadata.TextureResourceMetadata; import net.minecraft.client.resource.metadata.TextureResourceMetadata;
import net.minecraft.client.texture.NativeImage; import net.minecraft.client.texture.NativeImage;
import net.minecraft.client.texture.ResourceTexture; import net.minecraft.client.texture.ResourceTexture;
@@ -72,15 +72,15 @@ public class PuzzleSplashScreen implements ClientModInitializer {
if (properties.get("screen.loading") != null) { if (properties.get("screen.loading") != null) {
Color backgroundColorRGB = ColorUtil.hex2Rgb(properties.get("screen.loading").toString()); Color backgroundColorRGB = ColorUtil.hex2Rgb(properties.get("screen.loading").toString());
PuzzleConfig.backgroundColor = BackgroundHelper.ColorMixer.getArgb(backgroundColorRGB.getAlpha(), backgroundColorRGB.getRed(), backgroundColorRGB.getGreen(), backgroundColorRGB.getGreen()); PuzzleConfig.backgroundColor = ColorHelper.Argb.getArgb(backgroundColorRGB.getAlpha(), backgroundColorRGB.getRed(), backgroundColorRGB.getGreen(), backgroundColorRGB.getGreen());
} }
if (properties.get("screen.loading.bar") != null) { if (properties.get("screen.loading.bar") != null) {
Color progressFrameColorRGB = ColorUtil.hex2Rgb(properties.get("screen.loading.bar").toString()); Color progressFrameColorRGB = ColorUtil.hex2Rgb(properties.get("screen.loading.bar").toString());
PuzzleConfig.progressFrameColor = BackgroundHelper.ColorMixer.getArgb(progressFrameColorRGB.getAlpha(), progressFrameColorRGB.getRed(), progressFrameColorRGB.getGreen(), progressFrameColorRGB.getGreen()); PuzzleConfig.progressFrameColor = ColorHelper.Argb.getArgb(progressFrameColorRGB.getAlpha(), progressFrameColorRGB.getRed(), progressFrameColorRGB.getGreen(), progressFrameColorRGB.getGreen());
} }
if (properties.get("screen.loading.progress") != null) { if (properties.get("screen.loading.progress") != null) {
Color progressBarColorRGB = ColorUtil.hex2Rgb(properties.get("screen.loading.progress").toString()); Color progressBarColorRGB = ColorUtil.hex2Rgb(properties.get("screen.loading.progress").toString());
PuzzleConfig.progressBarColor = BackgroundHelper.ColorMixer.getArgb(progressBarColorRGB.getAlpha(), progressBarColorRGB.getRed(), progressBarColorRGB.getGreen(), progressBarColorRGB.getGreen()); PuzzleConfig.progressBarColor = ColorHelper.Argb.getArgb(progressBarColorRGB.getAlpha(), progressBarColorRGB.getRed(), progressBarColorRGB.getGreen(), progressBarColorRGB.getGreen());
} }
if (properties.get("screen.loading") != null) { if (properties.get("screen.loading") != null) {
PuzzleConfig.write("puzzle"); PuzzleConfig.write("puzzle");

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -1,7 +1,7 @@
{ {
"required": true, "required": true,
"package": "net.puzzlemc.splashscreen.mixin", "package": "net.puzzlemc.splashscreen.mixin",
"compatibilityLevel": "JAVA_8", "compatibilityLevel": "JAVA_17",
"client": [ "client": [
"MixinSplashScreen" "MixinSplashScreen"
], ],

View File

@@ -1,5 +0,0 @@
{
"1.17": "Puzzle R1",
"1.18-pre1": "Puzzle R1",
"1.18": "Puzzle R1"
}

BIN
src/main/resources/assets/puzzle/icon.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -9,9 +9,5 @@
"puzzle.option.inside_ctm":"Connect Inside Textures", "puzzle.option.inside_ctm":"Connect Inside Textures",
"puzzle.midnightconfig.title":"Title", "puzzle.midnightconfig.title":"Title",
"puzzle.midnightconfig.showPuzzleInfo":"Show Puzzle Info", "puzzle.midnightconfig.showPuzzleInfo":"Show Puzzle Info",
"puzzle.midnightconfig.showPuzzleInfo.tooltip":"Show Puzzle Info", "puzzle.midnightconfig.showPuzzleInfo.tooltip":"Show Puzzle Info"
"test.midnightconfig.title":"I am a title",
"test.midnightconfig.text":"I am a comment *u*",
"test.midnightconfig.showInfo":"Show Info",
"test.midnightconfig.showInfo.tooltip":"Show more information"
} }