Skip to content

Commit

Permalink
Puzzle 1.3.0 - Fix puzzle-splashscreen, update integrations
Browse files Browse the repository at this point in the history
  • Loading branch information
Motschen committed Jun 6, 2022
1 parent fbbfe77 commit b95045e
Show file tree
Hide file tree
Showing 15 changed files with 117 additions and 167 deletions.
13 changes: 1 addition & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,6 @@ subprojects {
version = rootProject.version
}

sourceSets {
testmod {
compileClasspath += main.compileClasspath
runtimeClasspath += main.runtimeClasspath
}
test {
compileClasspath += main.compileClasspath
runtimeClasspath += main.runtimeClasspath
}
}

subprojects.each { remapJar.dependsOn("${it.path}:remapJar") }

repositories {
Expand Down Expand Up @@ -139,7 +128,7 @@ dependencies {
modImplementation ("maven.modrinth:continuity:${project.continuity_version}")
modImplementation ("maven.modrinth:animatica:${project.animatica_version}")
modImplementation ("maven.modrinth:entitytexturefeatures:${project.entitytexturefeatures_version}")
modImplementation ("curse.maven:custom-entity-models-cem-477078:${project.cem_version}")
modImplementation ("maven.modrinth:cem:${project.cem_version}")
modImplementation "com.gitlab.Lortseam:completeconfig:${project.complete_config_version}"

modImplementation("org.aperlambda:lambdajcommon:1.8.1") {
Expand Down
19 changes: 9 additions & 10 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,29 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.18.1
yarn_mappings=1.18.1+build.14
loader_version=0.13.3
minecraft_version=1.18.2
yarn_mappings=1.18.2+build.3
loader_version=0.14.6

# Mod Properties
mod_version = 1.2.2
mod_version = 1.3.0
maven_group = net.puzzlemc
archives_base_name = puzzle

# Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_version=0.45.0+1.18
fabric_version=0.55.1+1.18.2
mod_menu_version = 2.0.13

cull_leaves_version = 2.3.2
ldl_version = 2.1.0+1.17
lbg_version = 1.2.2+1.17
iris_version = 1.18.x-v1.1.4
lbg_version = 1.2.3+1.18
iris_version = 1.18.x-v1.2.4
continuity_version = 1.0.3+1.18
animatica_version = 0.2+1.18
cit_resewn_version = 1.0.1+1.18.2
cem_version = 3561474
cem_version = 0.7.1
complete_config_version = 1.0.0
spruceui_version=3.3.2+1.17
spruceui_version=3.3.3+1.18
midnightlib_version=0.4.0
#update to 3.0 included class renames, ETF will be stable for puzzle usage from here on out
entitytexturefeatures_version=3.0.0
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

public class PuzzleCore implements ClientModInitializer {

public final static String version = "Puzzle "+ FabricLoader.getInstance().getModContainer("puzzle").get().getMetadata().getVersion();
public final static String version = "Puzzle "+ (FabricLoader.getInstance().getModContainer("puzzle").isPresent() ? FabricLoader.getInstance().getModContainer("puzzle").get().getMetadata().getVersion() : "Test");
public final static String name = "Puzzle";
public final static String id = "puzzle";
public final static String website = "https://github.com/PuzzleMC/Puzzle";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ public class PuzzleConfig extends MidnightConfig {
@Entry public static boolean checkUpdates = true;
@Entry public static boolean showPuzzleInfo = true;
@Entry public static boolean resourcepackSplashScreen = true;
@Entry public static boolean disableSplashScreenBlend = false;
@Entry public static boolean emissiveTextures = true;
@Entry public static boolean betterSplashScreenBlend = true;
@Entry public static boolean unlimitedRotations = true;
@Entry public static boolean biggerModels = true;

@Entry public static int backgroundColor = 15675965;
@Entry public static int progressBarColor = 16777215;
@Entry public static int progressBarBackgroundColor = 15675965;
@Entry public static int progressFrameColor = 16777215;
}
17 changes: 0 additions & 17 deletions puzzle-base/src/main/java/net/puzzlemc/core/util/ColorUtil.java

This file was deleted.

2 changes: 1 addition & 1 deletion puzzle-gui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ dependencies {
modImplementation ("maven.modrinth:iris:${project.iris_version}")
modImplementation ("maven.modrinth:cit-resewn:${project.cit_resewn_version}")
modImplementation ("maven.modrinth:entitytexturefeatures:${project.entitytexturefeatures_version}")
modImplementation ("curse.maven:custom-entity-models-cem-477078:${project.cem_version}")
modImplementation ("maven.modrinth:cem:${project.cem_version}")
modImplementation "com.gitlab.Lortseam:completeconfig:${project.complete_config_version}"

modImplementation("org.aperlambda:lambdajcommon:1.8.1") {
Expand Down
103 changes: 50 additions & 53 deletions puzzle-gui/src/main/java/net/puzzlemc/gui/PuzzleClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import dev.lambdaurora.lambdynlights.LambDynLights;
import eu.midnightdust.cullleaves.config.CullLeavesConfig;
import me.pepperbell.continuity.client.config.ContinuityConfig;
import me.pepperbell.continuity.client.config.Option;
import net.dorianpb.cem.internal.config.CemConfig;
import net.dorianpb.cem.internal.config.CemConfigFairy;
import net.dorianpb.cem.internal.config.CemOptions;
Expand All @@ -19,10 +20,8 @@
import net.minecraft.text.TranslatableText;
import net.minecraft.util.Formatting;
import net.puzzlemc.splashscreen.PuzzleSplashScreen;
import shcm.shsupercm.fabric.citresewn.CITResewn;
import shcm.shsupercm.fabric.citresewn.config.CITResewnConfig;
import traben.entity_texture_features.client.ETFClient;
import traben.entity_texture_features.client.utils.ETFUtils;
import traben.entity_texture_features.config.ETFConfig;
import traben.entity_texture_features.config.ETFConfigScreen;

Expand Down Expand Up @@ -55,8 +54,8 @@ public void onInitializeClient() {
PuzzleSplashScreen.resetColors();
MinecraftClient.getInstance().getTextureManager().registerTexture(PuzzleSplashScreen.LOGO, new PuzzleSplashScreen.LogoTexture());
}));
PuzzleApi.addToResourceOptions(new PuzzleWidget(new TranslatableText("puzzle.option.disable_splash_screen_blend"), (button) -> button.setMessage(PuzzleConfig.disableSplashScreenBlend ? YES : NO), (button) -> {
PuzzleConfig.disableSplashScreenBlend = !PuzzleConfig.disableSplashScreenBlend;
PuzzleApi.addToResourceOptions(new PuzzleWidget(new TranslatableText("puzzle.option.better_splash_screen_blend"), (button) -> button.setMessage(PuzzleConfig.betterSplashScreenBlend ? YES : NO), (button) -> {
PuzzleConfig.betterSplashScreenBlend = !PuzzleConfig.betterSplashScreenBlend;
PuzzleConfig.write(id);
}));
}
Expand All @@ -82,55 +81,8 @@ public void onInitializeClient() {
IrisCompat.init();
}

if (FabricLoader.getInstance().isModLoaded("continuity") && !PuzzleConfig.disabledIntegrations.contains("continuity")) {
PuzzleApi.addToResourceOptions(new PuzzleWidget(Text.of("Continuity")));
ContinuityConfig contConfig = ContinuityConfig.INSTANCE;
PuzzleApi.addToResourceOptions(new PuzzleWidget(new TranslatableText("options.continuity.disable_ctm"), (button) -> button.setMessage(contConfig.disableCTM.get() ? YES : NO), (button) -> {
contConfig.disableCTM.set(!contConfig.disableCTM.get());
contConfig.onChange();
contConfig.save();
}));
PuzzleApi.addToResourceOptions(new PuzzleWidget(new TranslatableText("options.continuity.use_manual_culling"), (button) -> button.setMessage(contConfig.useManualCulling.get() ? YES : NO), (button) -> {
contConfig.useManualCulling.set(!contConfig.useManualCulling.get());
contConfig.onChange();
contConfig.save();
}));
}
if (FabricLoader.getInstance().isModLoaded("entity_texture_features") && !PuzzleConfig.disabledIntegrations.contains("entity_texture_features")) {
PuzzleApi.addToResourceOptions(new PuzzleWidget(Text.of("Entity Texture Features")));
ETFConfig etfConfig = ETFClient.ETFConfigData;
ETFConfigScreen etfConfigScreen = new ETFConfigScreen();
PuzzleApi.addToResourceOptions(new PuzzleWidget(Text.of("Enable Optifine Random mobs"), (button) -> button.setMessage(etfConfig.enableCustomTextures ? YES : NO), (button) -> {
etfConfig.enableCustomTextures = !etfConfig.enableCustomTextures;
etfConfigScreen.saveConfig();
etfConfigScreen.resetVisuals();
}));
PuzzleApi.addToResourceOptions(new PuzzleWidget(Text.of("Enable Optifine Emissive entity textures"), (button) -> button.setMessage(etfConfig.enableEmissiveTextures ? YES : NO), (button) -> {
etfConfig.enableEmissiveTextures = !etfConfig.enableEmissiveTextures;
etfConfigScreen.saveConfig();
etfConfigScreen.resetVisuals();
}));
// shader fix no longer required as an option from V3.0 onwards as a solution has been found
// I figure this is a good use of the menu slot,
// it is the most significant feature for emissives added at the same time the shader fix was removed,
// it can impact shader compatability and each option has distinct visual differences.
// see https://github.com/Traben-0/Entity_Texture_Features/blob/master/readMeAssets/EMISSIVE_GUIDE.md
PuzzleApi.addToResourceOptions(new PuzzleWidget(Text.of("Emissive Entity Textures: Rendering Mode"), (button) -> button.setMessage(etfConfig.fullBrightEmissives ? Text.of("Brighter") : Text.of("Default")), (button) -> {
etfConfig.fullBrightEmissives = !etfConfig.fullBrightEmissives ;
etfConfigScreen.saveConfig();
etfConfigScreen.resetVisuals();
}));
PuzzleApi.addToResourceOptions(new PuzzleWidget(Text.of("Enable Blinking Mobs"), (button) -> button.setMessage(etfConfig.enableBlinking ? YES : NO), (button) -> {
etfConfig.enableBlinking = !etfConfig.enableBlinking;
etfConfigScreen.saveConfig();
etfConfigScreen.resetVisuals();
}));
PuzzleApi.addToResourceOptions(new PuzzleWidget(Text.of("Enable Player Skin Features"), (button) -> button.setMessage(etfConfig.skinFeaturesEnabled ? YES : NO), (button) -> {
etfConfig.skinFeaturesEnabled = !etfConfig.skinFeaturesEnabled;
etfConfigScreen.saveConfig();
etfConfigScreen.resetVisuals();
}));
}


}
public static boolean lateInitDone = false;
public static void lateInit() { // Some mods are initialized after Puzzle, so we can't access them in our ClientModInitializer
Expand Down Expand Up @@ -198,6 +150,51 @@ public static void lateInit() { // Some mods are initialized after Puzzle, so we
cemConfig.save();
}));
}
if (FabricLoader.getInstance().isModLoaded("continuity") && !PuzzleConfig.disabledIntegrations.contains("continuity")) {
PuzzleApi.addToResourceOptions(new PuzzleWidget(Text.of("Continuity")));
ContinuityConfig contConfig = ContinuityConfig.INSTANCE;
contConfig.getOptionMapView().forEach((s, option) -> {
if (s.equals("use_manual_culling")) return;
try {
Option.BooleanOption booleanOption = ((Option.BooleanOption)option);
PuzzleApi.addToResourceOptions(new PuzzleWidget(new TranslatableText("options.continuity."+s), (button) -> button.setMessage(booleanOption.get() ? YES : NO), (button) -> {
booleanOption.set(!booleanOption.get());
contConfig.onChange();
contConfig.save();
}));
} catch (Exception ignored) {}
});
}
if (FabricLoader.getInstance().isModLoaded("entity_texture_features") && !PuzzleConfig.disabledIntegrations.contains("entity_texture_features")) {
PuzzleApi.addToResourceOptions(new PuzzleWidget(new TranslatableText("config.etf.title")));
ETFConfig etfConfig = ETFClient.ETFConfigData;
ETFConfigScreen etfConfigScreen = new ETFConfigScreen();
PuzzleApi.addToResourceOptions(new PuzzleWidget(new TranslatableText("config.etf.enable_custom_textures.title"), (button) -> button.setMessage(etfConfig.enableCustomTextures ? YES : NO), (button) -> {
etfConfig.enableCustomTextures = !etfConfig.enableCustomTextures;
etfConfigScreen.saveConfig();
etfConfigScreen.resetVisuals();
}));
PuzzleApi.addToResourceOptions(new PuzzleWidget(new TranslatableText("config.etf.enable_emissive_textures.title"), (button) -> button.setMessage(etfConfig.enableEmissiveTextures ? YES : NO), (button) -> {
etfConfig.enableEmissiveTextures = !etfConfig.enableEmissiveTextures;
etfConfigScreen.saveConfig();
etfConfigScreen.resetVisuals();
}));
PuzzleApi.addToResourceOptions(new PuzzleWidget(Text.of("Emissive Texture Rendering Mode"), (button) -> button.setMessage(etfConfig.fullBrightEmissives ? Text.of("Brighter") : Text.of("Default")), (button) -> {
etfConfig.fullBrightEmissives = !etfConfig.fullBrightEmissives ;
etfConfigScreen.saveConfig();
etfConfigScreen.resetVisuals();
}));
PuzzleApi.addToResourceOptions(new PuzzleWidget(new TranslatableText("config.etf.blinking_mob_settings.title"), (button) -> button.setMessage(etfConfig.enableBlinking ? YES : NO), (button) -> {
etfConfig.enableBlinking = !etfConfig.enableBlinking;
etfConfigScreen.saveConfig();
etfConfigScreen.resetVisuals();
}));
PuzzleApi.addToResourceOptions(new PuzzleWidget(Text.of("Enable Player Skin Features"), (button) -> button.setMessage(etfConfig.skinFeaturesEnabled ? YES : NO), (button) -> {
etfConfig.skinFeaturesEnabled = !etfConfig.skinFeaturesEnabled;
etfConfigScreen.saveConfig();
etfConfigScreen.resetVisuals();
}));
}
lateInitDone = true;
}
public static Text message(CITResewnConfig config) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package net.puzzlemc.gui.mixin;

import eu.midnightdust.core.config.MidnightLibConfig;
import eu.midnightdust.lib.config.MidnightConfig;
import eu.midnightdust.lib.util.screen.TexturedOverlayButtonWidget;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.util.Identifier;
import net.puzzlemc.core.config.PuzzleConfig;
import net.puzzlemc.gui.PuzzleClient;
Expand All @@ -25,8 +28,12 @@ protected MixinOptionsScreen(Text title) {
}

@Inject(at = @At("HEAD"), method = "init")
private void midnightlib$init(CallbackInfo ci) {
if (PuzzleConfig.enablePuzzleButton)
this.addDrawableChild(new TexturedOverlayButtonWidget(this.width / 2 - 178, this.height / 6 - 12, 20, 20, 0, 0, 20, PUZZLE_ICON_TEXTURE, 32, 64, (buttonWidget) -> (Objects.requireNonNull(this.client)).setScreen(new PuzzleOptionsScreen(this)), new TranslatableText("midnightlib.overview.title")));
private void puzzle$init(CallbackInfo ci) {
if (PuzzleConfig.enablePuzzleButton) {
int i = 0;
if (FabricLoader.getInstance().isModLoaded("lod")) i = i + 358;
if (MidnightLibConfig.config_screen_list.equals(MidnightLibConfig.ConfigButton.FALSE)) i = i - 25;
this.addDrawableChild(new TexturedOverlayButtonWidget(this.width / 2 - 178 + i, this.height / 6 - 12, 20, 20, 0, 0, 20, PUZZLE_ICON_TEXTURE, 32, 64, (buttonWidget) -> (Objects.requireNonNull(this.client)).setScreen(new PuzzleOptionsScreen(this)), new TranslatableText("midnightlib.overview.title")));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ public void addAll(List<PuzzleWidget> buttons) {
if (button.buttonType == ButtonType.TEXT) {
this.addButton(null, button.descriptionText);
} else if (button.buttonType == ButtonType.BUTTON) {
this.addButton(new PuzzleButtonWidget(this.width / 2 - 155 + 160, 0, 150, 20, button.buttonTextAction, button.onPress), button.descriptionText);
this.addButton(new PuzzleButtonWidget(this.width / 2 + 25, 0, 150, 20, button.buttonTextAction, button.onPress), button.descriptionText);
} else if (button.buttonType == ButtonType.SLIDER) {
this.addButton(new PuzzleSliderWidget(button.min, button.max, this.width / 2 - 155 + 160, 0, 150, 20, button.setSliderValue, button.buttonTextAction, button.changeSliderValue), button.descriptionText);
this.addButton(new PuzzleSliderWidget(button.min, button.max, this.width / 2 + 25, 0, 150, 20, button.setSliderValue, button.buttonTextAction, button.changeSliderValue), button.descriptionText);
} else if (button.buttonType == ButtonType.TEXT_FIELD) {
this.addButton(new PuzzleTextFieldWidget(textRenderer, this.width / 2 - 155 + 160, 0, 150, 20, button.setTextValue, button.changeTextValue), button.descriptionText);
this.addButton(new PuzzleTextFieldWidget(textRenderer, this.width / 2 + 25, 0, 150, 20, button.setTextValue, button.changeTextValue), button.descriptionText);
} else
LogManager.getLogger("Puzzle").warn("Button " + button + " is missing the buttonType variable. This shouldn't happen!");
}
Expand Down
17 changes: 0 additions & 17 deletions puzzle-gui/src/main/java/net/puzzlemc/gui/util/ColorUtil.java

This file was deleted.

2 changes: 1 addition & 1 deletion puzzle-gui/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@
},
"breaks": {
"citresewn": "<=1.0.0+1.18.2",
"entity_texture_features": "<=3.0.0"
"entity_texture_features": "<3.0.0"
}
}
Loading

0 comments on commit b95045e

Please sign in to comment.