Skip to content

Commit

Permalink
Merge pull request #180 from RedstoneTools/dev
Browse files Browse the repository at this point in the history
Update to 1.0.2
  • Loading branch information
Matthias1590 authored May 13, 2023
2 parents 9384729 + c7a0be4 commit 1bec5a5
Show file tree
Hide file tree
Showing 4 changed files with 9 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=-Xmx4G
loader_version=0.14.6

# Mod Properties
mod_version = 1.18.2-1.0.1
mod_version = 1.18.2-1.0.2
maven_group = tools.redstone
archives_base_name = redstonetools

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
import com.google.inject.Guice;
import com.google.inject.Injector;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.loader.api.FabricLoader;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import tools.redstone.redstonetools.macros.MacroManager;
import tools.redstone.redstonetools.macros.WorldlessCommandHelper;
import tools.redstone.redstonetools.utils.ReflectionUtils;

public class RedstoneToolsClient implements ClientModInitializer {
public static final String MOD_ID = "redstonetools";
public static final String MOD_VERSION = "v1.18.2-1.0.1";
public static final String MOD_VERSION = "v" + FabricLoader.getInstance().getModContainer(MOD_ID).orElseThrow().getMetadata().getVersion().getFriendlyString();
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
public static final Injector INJECTOR = Guice.createInjector(ReflectionUtils.getModules());

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package tools.redstone.redstonetools.gui;

import java.net.URI;
import java.awt.Desktop;

import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.text.Text;
import net.minecraft.util.Util;

import java.net.URI;

import static tools.redstone.redstonetools.RedstoneToolsClient.MOD_VERSION;

Expand All @@ -22,21 +22,12 @@ public UpdatePopupScreen(Screen parent, URI uri, String newVersion) {
@Override
protected void addButtons(int y) {
this.addDrawableChild(new ButtonWidget(this.width / 2 + 5, y, 150, 20, Text.of("Go to release"), (button) -> {
try {
Desktop desktop = Desktop.getDesktop();

if (desktop.isSupported(Desktop.Action.BROWSE))
desktop.browse(uri);


} catch (Exception e) {
e.printStackTrace();
}
Util.getOperatingSystem().open(uri);

this.close();
}));
this.addDrawableChild(new ButtonWidget(this.width / 2 - 155, y, 150, 20, Text.of("Ignore"), (button) -> {
this.close();
}));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void init(CallbackInfo ci) {

Gson gson = new Gson();
JsonObject release = gson.fromJson(responseBody, JsonObject.class);
URI uri = new URI(release.get("url").getAsString());
URI uri = new URI(release.get("html_url").getAsString());
String newVersion = release.get("tag_name").getAsString();

if (RedstoneToolsClient.MOD_VERSION.equals(newVersion) || newVersion.contains("alpha") || newVersion.contains("beta"))
Expand Down

0 comments on commit 1bec5a5

Please sign in to comment.