Skip to content

Commit

Permalink
Merge branch 'master' into Korean_Description
Browse files Browse the repository at this point in the history
  • Loading branch information
JAXPLE authored Oct 12, 2023
2 parents 7a294d8 + c89f5e3 commit e930d3d
Show file tree
Hide file tree
Showing 197 changed files with 1,177 additions and 1,611 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,24 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: gradle/wrapper-validation-action@v1
- name: Set up JDK 17
- name: Checkout repository
uses: actions/checkout@v4
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Set up Java 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
distribution: 'microsoft'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Execute Gradle build
run: ./gradlew build
- name: VirusTotal scan
uses: crazy-max/ghaction-virustotal@v4
with:
vt_api_key: ${{ secrets.VIRUSTOTAL_API_KEY }}
files: |
./build/libs/*.jar
3 changes: 2 additions & 1 deletion .github/workflows/jsonsyntax.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v4
- name: Check JSON syntax
uses: limitusus/json-syntax-check@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
}

plugins {
id 'fabric-loom' version '1.3-SNAPSHOT'
id 'fabric-loom' version '1.4-SNAPSHOT'
id 'maven-publish'
}

Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ org.gradle.parallel=true
# Fabric Properties
# check these at https://fabricmc.net/develop/ and
# https://www.curseforge.com/minecraft/mc-mods/fabric-api
minecraft_version=1.20.1
yarn_mappings=1.20.1+build.10
minecraft_version=1.20.2
yarn_mappings=1.20.2+build.4
loader_version=0.14.22

#Fabric api
fabric_version=0.87.0+1.20.1
fabric_version=0.89.3+1.20.2

# Mod Properties
mod_version = v7.37-MC1.20.1
mod_version = v7.37.1-MC1.20.2
maven_group = net.wurstclient
archives_base_name = Wurst-Client

Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
25 changes: 17 additions & 8 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand All @@ -80,13 +80,11 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -133,22 +131,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -193,6 +198,10 @@ if "$cygwin" || "$msys" ; then
done
fi


# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
Expand Down
1 change: 1 addition & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand Down
9 changes: 5 additions & 4 deletions src/main/java/net/wurstclient/WurstClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import net.wurstclient.hud.IngameHUD;
import net.wurstclient.keybinds.KeybindList;
import net.wurstclient.keybinds.KeybindProcessor;
import net.wurstclient.mixinterface.ILanguageManager;
import net.wurstclient.mixinterface.IMinecraftClient;
import net.wurstclient.navigator.Navigator;
import net.wurstclient.other_feature.OtfList;
Expand All @@ -56,8 +57,8 @@ public enum WurstClient
public static MinecraftClient MC;
public static IMinecraftClient IMC;

public static final String VERSION = "7.37";
public static final String MC_VERSION = "1.20.1";
public static final String VERSION = "7.37.1";
public static final String MC_VERSION = "1.20.2";

private WurstAnalytics analytics;
private EventManager eventManager;
Expand Down Expand Up @@ -149,7 +150,7 @@ public void initialize()
altManager = new AltManager(altsFile, encFolder);

zoomKey = new KeyBinding("key.wurst.zoom", InputUtil.Type.KEYSYM,
GLFW.GLFW_KEY_V, "Zoom");
GLFW.GLFW_KEY_V, KeyBinding.MISC_CATEGORY);
KeyBindingHelper.registerKeyBinding(zoomKey);

analytics.trackPageView("/mc" + MC_VERSION + "/v" + VERSION,
Expand Down Expand Up @@ -177,7 +178,7 @@ private Path createWurstFolder()
public String translate(String key)
{
if(otfs.translationsOtf.getForceEnglish().isChecked())
return IMC.getLanguageManager().getEnglish().get(key);
return ILanguageManager.getEnglish().get(key);

// This extra check is necessary because I18n.translate() doesn't
// always return the key when the translation is missing. If the key
Expand Down
12 changes: 7 additions & 5 deletions src/main/java/net/wurstclient/altmanager/AltRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import net.minecraft.client.render.VertexFormat;
import net.minecraft.client.render.VertexFormats;
import net.minecraft.client.util.DefaultSkinHelper;
import net.minecraft.client.util.SkinTextures;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.Identifier;
import net.minecraft.util.Uuids;
Expand All @@ -41,13 +42,12 @@ private static void bindSkinTexture(String name)

if(loadedSkins.get(name) == null)
{
UUID uuid =
Uuids.getUuidFromProfile(new GameProfile((UUID)null, name));
UUID uuid = Uuids.getOfflinePlayerUuid(name);

PlayerListEntry entry =
new PlayerListEntry(new GameProfile(uuid, name), false);

loadedSkins.put(name, entry.getSkinTexture());
loadedSkins.put(name, entry.getSkinTextures().texture());
}

RenderSystem.setShaderTexture(0, loadedSkins.get(name));
Expand Down Expand Up @@ -124,7 +124,8 @@ public static void drawAltBody(DrawContext context, String name, int x,
bindSkinTexture(name);

boolean slim = DefaultSkinHelper
.getModel(Uuids.getOfflinePlayerUuid(name)).equals("slim");
.getSkinTextures(Uuids.getOfflinePlayerUuid(name))
.model() == SkinTextures.Model.SLIM;

GL11.glEnable(GL11.GL_BLEND);
RenderSystem.setShaderColor(1, 1, 1, 1);
Expand Down Expand Up @@ -255,7 +256,8 @@ public static void drawAltBack(DrawContext context, String name, int x,
bindSkinTexture(name);

boolean slim = DefaultSkinHelper
.getModel(Uuids.getOfflinePlayerUuid(name)).equals("slim");
.getSkinTextures(Uuids.getOfflinePlayerUuid(name))
.model() == SkinTextures.Model.SLIM;

GL11.glEnable(GL11.GL_BLEND);
RenderSystem.setShaderColor(1, 1, 1, 1);
Expand Down
73 changes: 5 additions & 68 deletions src/main/java/net/wurstclient/altmanager/LoginManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,84 +7,21 @@
*/
package net.wurstclient.altmanager;

