Skip to content

Commit

Permalink
Final changes for 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Motschen committed Jan 3, 2022
1 parent c0abca5 commit 49ddb46
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 18 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 4 additions & 3 deletions puzzle-base/src/main/java/net/puzzlemc/core/PuzzleCore.java
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.<Map<String, String>>fromJson(reader, UPDATE_TYPE_TOKEN);
} catch (MalformedURLException error) {
logger.log(Level.ERROR, "Unable to check for updates because of connection problems: " + error.getMessage());
Expand All @@ -48,7 +48,7 @@ public static void init() {
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());
}
Expand Down
16 changes: 8 additions & 8 deletions puzzle-gui/src/main/java/net/puzzlemc/gui/PuzzleClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static void resetColors() {
}

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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private void modifyBackgroundColor(MatrixStack matrices, int mouseX, int mouseY,
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));
}
Expand Down
10 changes: 8 additions & 2 deletions src/main/resources/assets/puzzle/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 49ddb46

Please sign in to comment.