diff --git a/gradle.properties b/gradle.properties index d0c3460..407ecbb 100755 --- a/gradle.properties +++ b/gradle.properties @@ -8,7 +8,7 @@ org.gradle.jvmargs=-Xmx1G loader_version=0.12.12 # Mod Properties - mod_version = 1.0.0-pre4 + mod_version = 1.0.0 maven_group = net.puzzlemc archives_base_name = puzzle diff --git a/puzzle-base/src/main/java/net/puzzlemc/core/PuzzleCore.java b/puzzle-base/src/main/java/net/puzzlemc/core/PuzzleCore.java index 61d9848..2c560ce 100755 --- a/puzzle-base/src/main/java/net/puzzlemc/core/PuzzleCore.java +++ b/puzzle-base/src/main/java/net/puzzlemc/core/PuzzleCore.java @@ -1,18 +1,19 @@ package net.puzzlemc.core; +import net.fabricmc.loader.api.FabricLoader; import net.puzzlemc.core.config.PuzzleConfig; import net.puzzlemc.core.util.UpdateChecker; import net.fabricmc.api.ClientModInitializer; public class PuzzleCore implements ClientModInitializer { - public final static String version = "Puzzle B0"; + public final static String version = "Puzzle "+ FabricLoader.getInstance().getModContainer("puzzle").get().getMetadata().getVersion(); public final static String name = "Puzzle"; public final static String id = "puzzle"; public final static String website = "https://github.com/PuzzleMC/Puzzle"; - public static String updateURL = website; //+"download"; + public static String updateURL = "https://modrinth.com/mod/puzzle"; - public final static String UPDATE_URL = "https://raw.githubusercontent.com/PuzzleMC/Puzzle-Versions/main/puzzle_versions.json"; + public final static String UPDATE_CHECKER_URL = "https://raw.githubusercontent.com/PuzzleMC/Puzzle-Versions/main/puzzle_versions.json"; @Override public void onInitializeClient() { diff --git a/puzzle-base/src/main/java/net/puzzlemc/core/util/UpdateChecker.java b/puzzle-base/src/main/java/net/puzzlemc/core/util/UpdateChecker.java index 433a541..f8bfa8c 100755 --- a/puzzle-base/src/main/java/net/puzzlemc/core/util/UpdateChecker.java +++ b/puzzle-base/src/main/java/net/puzzlemc/core/util/UpdateChecker.java @@ -29,7 +29,7 @@ public class UpdateChecker { public static void init() { CompletableFuture.supplyAsync(() -> { - try (Reader reader = new InputStreamReader(new URL(PuzzleCore.UPDATE_URL).openStream())) { + try (Reader reader = new InputStreamReader(new URL(PuzzleCore.UPDATE_CHECKER_URL).openStream())) { return GSON.>fromJson(reader, UPDATE_TYPE_TOKEN); } catch (MalformedURLException error) { logger.log(Level.ERROR, "Unable to check for updates because of connection problems: " + error.getMessage()); @@ -48,7 +48,7 @@ public class UpdateChecker { logger.log(Level.INFO, "Please update immediately!"); } } else { - logger.log(Level.WARN, "A problem with the database occured, could not check for updates."); + logger.log(Level.WARN, "A problem with the database occurred, could not check for updates."); } }, MinecraftClient.getInstance()); } diff --git a/puzzle-gui/src/main/java/net/puzzlemc/gui/PuzzleClient.java b/puzzle-gui/src/main/java/net/puzzlemc/gui/PuzzleClient.java index 3ba8497..2a7c302 100755 --- a/puzzle-gui/src/main/java/net/puzzlemc/gui/PuzzleClient.java +++ b/puzzle-gui/src/main/java/net/puzzlemc/gui/PuzzleClient.java @@ -31,45 +31,45 @@ public class PuzzleClient implements ClientModInitializer { @Override public void onInitializeClient() { PuzzleApi.addToMiscOptions(new PuzzleWidget(Text.of("Puzzle"))); - PuzzleApi.addToMiscOptions(new PuzzleWidget(Text.of("Check for Updates"), (button) -> button.setMessage(PuzzleConfig.checkUpdates ? YES : NO), (button) -> { + PuzzleApi.addToMiscOptions(new PuzzleWidget(new TranslatableText("puzzle.option.check_for_updates"), (button) -> button.setMessage(PuzzleConfig.checkUpdates ? YES : NO), (button) -> { PuzzleConfig.checkUpdates = !PuzzleConfig.checkUpdates; PuzzleConfig.write(id); })); - PuzzleApi.addToMiscOptions(new PuzzleWidget(Text.of("Show Puzzle version info"), (button) -> button.setMessage(PuzzleConfig.showPuzzleInfo ? YES : NO), (button) -> { + PuzzleApi.addToMiscOptions(new PuzzleWidget(new TranslatableText("puzzle.option.show_version_info"), (button) -> button.setMessage(PuzzleConfig.showPuzzleInfo ? YES : NO), (button) -> { PuzzleConfig.showPuzzleInfo = !PuzzleConfig.showPuzzleInfo; PuzzleConfig.write(id); })); PuzzleApi.addToResourceOptions(new PuzzleWidget(Text.of("Puzzle"))); if (FabricLoader.getInstance().isModLoaded("puzzle-splashscreen")) { - PuzzleApi.addToResourceOptions(new PuzzleWidget(Text.of("Use resourcepack splash screen "), (button) -> button.setMessage(PuzzleConfig.resourcepackSplashScreen ? YES : NO), (button) -> { + PuzzleApi.addToResourceOptions(new PuzzleWidget(new TranslatableText("puzzle.option.resourcepack_splash_screen"), (button) -> button.setMessage(PuzzleConfig.resourcepackSplashScreen ? YES : NO), (button) -> { PuzzleConfig.resourcepackSplashScreen = !PuzzleConfig.resourcepackSplashScreen; PuzzleConfig.write(id); PuzzleSplashScreen.resetColors(); MinecraftClient.getInstance().getTextureManager().registerTexture(PuzzleSplashScreen.LOGO, new PuzzleSplashScreen.LogoTexture()); })); - PuzzleApi.addToResourceOptions(new PuzzleWidget(Text.of("Disable splash screen logo blending "), (button) -> button.setMessage(PuzzleConfig.disableSplashScreenBlend ? YES : NO), (button) -> { + PuzzleApi.addToResourceOptions(new PuzzleWidget(new TranslatableText("puzzle.option.disable_splash_screen_blend"), (button) -> button.setMessage(PuzzleConfig.disableSplashScreenBlend ? YES : NO), (button) -> { PuzzleConfig.disableSplashScreenBlend = !PuzzleConfig.disableSplashScreenBlend; PuzzleConfig.write(id); })); } if (FabricLoader.getInstance().isModLoaded("puzzle-emissives")) { - PuzzleApi.addToResourceOptions(new PuzzleWidget(Text.of("Emissive Textures"), (button) -> button.setMessage(PuzzleConfig.emissiveTextures ? YES : NO), (button) -> { + 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")) { - PuzzleApi.addToResourceOptions(new PuzzleWidget(Text.of("Unlimited Model Rotations"), (button) -> button.setMessage(PuzzleConfig.unlimitedRotations ? YES : NO), (button) -> { + PuzzleApi.addToResourceOptions(new PuzzleWidget(new TranslatableText("puzzle.option.unlimited_model_rotations"), (button) -> button.setMessage(PuzzleConfig.unlimitedRotations ? YES : NO), (button) -> { PuzzleConfig.unlimitedRotations = !PuzzleConfig.unlimitedRotations; PuzzleConfig.write(id); })); - PuzzleApi.addToResourceOptions(new PuzzleWidget(Text.of("Bigger Custom Models"), (button) -> button.setMessage(PuzzleConfig.biggerModels ? YES : NO), (button) -> { + PuzzleApi.addToResourceOptions(new PuzzleWidget(new TranslatableText("puzzle.option.bigger_custom_models"), (button) -> button.setMessage(PuzzleConfig.biggerModels ? YES : NO), (button) -> { PuzzleConfig.biggerModels = !PuzzleConfig.biggerModels; PuzzleConfig.write(id); })); } if (FabricLoader.getInstance().isModLoaded("puzzle-blocks")) { - PuzzleApi.addToResourceOptions(new PuzzleWidget(Text.of("Render Layer Overwrites"), (button) -> button.setMessage(PuzzleConfig.customRenderLayers ? YES : NO), (button) -> { + PuzzleApi.addToResourceOptions(new PuzzleWidget(new TranslatableText("puzzle.option.render_layer_overrides"), (button) -> button.setMessage(PuzzleConfig.customRenderLayers ? YES : NO), (button) -> { PuzzleConfig.customRenderLayers = !PuzzleConfig.customRenderLayers; PuzzleConfig.write(id); })); diff --git a/puzzle-splashscreen/src/main/java/net/puzzlemc/splashscreen/PuzzleSplashScreen.java b/puzzle-splashscreen/src/main/java/net/puzzlemc/splashscreen/PuzzleSplashScreen.java index 5ed1dbf..aa5bf9c 100755 --- a/puzzle-splashscreen/src/main/java/net/puzzlemc/splashscreen/PuzzleSplashScreen.java +++ b/puzzle-splashscreen/src/main/java/net/puzzlemc/splashscreen/PuzzleSplashScreen.java @@ -45,7 +45,7 @@ public class PuzzleSplashScreen implements ClientModInitializer { } public void onInitializeClient() { - if (!CONFIG_PATH.exists()) { // Run when config directory is nonexistant // + 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); diff --git a/puzzle-splashscreen/src/main/java/net/puzzlemc/splashscreen/mixin/MixinSplashScreen.java b/puzzle-splashscreen/src/main/java/net/puzzlemc/splashscreen/mixin/MixinSplashScreen.java index ea87133..8b3054e 100755 --- a/puzzle-splashscreen/src/main/java/net/puzzlemc/splashscreen/mixin/MixinSplashScreen.java +++ b/puzzle-splashscreen/src/main/java/net/puzzlemc/splashscreen/mixin/MixinSplashScreen.java @@ -55,7 +55,7 @@ public abstract class MixinSplashScreen extends Overlay { private void modifyBackgroundColor2(MatrixStack matrices, int mouseX, int mouseY, float delta, CallbackInfo ci) { // Set the Background Color to our configured value // long l = Util.getMeasuringTimeMs(); float g = this.reloadStartTime > -1L ? (float)(l - this.reloadStartTime) / 500.0F : -1.0F; - int m = MathHelper.ceil(MathHelper.clamp((double)g, 0.15D, 1.0D) * 255.0D); + int m = MathHelper.ceil(MathHelper.clamp(g, 0.15D, 1.0D) * 255.0D); if (PuzzleConfig.resourcepackSplashScreen && PuzzleConfig.backgroundColor != 15675965) fill(matrices, 0, 0, client.getWindow().getScaledWidth(), client.getWindow().getScaledHeight(), withAlpha(PuzzleConfig.backgroundColor, m)); } diff --git a/src/main/resources/assets/puzzle/lang/en_us.json b/src/main/resources/assets/puzzle/lang/en_us.json index f0fab77..5d970af 100755 --- a/src/main/resources/assets/puzzle/lang/en_us.json +++ b/src/main/resources/assets/puzzle/lang/en_us.json @@ -5,8 +5,14 @@ "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.option.check_for_updates":"Check for Updates", + "puzzle.option.show_version_info":"Show Puzzle version info", + "puzzle.option.resourcepack_splash_screen":"Use resourcepack splash screen", + "puzzle.option.disable_splash_screen_blend":"Disable splash screen logo blending", + "puzzle.option.emissive_textures":"Emissive Textures", + "puzzle.option.unlimited_model_rotations":"Unlimited Model Rotations", + "puzzle.option.bigger_custom_models":"Bigger Custom Models", + "puzzle.option.render_layer_overrides":"Render Layer Overrides", "puzzle.midnightconfig.title":"Title", "puzzle.midnightconfig.showPuzzleInfo":"Show Puzzle Info", "puzzle.midnightconfig.showPuzzleInfo.tooltip":"Show Puzzle Info"