Skip to content

Commit

Permalink
Puzzle 1.2.0 - 1.18
Browse files Browse the repository at this point in the history
Fix #18
Fix #17
Fix #13
Russian translations by @Felix14-v2
German translations by @2020Sanoj
  • Loading branch information
Motschen committed Mar 13, 2022
1 parent 1ffe62f commit fa52471
Show file tree
Hide file tree
Showing 15 changed files with 66 additions and 176 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ dependencies {
modImplementation ("maven.modrinth:cit-resewn:${project.cit_resewn_version}")
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 "com.gitlab.Lortseam:completeconfig:${project.complete_config_version}"

Expand Down
7 changes: 4 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ org.gradle.jvmargs=-Xmx1G
# check these on https://fabricmc.net/use
minecraft_version=1.18.1
yarn_mappings=1.18.1+build.14
loader_version=0.12.12
loader_version=0.13.3

# Mod Properties
mod_version = 1.1.0
mod_version = 1.2.0
maven_group = net.puzzlemc
archives_base_name = puzzle

Expand All @@ -27,4 +27,5 @@ org.gradle.jvmargs=-Xmx1G
cem_version = 3561474
complete_config_version = 1.0.0
spruceui_version=3.3.2+1.17
midnightlib_version=0.3.1
midnightlib_version=0.4.0
entitytexturefeatures_version=2.4.5
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ public abstract class MixinTitleScreen extends Screen {
@Shadow private long backgroundFadeStart;
private Text puzzleText;
private int puzzleTextWidth;
private int yOffset = 20;
private int yOffset;

protected MixinTitleScreen(Text title) {
super(title);
}
@Inject(at = @At("TAIL"), method = "init")
private void puzzle$init(CallbackInfo ci) {
yOffset = 20;
if (FabricLoader.getInstance().isModLoaded("dashloader")) yOffset = yOffset + 10;
if (UpdateChecker.isUpToDate) {
puzzleText = Text.of(PuzzleCore.version);
Expand Down
10 changes: 0 additions & 10 deletions puzzle-emissives/build.gradle

This file was deleted.

This file was deleted.

This file was deleted.

Binary file not shown.
40 changes: 0 additions & 40 deletions puzzle-emissives/src/main/resources/fabric.mod.json

This file was deleted.

11 changes: 0 additions & 11 deletions puzzle-emissives/src/main/resources/puzzle-emissives.mixins.json

This file was deleted.

1 change: 1 addition & 0 deletions puzzle-gui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ dependencies {
modImplementation ("maven.modrinth:lambdabettergrass:${project.lbg_version}")
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 "com.gitlab.Lortseam:completeconfig:${project.complete_config_version}"

Expand Down
40 changes: 34 additions & 6 deletions puzzle-gui/src/main/java/net/puzzlemc/gui/PuzzleClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
import net.puzzlemc.splashscreen.PuzzleSplashScreen;
import shcm.shsupercm.fabric.citresewn.CITResewn;
import shcm.shsupercm.fabric.citresewn.config.CITResewnConfig;
import traben.entity_texture_features.client.ETF_CLIENT;
import traben.entity_texture_features.client.ETF_METHODS;
import traben.entity_texture_features.config.ETFConfig;
import traben.entity_texture_features.config.ETFConfigScreen;

public class PuzzleClient implements ClientModInitializer {

Expand Down Expand Up @@ -56,12 +60,6 @@ public void onInitializeClient() {
PuzzleConfig.write(id);
}));
}
if (FabricLoader.getInstance().isModLoaded("puzzle-emissives") && !PuzzleConfig.disabledIntegrations.contains("puzzle-emissives")) {
PuzzleApi.addToResourceOptions(new PuzzleWidget(new TranslatableText("puzzle.option.emissive_textures"), (button) -> button.setMessage(PuzzleConfig.emissiveTextures ? YES : NO), (button) -> {
PuzzleConfig.emissiveTextures = !PuzzleConfig.emissiveTextures;
PuzzleConfig.write(id);
}));
}
if (FabricLoader.getInstance().isModLoaded("puzzle-models") && !PuzzleConfig.disabledIntegrations.contains("puzzle-models")) {
PuzzleApi.addToResourceOptions(new PuzzleWidget(new TranslatableText("puzzle.option.unlimited_model_rotations"), (button) -> button.setMessage(PuzzleConfig.unlimitedRotations ? YES : NO), (button) -> {
PuzzleConfig.unlimitedRotations = !PuzzleConfig.unlimitedRotations;
Expand Down Expand Up @@ -98,6 +96,36 @@ public void onInitializeClient() {
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 = ETF_CLIENT.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();
}));
PuzzleApi.addToResourceOptions(new PuzzleWidget(Text.of("Emissive texture Z-Fighting / Shader patch"), (button) -> button.setMessage(etfConfig.doShadersEmissiveFix ? YES : NO), (button) -> {
etfConfig.doShadersEmissiveFix = !etfConfig.doShadersEmissiveFix;
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
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@ public ConfigScreenFactory<?> getModConfigScreenFactory() {
@Override
public Map<String, ConfigScreenFactory<?>> getProvidedConfigScreenFactories() {
Map<String, ConfigScreenFactory<?>> map = new HashMap<>();
map.put("puzzle",PuzzleOptionsScreen::new);
map.put("puzzle-gui",PuzzleOptionsScreen::new);
map.put("puzzle-blocks",PuzzleOptionsScreen::new);
map.put("puzzle-base",PuzzleOptionsScreen::new);
map.put("puzzle-models",PuzzleOptionsScreen::new);
map.put("puzzle-emissives",PuzzleOptionsScreen::new);
map.put("puzzle-splashscreen",PuzzleOptionsScreen::new);
map.put("puzzle",PuzzleOptionsScreen::new);
return map;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import net.fabricmc.api.ClientModInitializer;
import net.minecraft.client.texture.NativeImageBackedTexture;
import net.minecraft.util.Util;
import net.minecraft.util.math.ColorHelper;
import net.puzzlemc.core.config.PuzzleConfig;
import net.puzzlemc.core.util.ColorUtil;
Expand Down Expand Up @@ -47,9 +48,11 @@ public static void resetColors() {
public void onInitializeClient() {
if (!CONFIG_PATH.exists()) { // Run when config directory is nonexistent //
if (CONFIG_PATH.mkdir()) { // Create our custom config directory //
try {
Files.setAttribute(CONFIG_PATH.toPath(), "dos:hidden", true);
} catch (IOException ignored) {
if (Util.getOperatingSystem().equals(Util.OperatingSystem.WINDOWS)) {
try {
Files.setAttribute(CONFIG_PATH.toPath(), "dos:hidden", true);
} catch (IOException ignored) {
}
}
}
}
Expand Down
1 change: 0 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ include 'puzzle-base'
include 'puzzle-splashscreen'
include 'puzzle-models'
include 'puzzle-gui'
include 'puzzle-emissives'
17 changes: 17 additions & 0 deletions src/main/resources/assets/puzzle/lang/de_de.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"puzzle.text.update_available":"Ein Update ist verfügbar!",
"puzzle.screen.title":"Puzzle Einstellungen",
"puzzle.page.graphics":"Grafik Einstellungen",
"puzzle.page.resources":"Resourcen Einstellungen",
"puzzle.page.performance":"Performance Einstellungen",
"puzzle.page.misc":"Sonstige Einstellungen",
"puzzle.option.check_for_updates":"Auf Updates überprüfen",
"puzzle.option.show_version_info":"Zeige Puzzles Versions Informationen",
"puzzle.option.resourcepack_splash_screen":"Nutzte den Resourcepack-splash-Screen",
"puzzle.option.disable_splash_screen_blend":"Deaktiviere das Überblenden des Splash-Screen-Logos",
"puzzle.option.emissive_textures":"Emissive Texturen",
"puzzle.option.unlimited_model_rotations":"Unbegrenzte Modellrotationen",
"puzzle.option.bigger_custom_models":"Größere benutzerdefinierte Modelle",
"puzzle.option.render_layer_overrides":"Render Layer Overrides",
"puzzle.midnightconfig.title":"Erweiterte Puzzle Einstellungen"
}

0 comments on commit fa52471

Please sign in to comment.