0
0
mirror of https://github.com/Wurst-Imperium/Wurst7.git synced 2024-09-19 17:02:13 +02:00

Update to 24w14a and Java 21

This commit is contained in:
Alexander01998 2024-04-03 18:22:15 +02:00
parent 2b87ad5202
commit 3520461038
9 changed files with 24 additions and 17 deletions

View File

@ -23,10 +23,10 @@ jobs:
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v2
- name: Set up Java 17
- name: Set up Java 21
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: '21'
distribution: 'microsoft'
- name: Grant execute permission for gradlew

View File

@ -6,7 +6,7 @@
## Setup (for developers)
(This assumes that you are using Windows with [Eclipse](https://www.eclipse.org/downloads/) and [Java Development Kit 17](https://adoptium.net/?variant=openjdk17&jvmVariant=hotspot) already installed.)
(This assumes that you are using Windows with [Eclipse](https://www.eclipse.org/downloads/) and [Java Development Kit 21](https://adoptium.net/?variant=openjdk21&jvmVariant=hotspot) already installed.)
1. Run this command in PowerShell:

View File

@ -12,8 +12,8 @@ plugins {
def ENV = System.getenv()
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
archivesBaseName = project.archives_base_name
version = project.mod_version
@ -58,8 +58,8 @@ processResources {
}
tasks.withType(JavaCompile).configureEach {
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
it.options.release = 17
// Minecraft 1.20.5 (24w14a) upwards uses Java 21.
it.options.release = 21
}
java {

View File

@ -14,6 +14,7 @@ import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLDecoder;
@ -197,7 +198,7 @@ public enum MicrosoftLoginManager
try
{
URL url = new URL(urlPost);
URL url = URI.create(urlPost).toURL();
HttpURLConnection connection =
(HttpURLConnection)url.openConnection();
@ -504,7 +505,7 @@ public enum MicrosoftLoginManager
{
try
{
return new URL(url);
return URI.create(url).toURL();
}catch(MalformedURLException e)
{

View File

@ -30,6 +30,7 @@ import java.net.InetSocketAddress;
import java.net.Proxy;
import java.net.Proxy.Type;
import java.net.SocketAddress;
import java.net.URI;
import java.net.URL;
import java.util.LinkedList;
import java.util.Scanner;
@ -532,7 +533,7 @@ public class JGoogleAnalyticsTracker
{
try
{
URL url = new URL(argURL);
URL url = URI.create(argURL).toURL();
HttpURLConnection connection =
(HttpURLConnection)url.openConnection(proxy);
connection.setRequestMethod("GET");

View File

@ -10,6 +10,7 @@ package net.wurstclient.hacks.autocomplete;
import java.io.IOException;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL;
import com.google.gson.JsonArray;
@ -50,7 +51,8 @@ public final class OobaboogaMessageCompleter extends MessageCompleter
throws IOException, JsonException
{
// set up the API request
URL url = new URL(modelSettings.oobaboogaEndpoint.getValue());
URL url =
URI.create(modelSettings.oobaboogaEndpoint.getValue()).toURL();
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/json");

View File

@ -10,6 +10,7 @@ package net.wurstclient.hacks.autocomplete;
import java.io.IOException;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL;
import com.google.gson.JsonArray;
@ -64,9 +65,10 @@ public final class OpenAiMessageCompleter extends MessageCompleter
throws IOException, JsonException
{
// get the API URL
URL url = modelSettings.openAiModel.getSelected().isChatModel()
? new URL(modelSettings.openaiChatEndpoint.getValue())
: new URL(modelSettings.openaiLegacyEndpoint.getValue());
URL url =
URI.create(modelSettings.openAiModel.getSelected().isChatModel()
? modelSettings.openaiChatEndpoint.getValue()
: modelSettings.openaiLegacyEndpoint.getValue()).toURL();
// set up the API request
HttpURLConnection conn = (HttpURLConnection)url.openConnection();

View File

@ -12,6 +12,7 @@ import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
@ -69,7 +70,7 @@ public enum GoogleTranslate
"https://translate.google.com/m?hl=en&sl=%s&tl=%s&ie=UTF-8&prev=_m&q=%s",
langFrom, langTo, encodedText);
return new URL(urlString);
return URI.create(urlString).toURL();
}catch(MalformedURLException | UnsupportedEncodingException e)
{

View File

@ -30,9 +30,9 @@
"depends": {
"fabricloader": ">=0.15.9",
"fabric-api": ">=0.96.13",
"fabric-api": ">=0.96.14",
"minecraft": "~1.20.5-alpha.24.13.a",
"java": ">=17"
"java": ">=21"
},
"suggests": {
"mo_glass": "*"