import java.net.Proxy;
import java.util.Optional;

import com.mojang.authlib.Agent;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.exceptions.AuthenticationException;
import com.mojang.authlib.exceptions.AuthenticationUnavailableException;
import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
import com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication;

import net.minecraft.client.util.Session;
import net.minecraft.client.session.Session;
import net.minecraft.util.Uuids;
import net.wurstclient.WurstClient;

public enum LoginManager
{
;

public static void login(String email, String password)
throws LoginException
{
YggdrasilUserAuthentication auth =
(YggdrasilUserAuthentication)new YggdrasilAuthenticationService(
Proxy.NO_PROXY, "").createUserAuthentication(Agent.MINECRAFT);

auth.setUsername(email);
auth.setPassword(password);

try
{
auth.logIn();

GameProfile profile = auth.getSelectedProfile();
String username = profile.getName();
String uuid = profile.getId().toString();
String accessToken = auth.getAuthenticatedToken();

Session session = new Session(username, uuid, accessToken,
Optional.empty(), Optional.empty(), Session.AccountType.MOJANG);

WurstClient.IMC.setSession(session);

}catch(AuthenticationUnavailableException e)
{
throw new LoginException("Cannot contact authentication server!",
e);

}catch(AuthenticationException e)
{
e.printStackTrace();
String msg = e.getMessage().toLowerCase();

if(msg.contains("invalid username or password."))
throw new LoginException("Wrong password! (or shadowbanned)",
e);

if(msg.contains("account migrated"))
throw new LoginException("Account migrated to Mojang account.",
e);

if(msg.contains("migrated"))
throw new LoginException(
"Account migrated to Microsoft account.", e);

throw new LoginException("Cannot contact authentication server!",
e);

}catch(NullPointerException e)
{
e.printStackTrace();

throw new LoginException("Wrong password! (or shadowbanned)", e);
}
}

public static void changeCrackedName(String newName)
{
Session session = new Session(newName, "", "", Optional.empty(),
Optional.empty(), Session.AccountType.MOJANG);
Session session =
new Session(newName, Uuids.getOfflinePlayerUuid(newName), "",
Optional.empty(), Optional.empty(), Session.AccountType.MOJANG);

WurstClient.IMC.setSession(session);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;

import net.minecraft.client.util.Session;
import net.minecraft.client.session.Session;
import net.wurstclient.WurstClient;
import net.wurstclient.util.json.JsonException;
import net.wurstclient.util.json.JsonUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public MinecraftProfile(UUID uuid, String name, String mcAccessToken)
this.mcAccessToken = mcAccessToken;
}

public String getUUID()
public UUID getUUID()
{
return "" + uuid;
return uuid;
}

public String getName()
Expand Down
8 changes: 1 addition & 7 deletions src/main/java/net/wurstclient/altmanager/MojangAlt.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,7 @@ public MojangAlt(String email, String password, String name,
@Override
public void login() throws LoginException
{
try
{
MicrosoftLoginManager.login(email, password);
}catch(Exception e)
{
LoginManager.login(email, password);
}
MicrosoftLoginManager.login(email, password);
name = getNameFromSession();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.mojang.blaze3d.systems.RenderSystem;

import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.Drawable;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.gui.widget.TextFieldWidget;
Expand Down Expand Up @@ -143,9 +144,6 @@ private void createSkinFolder()
@Override
public final void tick()
{
nameOrEmailBox.tick();
passwordBox.tick();

String nameOrEmail = nameOrEmailBox.getText().trim();
boolean alex = nameOrEmail.equalsIgnoreCase("Alexander01998");

Expand Down Expand Up @@ -346,7 +344,7 @@ public boolean mouseClicked(double x, double y, int button)
public void render(DrawContext context, int mouseX, int mouseY,
float partialTicks)
{
renderBackground(context);
renderBackground(context, mouseX, mouseY, partialTicks);

MatrixStack matrixStack = context.getMatrices();
Matrix4f matrix = matrixStack.peek().getPositionMatrix();
Expand Down Expand Up @@ -399,7 +397,8 @@ public void render(DrawContext context, int mouseX, int mouseY,
errorTimer--;
}

super.render(context, mouseX, mouseY, partialTicks);
for(Drawable drawable : drawables)
drawable.render(context, mouseX, mouseY, partialTicks);
}

@Override
Expand Down
Loading

0 comments on commit e930d3d

Please sign in to comment.