mirror of
https://gitlab.com/2009scape/rt4-client.git
synced 2025-12-17 12:00:19 -07:00
Replaced getDeclaredConstructor with constructors
This commit is contained in:
parent
fd3572f709
commit
37883b9f35
7 changed files with 7 additions and 19 deletions
|
|
@ -79,7 +79,7 @@ public class AudioChannel {
|
|||
throw new IllegalStateException();
|
||||
}
|
||||
try {
|
||||
@Pc(33) AudioChannel audioChannel = (AudioChannel) Class.forName("rt4.JavaAudioChannel").getDeclaredConstructor().newInstance();
|
||||
@Pc(33) AudioChannel audioChannel = new JavaAudioChannel();
|
||||
audioChannel.sampleRate2 = arg0;
|
||||
audioChannel.samples = new int[(stereo ? 2 : 1) * 256];
|
||||
audioChannel.init(arg2);
|
||||
|
|
|
|||
|
|
@ -141,18 +141,7 @@ public abstract class GameShell extends Applet implements Runnable, FocusListene
|
|||
|
||||
@OriginalMember(owner = "client!sd", name = "e", descriptor = "(I)V")
|
||||
public static void getMaxMemory() {
|
||||
try {
|
||||
@Pc(12) Method method = Runtime.class.getMethod("maxMemory");
|
||||
if (method != null) {
|
||||
try {
|
||||
@Pc(17) Runtime runtime = Runtime.getRuntime();
|
||||
@Pc(24) Long bytes = (Long) method.invoke(runtime, (Object[]) null);
|
||||
maxMemory = (int) (bytes / 1048576L) + 1;
|
||||
} catch (@Pc(34) Throwable ex) {
|
||||
}
|
||||
}
|
||||
} catch (@Pc(36) Exception ex) {
|
||||
}
|
||||
maxMemory = (int) (Runtime.getRuntime().maxMemory() / 1048576L) + 1;
|
||||
}
|
||||
|
||||
@OriginalMember(owner = "client!la", name = "a", descriptor = "(Lsignlink!ll;Ljava/lang/Object;I)V")
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ public abstract class MouseWheel {
|
|||
@OriginalMember(owner = "client!dh", name = "a", descriptor = "(B)Lclient!uc;")
|
||||
public static MouseWheel create() {
|
||||
try {
|
||||
return (MouseWheel) Class.forName("rt4.JavaMouseWheel").getDeclaredConstructor().newInstance();
|
||||
return new JavaMouseWheel();
|
||||
} catch (@Pc(15) Throwable local15) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,8 +125,7 @@ public final class Static131 {
|
|||
@OriginalMember(owner = "client!kd", name = "a", descriptor = "(IIZLjava/awt/Component;)Lclient!vk;")
|
||||
public static FrameBuffer create(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(3) Component arg2) {
|
||||
try {
|
||||
@Pc(12) Class local12 = Class.forName("rt4.BufferedImageFrameBuffer");
|
||||
@Pc(16) FrameBuffer local16 = (FrameBuffer) local12.getDeclaredConstructor().newInstance();
|
||||
@Pc(16) FrameBuffer local16 = new BufferedImageFrameBuffer();
|
||||
local16.init(arg0, arg1, arg2);
|
||||
return local16;
|
||||
} catch (@Pc(25) Throwable local25) {
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public final class Static33 {
|
|||
}
|
||||
if (arg0.length > 136 && !Static84.aBoolean127) {
|
||||
try {
|
||||
@Pc(27) ByteArray local27 = (ByteArray) Class.forName("rt4.DirectByteArray").getDeclaredConstructor().newInstance();
|
||||
@Pc(27) ByteArray local27 = new DirectByteArray();
|
||||
local27.set(arg0);
|
||||
return local27;
|
||||
} catch (@Pc(34) Throwable local34) {
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ public final class Static44 {
|
|||
@OriginalMember(owner = "client!dh", name = "b", descriptor = "(I)Lclient!q;")
|
||||
public static ReferenceNodeFactory method1147() {
|
||||
try {
|
||||
return (ReferenceNodeFactory) Class.forName("rt4.SoftReferenceNodeFactory").getDeclaredConstructor().newInstance();
|
||||
return new SoftReferenceNodeFactory();
|
||||
} catch (@Pc(15) Throwable local15) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ public abstract class Timer {
|
|||
@OriginalMember(owner = "client!fi", name = "a", descriptor = "(B)Lclient!s;")
|
||||
public static Timer create() {
|
||||
try {
|
||||
return (Timer) Class.forName("rt4.NanoTimer").getDeclaredConstructor().newInstance();
|
||||
return new NanoTimer();
|
||||
} catch (@Pc(15) Throwable ex) {
|
||||
return new MillisTimer();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue