Skip to content

Commit

Permalink
chore: More refactoring, identified some more opcodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Pazaz committed Dec 1, 2023
1 parent c815ac7 commit 886564f
Show file tree
Hide file tree
Showing 122 changed files with 1,634 additions and 1,646 deletions.
91 changes: 82 additions & 9 deletions client/src/main/java/Camera.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
public class Camera {

@OriginalMember(owner = "client!vg", name = "v", descriptor = "[[[I")
public static final int[][][] anIntArrayArrayArray13 = new int[2][][];
public static final int[][][] splines = new int[2][][];
@OriginalMember(owner = "client!jl", name = "ab", descriptor = "I")
public static int originX;

Expand All @@ -28,9 +28,9 @@ public class Camera {
@OriginalMember(owner = "client!sd", name = "R", descriptor = "I")
public static int anInt5911;
@OriginalMember(owner = "client!bp", name = "t", descriptor = "F")
public static float pitchTarget = 1024.0F;
public static float pitch = 1024.0F;
@OriginalMember(owner = "client!q", name = "q", descriptor = "F")
public static float yawTarget = 0.0F;
public static float yaw = 0.0F;
@OriginalMember(owner = "client!fn", name = "D", descriptor = "Z")
public static boolean aBoolean156 = true;
@OriginalMember(owner = "client!wf", name = "s", descriptor = "I")
Expand All @@ -51,7 +51,7 @@ public class Camera {
public static int anInt4897 = 2;

@OriginalMember(owner = "client!cu", name = "a", descriptor = "(IIIIZII)V")
public static void method1545(@OriginalArg(1) int arg0, @OriginalArg(2) int arg1, @OriginalArg(3) int arg2, @OriginalArg(4) boolean arg3, @OriginalArg(5) int arg4, @OriginalArg(6) int arg5) {
public static void moveto(@OriginalArg(1) int arg0, @OriginalArg(2) int arg1, @OriginalArg(3) int arg2, @OriginalArg(4) boolean arg3, @OriginalArg(5) int arg4, @OriginalArg(6) int arg5) {
Static19.anInt535 = arg0;
Static348.anInt6446 = arg1;
Static180.anInt3404 = arg4;
Expand All @@ -66,7 +66,7 @@ public static void method1545(@OriginalArg(1) int arg0, @OriginalArg(2) int arg1
}

@OriginalMember(owner = "client!bs", name = "b", descriptor = "(IIIIII)V")
public static void method4203(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(4) int arg3, @OriginalArg(5) int arg4) {
public static void lookAt(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(4) int arg3, @OriginalArg(5) int arg4) {
Static123.anInt2420 = arg2;
Static236.anInt4309 = arg0;
Static254.anInt4698 = arg4;
Expand Down Expand Up @@ -94,7 +94,7 @@ public static void method4203(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1
}

@OriginalMember(owner = "client!gp", name = "b", descriptor = "(B)V")
public static void resetCameraEffects() {
public static void reset() {
for (@Pc(3) int local3 = 0; local3 < 5; local3++) {
Static189.aBooleanArray33[local3] = false;
}
Expand All @@ -106,11 +106,11 @@ public static void resetCameraEffects() {
}

@OriginalMember(owner = "client!nf", name = "a", descriptor = "(IIBI)V")
public static void clampCameraAngle(@OriginalArg(1) int arg0, @OriginalArg(3) int arg1) {
public static void forceAngle(@OriginalArg(1) int arg0, @OriginalArg(3) int arg1) {
@Pc(3) int local3 = arg0 << 3;
@Pc(11) int local11 = arg1 << 3;
pitchTarget = local3;
yawTarget = local11;
pitch = local3;
yaw = local11;
if (anInt5911 == 2) {
Static342.anInt5657 = 0;
Static265.anInt4857 = local3;
Expand All @@ -120,4 +120,77 @@ public static void clampCameraAngle(@OriginalArg(1) int arg0, @OriginalArg(3) in
aBoolean156 = true;
}

@OriginalMember(owner = "client!ug", name = "b", descriptor = "(I)V")
public static void smoothReset() {
for (@Pc(7) int local7 = 0; local7 < 5; local7++) {
Static189.aBooleanArray33[local7] = false;
}
Static241.anInt4445 = client.cycle;
Static5.anInt105 = Static102.anInt3592;
anInt6455 = -1;
anInt2717 = -1;
anInt5911 = 5;
Static272.anInt5023 = Static4.anInt87;
Static231.anInt4071 = Static265.anInt4857;
Static196.anInt3318 = Static211.anInt3777;
Static236.anInt4309 = 0;
Static33.anInt4463 = 0;
Static106.anInt2218 = Static136.anInt6778;
}

@OriginalMember(owner = "client!bj", name = "a", descriptor = "(I)V")
public static void decX() {
if (Static369.aBoolean471) {
return;
}
aBoolean156 = true;
Static369.aBoolean471 = true;
if (client.preferences.aBoolean351) {
yaw = (int) yaw - 65 & 0xFFFFFF80;
} else {
Static184.aFloat39 += (-Static184.aFloat39 - 24.0F) / 2.0F;
}
}

@OriginalMember(owner = "client!uh", name = "e", descriptor = "(B)V")
public static void incX() {
if (Static369.aBoolean471) {
return;
}
aBoolean156 = true;
if (client.preferences.aBoolean351) {
yaw = (int) yaw + 191 & 0xFFFFFF80;
} else {
Static184.aFloat39 += (24.0F - Static184.aFloat39) / 2.0F;
}
Static369.aBoolean471 = true;
}

@OriginalMember(owner = "client!gu", name = "b", descriptor = "(I)V")
public static void decY() {
if (Static140.aBoolean187) {
return;
}
if (client.preferences.aBoolean351) {
pitch = (int) pitch - 17 & 0xFFFFFFF0;
} else {
Static296.aFloat68 += (-Static296.aFloat68 - 12.0F) / 2.0F;
}
Static140.aBoolean187 = true;
aBoolean156 = true;
}

@OriginalMember(owner = "client!ue", name = "a", descriptor = "(I)V")
public static void incY() {
if (Static140.aBoolean187) {
return;
}
Static140.aBoolean187 = true;
aBoolean156 = true;
if (client.preferences.aBoolean351) {
pitch = (int) pitch + 47 & 0xFFFFFFF0;
} else {
Static296.aFloat68 += (12.0F - Static296.aFloat68) / 2.0F;
}
}
}
41 changes: 22 additions & 19 deletions client/src/main/java/Cheat.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

public class Cheat {

@OriginalMember(owner = "client!up", name = "P", descriptor = "Z")
public static boolean displayfps = false;

@OriginalMember(owner = "client!jg", name = "a", descriptor = "(Ljava/lang/String;ZZ)V")
public static void execute(@OriginalArg(0) String cmd, @OriginalArg(1) boolean arg1) {
if (ModeWhere.MODE_WHERE_LIVE == client.modeWhere && LoginManager.staffModLevel < 2) {
Expand All @@ -14,12 +17,12 @@ public static void execute(@OriginalArg(0) String cmd, @OriginalArg(1) boolean a
}
try {
if (cmd.equalsIgnoreCase("fpson")) {
Static356.displayfps = true;
displayfps = true;
DevConsole.log("fps debug enabled");
return;
}
if (cmd.equalsIgnoreCase("fpsoff")) {
Static356.displayfps = false;
displayfps = false;
DevConsole.log("fps debug disabled");
return;
}
Expand Down Expand Up @@ -174,19 +177,19 @@ public static void execute(@OriginalArg(0) String cmd, @OriginalArg(1) boolean a
return;
}
if (cmd.equalsIgnoreCase("ot")) {
client.preferences.manyGroundTextures = !client.preferences.manyGroundTextures;
client.preferences.groundTextures = !client.preferences.groundTextures;
client.preferences.write(GameShell.signlink);
Preferences.sentToServer = false;
Static347.method5827();
DevConsole.log("ot=" + client.preferences.manyGroundTextures);
DevConsole.log("ot=" + client.preferences.groundTextures);
return;
}
if (cmd.equalsIgnoreCase("gb")) {
client.preferences.gb = !client.preferences.gb;
client.preferences.groundBlending = !client.preferences.groundBlending;
client.preferences.write(GameShell.signlink);
Preferences.sentToServer = false;
Static347.method5827();
DevConsole.log("gb=" + client.preferences.gb);
DevConsole.log("gb=" + client.preferences.groundBlending);
return;
}
if (cmd.startsWith("shadows")) {
Expand All @@ -197,7 +200,7 @@ public static void execute(@OriginalArg(0) String cmd, @OriginalArg(1) boolean a
@Pc(521) String local521 = cmd.substring(8);
@Pc(531) int local531 = StringUtils.isInt(local521) ? StringUtils.parseInt(local521) : -1;
if (local531 >= 0 && local531 <= 2) {
client.preferences.sceneryShadowsType = local531;
client.preferences.shadows = local531;
client.preferences.write(GameShell.signlink);
Preferences.sentToServer = false;
Static347.method5827();
Expand All @@ -214,10 +217,10 @@ public static void execute(@OriginalArg(0) String cmd, @OriginalArg(1) boolean a
}
local76 = StringUtils.parseInt(cmd.substring(6));
if (local76 >= 0 && local76 <= Static289.method5019(GameShell.maxMemory)) {
client.preferences.anInt4883 = local76;
client.preferences.buildArea = local76;
client.preferences.write(GameShell.signlink);
Preferences.sentToServer = false;
DevConsole.log("maxbuildarea=" + client.preferences.anInt4883);
DevConsole.log("maxbuildarea=" + client.preferences.buildArea);
return;
}
DevConsole.log("Invalid buildarea value");
Expand All @@ -231,7 +234,7 @@ public static void execute(@OriginalArg(0) String cmd, @OriginalArg(1) boolean a
Preferences.setParticles(StringUtils.parseInt(cmd.substring(13)));
client.preferences.write(GameShell.signlink);
Preferences.sentToServer = false;
DevConsole.log("particles=" + Static184.method3391());
DevConsole.log("particles=" + Preferences.getParticles());
return;
}
if (cmd.startsWith("rect_debug")) {
Expand All @@ -255,7 +258,7 @@ public static void execute(@OriginalArg(0) String cmd, @OriginalArg(1) boolean a
}
if (cmd.startsWith("bloom")) {
@Pc(736) boolean local736 = Rasteriser.instance.method2892();
if (Static284.method4882(!local736)) {
if (Static284.setBloomEnabled(!local736)) {
if (!local736) {
DevConsole.log("Bloom enabled");
return;
Expand All @@ -267,23 +270,23 @@ public static void execute(@OriginalArg(0) String cmd, @OriginalArg(1) boolean a
return;
}
if (cmd.equalsIgnoreCase("tween")) {
if (!Static318.aBoolean408) {
Static318.aBoolean408 = true;
if (!Static318.forceTweening) {
Static318.forceTweening = true;
DevConsole.log("Forced tweening ENABLED!");
return;
}
Static318.aBoolean408 = false;
Static318.forceTweening = false;
DevConsole.log("Forced tweening disabled.");
return;
}
if (cmd.equalsIgnoreCase("shiftclick")) {
if (Static148.aBoolean192) {
if (Static148.shiftClickMod) {
DevConsole.log("Shift-click disabled.");
Static148.aBoolean192 = false;
Static148.shiftClickMod = false;
return;
}
DevConsole.log("Shift-click ENABLED!");
Static148.aBoolean192 = true;
Static148.shiftClickMod = true;
return;
}
if (cmd.equalsIgnoreCase("getcgcoord")) {
Expand Down Expand Up @@ -406,9 +409,9 @@ public static void execute(@OriginalArg(0) String cmd, @OriginalArg(1) boolean a
if (cmd.startsWith("cpuusage")) {
local76 = Integer.parseInt(cmd.substring(9));
if (local76 >= 0 && local76 <= 4) {
client.preferences.anInt4881 = local76;
client.preferences.cpuUsage = local76;
}
DevConsole.log("cpuusage=" + client.preferences.anInt4881);
DevConsole.log("cpuusage=" + client.preferences.cpuUsage);
return;
}
if (cmd.startsWith("getclientvarpbit")) {
Expand Down
2 changes: 1 addition & 1 deletion client/src/main/java/Class11_Sub1_Sub3.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public Class11_Sub1_Sub3(@OriginalArg(0) RasteriserBase arg0, @OriginalArg(1) Lo
super.anInt3485 = (short) arg5;
this.aShort40 = (short) arg1.anInt1351;
this.aBoolean230 = arg6;
this.aBoolean232 = arg0.method2878() && arg1.aBoolean110 && !this.aBoolean230 && client.preferences.sceneryShadowsType != 0;
this.aBoolean232 = arg0.method2878() && arg1.aBoolean110 && !this.aBoolean230 && client.preferences.shadows != 0;
@Pc(68) int local68 = 1024;
if (this.aBoolean231) {
local68 |= 0x8000;
Expand Down
2 changes: 1 addition & 1 deletion client/src/main/java/Class11_Sub2_Sub1.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public Class11_Sub2_Sub1(@OriginalArg(0) RasteriserBase arg0, @OriginalArg(1) Lo
this.aBoolean65 = arg6;
this.aBoolean64 = arg8;
this.aShort1 = (short) arg1.anInt1351;
this.aBoolean66 = arg0.method2878() && arg1.aBoolean110 && !this.aBoolean65 && client.preferences.sceneryShadowsType != 0;
this.aBoolean66 = arg0.method2878() && arg1.aBoolean110 && !this.aBoolean65 && client.preferences.shadows != 0;
@Pc(70) int local70 = 1024;
if (this.aBoolean64) {
local70 |= 0x8000;
Expand Down
2 changes: 1 addition & 1 deletion client/src/main/java/Class11_Sub3_Sub2.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public Class11_Sub3_Sub2(@OriginalArg(0) RasteriserBase arg0, @OriginalArg(1) Lo
this.aByte43 = (byte) arg10;
this.aBoolean277 = arg6;
this.aBoolean278 = arg1.anInt1335 != 0 && !arg6;
this.aBoolean279 = arg0.method2878() && arg1.aBoolean110 && !this.aBoolean277 && client.preferences.sceneryShadowsType != 0;
this.aBoolean279 = arg0.method2878() && arg1.aBoolean110 && !this.aBoolean277 && client.preferences.shadows != 0;
@Pc(74) Class105 local74 = this.method4097(1024, this.aBoolean279, arg0);
if (local74 != null) {
this.aClass2_Sub2_Sub4_5 = local74.aClass2_Sub2_Sub4_3;
Expand Down
2 changes: 1 addition & 1 deletion client/src/main/java/Class11_Sub5_Sub1.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public Class11_Sub5_Sub1(@OriginalArg(0) RasteriserBase arg0, @OriginalArg(1) Lo
this.aBoolean154 = arg7;
this.aShort34 = (short) arg1.anInt1351;
this.aByte24 = (byte) arg13;
this.aBoolean155 = arg0.method2878() && arg1.aBoolean110 && !this.aBoolean154 && client.preferences.sceneryShadowsType != 0;
this.aBoolean155 = arg0.method2878() && arg1.aBoolean110 && !this.aBoolean154 && client.preferences.shadows != 0;
@Pc(77) int local77 = 1024;
if (this.aBoolean153) {
local77 |= 0x8000;
Expand Down
10 changes: 5 additions & 5 deletions client/src/main/java/Class157.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public Model method3986(@OriginalArg(0) Model arg0, @OriginalArg(1) int arg1, @O
return arg0.method3800((byte) 1, arg2, true);
}
@Pc(35) AnimFrameset local35 = null;
if ((this.aBoolean264 || Static318.aBoolean408) && arg4 != -1 && this.anIntArray262.length > arg4) {
if ((this.aBoolean264 || Static318.forceTweening) && arg4 != -1 && this.anIntArray262.length > arg4) {
@Pc(54) int local54 = this.anIntArray262[arg4];
local35 = this.aClass85_2.method2368(local54 >> 16);
arg4 = local54 & 0xFFFF;
Expand All @@ -90,7 +90,7 @@ public Model method3986(@OriginalArg(0) Model arg0, @OriginalArg(1) int arg1, @O
local72 &= 0xFFFF;
}
}
if ((this.aBoolean264 || Static318.aBoolean408) && arg4 != -1 && this.anIntArray263.length > arg4) {
if ((this.aBoolean264 || Static318.forceTweening) && arg4 != -1 && this.anIntArray263.length > arg4) {
local74 = this.anIntArray263[arg4];
if (local74 != 65535) {
local70 = this.aClass85_2.method2368(local74 >> 16);
Expand Down Expand Up @@ -150,7 +150,7 @@ public Model method3987(@OriginalArg(0) int arg0, @OriginalArg(1) byte arg1, @Or
return arg6.method3800(arg1, arg5, true);
}
@Pc(35) AnimFrameset local35 = null;
if ((this.aBoolean264 || Static318.aBoolean408) && arg0 != -1 && arg0 < this.anIntArray262.length) {
if ((this.aBoolean264 || Static318.forceTweening) && arg0 != -1 && arg0 < this.anIntArray262.length) {
@Pc(53) int local53 = this.anIntArray262[arg0];
local35 = this.aClass85_2.method2368(local53 >> 16);
arg0 = local53 & 0xFFFF;
Expand Down Expand Up @@ -267,7 +267,7 @@ public int method3990(@OriginalArg(0) int arg0, @OriginalArg(1) boolean arg1, @O
if (local22 == null) {
return 0;
}
if ((this.aBoolean264 || Static318.aBoolean408) && arg2 != -1 && this.anIntArray262.length > arg2) {
if ((this.aBoolean264 || Static318.forceTweening) && arg2 != -1 && this.anIntArray262.length > arg2) {
local7 = this.anIntArray262[arg2];
local14 = this.aClass85_2.method2368(local7 >> 16);
local7 &= 0xFFFF;
Expand Down Expand Up @@ -307,7 +307,7 @@ public int method3990(@OriginalArg(0) int arg0, @OriginalArg(1) boolean arg1, @O
}
}
}
if ((this.aBoolean264 || Static318.aBoolean408) && arg2 != -1 && this.anIntArray263.length > arg2) {
if ((this.aBoolean264 || Static318.forceTweening) && arg2 != -1 && this.anIntArray263.length > arg2) {
local125 = this.anIntArray263[arg2];
if (local125 != 65535) {
local138 = this.aClass85_2.method2368(local125 >> 16);
Expand Down
Loading

0 comments on commit 886564f

Please sign in to comment.