Skip to content

Commit

Permalink
Update 1.21.1
Browse files Browse the repository at this point in the history
  • Loading branch information
MagicQuartz committed Sep 21, 2024
1 parent 841db56 commit 3a7bbe8
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 32 deletions.
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.5-SNAPSHOT'
id 'fabric-loom' version '1.7-SNAPSHOT'
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'java'
Expand Down Expand Up @@ -40,7 +40,7 @@ processResources {
}

tasks.withType(JavaCompile).configureEach {
it.options.release = 17
it.options.release = 21
}

java {
Expand All @@ -49,8 +49,8 @@ java {
// If you remove this line, sources will not be generated.
withSourcesJar()

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

jar {
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ org.gradle.parallel=true

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.20.1
yarn_mappings=1.20.1+build.10
loader_version=0.15.6
minecraft_version=1.21.1
yarn_mappings=1.21.1+build.3
loader_version=0.16.5

# Mod Properties
mod_version=1.0-1.20.1
mod_version=1.0-1.21.1
maven_group=io.github.magicquartz.everchanging
archives_base_name=everchanging

# Dependencies
fabric_version=0.88.1+1.20.1
fabric_version=0.104.0+1.21.1
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,12 @@
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import net.fabricmc.api.ClientModInitializer;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.network.MultiplayerServerListPinger;
import net.minecraft.client.option.ServerList;
import net.minecraft.text.Text;

import javax.swing.text.StringContent;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.charset.StandardCharsets;

Expand All @@ -43,8 +34,7 @@ else if(gistStr.startsWith("raw:"))
else
gistContent = "Incorrect format!";

String ipAddress = parseServerIpFromGistContent(gistContent);
return ipAddress;
return parseServerIpFromGistContent(gistContent); //return ipAddress
} catch (IOException e) {
e.printStackTrace();
return "Error fetching gist content!";
Expand All @@ -60,7 +50,8 @@ private static String fetchGistContentApi(String gistStr, boolean rawId) throws
else
apiUrl = gistStr;

URL url = new URL(apiUrl);
URI uri = URI.create(apiUrl);
URL url = uri.toURL();
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
//connection.setRequestProperty("Authorization", "token " + GITHUB_TOKEN);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,16 @@
import io.github.magicquartz.everchanging.GistServerConnector;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.gui.screen.ConnectScreen;
import net.minecraft.client.gui.screen.multiplayer.ConnectScreen;
import net.minecraft.client.network.ServerAddress;
import net.minecraft.client.network.ServerInfo;
import org.spongepowered.asm.mixin.Debug;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArg;
import org.spongepowered.asm.mixin.injection.ModifyVariable;

@Environment(value = EnvType.CLIENT)
@Mixin(ConnectScreen.class)
public class ConnectScreenMixin {
@ModifyVariable(method = "connect", at = @At(value = "HEAD"), argsOnly = true)
@ModifyVariable(method = "connect*", at = @At(value = "HEAD"), argsOnly = true)
private static ServerAddress modifyConnectVariable(ServerAddress originalAddress) {
if(originalAddress.getAddress().startsWith("gist://"))
{
Expand Down
Binary file modified src/main/resources/assets/everchanging/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/main/resources/everchanging.mixins.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"required": true,
"package": "io.github.magicquartz.everchanging.mixin",
"compatibilityLevel": "JAVA_17",
"compatibilityLevel": "JAVA_21",
"mixins": [
"ConnectScreenMixin",
"AddMixin"
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
"everchanging.mixins.json"
],
"depends": {
"fabricloader": ">=0.15.6",
"minecraft": "~1.20.1",
"java": ">=17",
"fabricloader": ">=0.16.5",
"minecraft": "~1.21.1",
"java": ">=21",
"fabric-api": "*"
},
"suggests": {
Expand Down

0 comments on commit 3a7bbe8

Please sign in to comment.