diff --git a/client/config.json b/client/config.json index 38fac21..1c98155 100644 --- a/client/config.json +++ b/client/config.json @@ -1,6 +1,6 @@ { - "ip_management": "localhost", - "ip_address": "localhost", + "ip_management": "test.2009scape.org", + "ip_address": "test.2009scape.org", "world": 1, "server_port": 43594, "wl_port": 43595, diff --git a/client/src/main/java/rt4/AttachLocRequest.java b/client/src/main/java/rt4/AttachLocRequest.java index 621b3e9..dc27936 100644 --- a/client/src/main/java/rt4/AttachLocRequest.java +++ b/client/src/main/java/rt4/AttachLocRequest.java @@ -1,5 +1,6 @@ package rt4; +import org.openrs2.deob.annotation.OriginalArg; import org.openrs2.deob.annotation.OriginalClass; import org.openrs2.deob.annotation.OriginalMember; import org.openrs2.deob.annotation.Pc; @@ -9,11 +10,12 @@ public final class AttachLocRequest extends Node { @OriginalMember(owner = "client!ka", name = "q", descriptor = "Lclient!ih;") public static final LinkedList queue = new LinkedList(); + @OriginalMember(owner = "client!cn", name = "p", descriptor = "I") - public int anInt1187; + public int setLoops; @OriginalMember(owner = "client!cn", name = "r", descriptor = "I") - public int anInt1188; + public int x0Delta; @OriginalMember(owner = "client!cn", name = "t", descriptor = "I") public int locId; @@ -22,25 +24,25 @@ public final class AttachLocRequest extends Node { public int x; @OriginalMember(owner = "client!cn", name = "v", descriptor = "I") - public int anInt1191; + public int x1Delta; @OriginalMember(owner = "client!cn", name = "w", descriptor = "I") public int entityId; @OriginalMember(owner = "client!cn", name = "D", descriptor = "I") - public int anInt1197; + public int z0Delta; @OriginalMember(owner = "client!cn", name = "E", descriptor = "I") public int shape; @OriginalMember(owner = "client!cn", name = "H", descriptor = "I") - public int anInt1200; + public int z1Delta; @OriginalMember(owner = "client!cn", name = "M", descriptor = "I") public int z; @OriginalMember(owner = "client!cn", name = "N", descriptor = "I") - public int anInt1205; + public int resetLoops; @OriginalMember(owner = "client!cn", name = "O", descriptor = "I") public int angle; @@ -99,26 +101,26 @@ public final class AttachLocRequest extends Node { } else if (layer == 2) { @Pc(198) Scenery scenery = SceneGraph.getScenery(Player.level, request.x, request.z); if (scenery != null) { - attachment = scenery.primary; + attachment = scenery.entity; } } else if (layer == 3) { @Pc(216) GroundDecor groundDecor = SceneGraph.getGroundDecor(Player.level, request.x, request.z); if (groundDecor != null) { - attachment = groundDecor.primary; + attachment = groundDecor.entity; } } if (attachment != null) { - ChangeLocRequest.push(Player.level, request.z, 0, request.x, request.anInt1205 + 1, -1, layer, 0, request.anInt1187 + 1); - entity.anInt3375 = request.anInt1205 + client.loop; + ChangeLocRequest.push(Player.level, request.z, 0, request.x, request.resetLoops + 1, -1, layer, 0, request.setLoops + 1); + entity.attachmentResetAt = request.resetLoops + client.loop; entity.attachmentZFine = length * 64 + request.z * 128; entity.attachmentXFine = width * 64 + request.x * 128; entity.attachment = attachment; - @Pc(292) int x0Delta = request.anInt1188; + @Pc(292) int x0Delta = request.x0Delta; entity.attachmentY = y; - entity.anInt3390 = client.loop + request.anInt1187; - @Pc(304) int x1Delta = request.anInt1191; - @Pc(307) int z0Delta = request.anInt1197; - @Pc(310) int z1Delta = request.anInt1200; + entity.attachmentSetAt = client.loop + request.setLoops; + @Pc(304) int x1Delta = request.x1Delta; + @Pc(307) int z0Delta = request.z0Delta; + @Pc(310) int z1Delta = request.z1Delta; @Pc(316) int temp; if (x0Delta > x1Delta) { temp = x0Delta; @@ -138,4 +140,22 @@ public final class AttachLocRequest extends Node { } } } + + @OriginalMember(owner = "client!nh", name = "a", descriptor = "(IIIIIIIIIIIII)V") + public static void push(@OriginalArg(0) int x1Delta, @OriginalArg(1) int setLoops, @OriginalArg(2) int entityId, @OriginalArg(3) int resetLoops, @OriginalArg(4) int z, @OriginalArg(5) int z1Delta, @OriginalArg(6) int angle, @OriginalArg(7) int x0Delta, @OriginalArg(8) int x, @OriginalArg(9) int shape, @OriginalArg(11) int z0Delta, @OriginalArg(12) int locId) { + @Pc(7) AttachLocRequest req = new AttachLocRequest(); + req.angle = angle; + req.resetLoops = resetLoops; + req.setLoops = setLoops; + req.z1Delta = z1Delta; + req.entityId = entityId; + req.x = x; + req.z0Delta = z0Delta; + req.z = z; + req.locId = locId; + req.x0Delta = x0Delta; + req.x1Delta = x1Delta; + req.shape = shape; + queue.addTail(req); + } } diff --git a/client/src/main/java/rt4/ClientProt.java b/client/src/main/java/rt4/ClientProt.java index 94d1408..18a8bb1 100644 --- a/client/src/main/java/rt4/ClientProt.java +++ b/client/src/main/java/rt4/ClientProt.java @@ -305,7 +305,7 @@ public class ClientProt { client.audioLoop(); System.gc(); ping(true); - SceneGraph.method3535(false); + SceneGraph.load(false); if (!Static230.dynamicMapRegion) { Static87.method1805(false); ping(true); @@ -331,7 +331,7 @@ public class ClientProt { } client.method3768(); ping(true); - Static45.method1169(PathFinder.collisionMaps, false); + SceneGraph.method1169(PathFinder.collisionMaps, false); if (GlRenderer.enabled) { LightingManager.method2395(); } @@ -347,10 +347,10 @@ public class ClientProt { } else { Static146.method2750(SceneGraph.firstVisibleLevel); } - SceneGraph.method2255(); + SceneGraph.unload(); if (GlRenderer.enabled && hasUnderWaterMap) { SceneGraph.setUnderwater(true); - SceneGraph.method3535(true); + SceneGraph.load(true); if (!Static230.dynamicMapRegion) { Static87.method1805(true); ping(true); @@ -363,9 +363,9 @@ public class ClientProt { } client.method3768(); ping(true); - Static45.method1169(PathFinder.collisionMaps, true); + SceneGraph.method1169(PathFinder.collisionMaps, true); ping(true); - SceneGraph.method2255(); + SceneGraph.unload(); SceneGraph.setUnderwater(false); } if (GlRenderer.enabled) { diff --git a/client/src/main/java/rt4/CollisionMap.java b/client/src/main/java/rt4/CollisionMap.java index e9f80de..1d054d5 100644 --- a/client/src/main/java/rt4/CollisionMap.java +++ b/client/src/main/java/rt4/CollisionMap.java @@ -9,284 +9,281 @@ import org.openrs2.deob.annotation.Pc; public final class CollisionMap { @OriginalMember(owner = "client!mj", name = "k", descriptor = "I") - private final int anInt3904; + private final int length; @OriginalMember(owner = "client!mj", name = "p", descriptor = "I") - private final int anInt3907; + private final int zOffset; @OriginalMember(owner = "client!mj", name = "v", descriptor = "I") - private final int anInt3912; + private final int xOffset; @OriginalMember(owner = "client!mj", name = "e", descriptor = "I") - private final int anInt3899; + private final int width; @OriginalMember(owner = "client!mj", name = "m", descriptor = "[[I") public final int[][] flags; @OriginalMember(owner = "client!mj", name = "", descriptor = "(II)V") - public CollisionMap(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1) { - this.anInt3904 = arg1; - this.anInt3907 = 0; - this.anInt3912 = 0; - this.anInt3899 = arg0; - this.flags = new int[this.anInt3899][this.anInt3904]; + public CollisionMap(@OriginalArg(0) int width, @OriginalArg(1) int length) { + this.length = length; + this.zOffset = 0; + this.xOffset = 0; + this.width = width; + this.flags = new int[this.width][this.length]; this.clear(); } @OriginalMember(owner = "client!mj", name = "a", descriptor = "(IZIIII)V") - public final void method3039(@OriginalArg(0) int arg0, @OriginalArg(1) boolean arg1, @OriginalArg(3) int arg2, @OriginalArg(4) int arg3, @OriginalArg(5) int arg4) { - @Pc(4) int local4 = arg4 - this.anInt3912; - @Pc(23) int local23 = arg2 - this.anInt3907; - if (arg3 == 0) { - if (arg0 == 0) { - this.method3055(local23, local4, 128); - this.method3055(local23, local4 - 1, 8); + public final void unflagWall(@OriginalArg(0) int angle, @OriginalArg(1) boolean blockProjectiles, @OriginalArg(3) int startZ, @OriginalArg(4) int shape, @OriginalArg(5) int startX) { + @Pc(4) int x = startX - this.xOffset; + @Pc(23) int z = startZ - this.zOffset; + if (shape == 0) { + if (angle == 0) { + this.unflag(z, x, 128); + this.unflag(z, x - 1, 8); } - if (arg0 == 1) { - this.method3055(local23, local4, 2); - this.method3055(local23 + 1, local4, 32); + if (angle == 1) { + this.unflag(z, x, 2); + this.unflag(z + 1, x, 32); } - if (arg0 == 2) { - this.method3055(local23, local4, 8); - this.method3055(local23, local4 + 1, 128); + if (angle == 2) { + this.unflag(z, x, 8); + this.unflag(z, x + 1, 128); } - if (arg0 == 3) { - this.method3055(local23, local4, 32); - this.method3055(local23 - 1, local4, 2); + if (angle == 3) { + this.unflag(z, x, 32); + this.unflag(z - 1, x, 2); } } - if (arg3 == 1 || arg3 == 3) { - if (arg0 == 0) { - this.method3055(local23, local4, 1); - this.method3055(local23 + 1, local4 + -1, 16); + if (shape == 1 || shape == 3) { + if (angle == 0) { + this.unflag(z, x, 1); + this.unflag(z + 1, x + -1, 16); } - if (arg0 == 1) { - this.method3055(local23, local4, 4); - this.method3055(local23 + 1, local4 + 1, 64); + if (angle == 1) { + this.unflag(z, x, 4); + this.unflag(z + 1, x + 1, 64); } - if (arg0 == 2) { - this.method3055(local23, local4, 16); - this.method3055(local23 - 1, local4 - -1, 1); + if (angle == 2) { + this.unflag(z, x, 16); + this.unflag(z - 1, x - -1, 1); } - if (arg0 == 3) { - this.method3055(local23, local4, 64); - this.method3055(local23 - 1, local4 + -1, 4); + if (angle == 3) { + this.unflag(z, x, 64); + this.unflag(z - 1, x + -1, 4); } } - if (arg3 == 2) { - if (arg0 == 0) { - this.method3055(local23, local4, 130); - this.method3055(local23, local4 - 1, 8); - this.method3055(local23 + 1, local4, 32); + if (shape == 2) { + if (angle == 0) { + this.unflag(z, x, 130); + this.unflag(z, x - 1, 8); + this.unflag(z + 1, x, 32); } - if (arg0 == 1) { - this.method3055(local23, local4, 10); - this.method3055(local23 + 1, local4, 32); - this.method3055(local23, local4 + 1, 128); + if (angle == 1) { + this.unflag(z, x, 10); + this.unflag(z + 1, x, 32); + this.unflag(z, x + 1, 128); } - if (arg0 == 2) { - this.method3055(local23, local4, 40); - this.method3055(local23, local4 + 1, 128); - this.method3055(local23 - 1, local4, 2); + if (angle == 2) { + this.unflag(z, x, 40); + this.unflag(z, x + 1, 128); + this.unflag(z - 1, x, 2); } - if (arg0 == 3) { - this.method3055(local23, local4, 160); - this.method3055(local23 - 1, local4, 2); - this.method3055(local23, local4 - 1, 8); + if (angle == 3) { + this.unflag(z, x, 160); + this.unflag(z - 1, x, 2); + this.unflag(z, x - 1, 8); } } - if (!arg1) { - return; - } - if (arg3 == 0) { - if (arg0 == 0) { - this.method3055(local23, local4, 65536); - this.method3055(local23, local4 - 1, 4096); + + if (blockProjectiles) { + if (shape == 0) { + if (angle == 0) { + this.unflag(z, x, 65536); + this.unflag(z, x - 1, 4096); + } + if (angle == 1) { + this.unflag(z, x, 1024); + this.unflag(z + 1, x, 16384); + } + if (angle == 2) { + this.unflag(z, x, 4096); + this.unflag(z, x + 1, 65536); + } + if (angle == 3) { + this.unflag(z, x, 16384); + this.unflag(z - 1, x, 1024); + } } - if (arg0 == 1) { - this.method3055(local23, local4, 1024); - this.method3055(local23 + 1, local4, 16384); + if (shape == 1 || shape == 3) { + if (angle == 0) { + this.unflag(z, x, 512); + this.unflag(z + 1, x + -1, 8192); + } + if (angle == 1) { + this.unflag(z, x, 2048); + this.unflag(z + 1, x - -1, 32768); + } + if (angle == 2) { + this.unflag(z, x, 8192); + this.unflag(z - 1, x + 1, 512); + } + if (angle == 3) { + this.unflag(z, x, 32768); + this.unflag(z - 1, x + -1, 2048); + } } - if (arg0 == 2) { - this.method3055(local23, local4, 4096); - this.method3055(local23, local4 + 1, 65536); + if (shape == 2) { + if (angle == 0) { + this.unflag(z, x, 66560); + this.unflag(z, x - 1, 4096); + this.unflag(z + 1, x, 16384); + } + if (angle == 1) { + this.unflag(z, x, 5120); + this.unflag(z + 1, x, 16384); + this.unflag(z, x + 1, 65536); + } + if (angle == 2) { + this.unflag(z, x, 20480); + this.unflag(z, x + 1, 65536); + this.unflag(z - 1, x, 1024); + } + if (angle == 3) { + this.unflag(z, x, 81920); + this.unflag(z - 1, x, 1024); + this.unflag(z, x - 1, 4096); + } } - if (arg0 == 3) { - this.method3055(local23, local4, 16384); - this.method3055(local23 - 1, local4, 1024); - } - } - if (arg3 == 1 || arg3 == 3) { - if (arg0 == 0) { - this.method3055(local23, local4, 512); - this.method3055(local23 + 1, local4 + -1, 8192); - } - if (arg0 == 1) { - this.method3055(local23, local4, 2048); - this.method3055(local23 + 1, local4 - -1, 32768); - } - if (arg0 == 2) { - this.method3055(local23, local4, 8192); - this.method3055(local23 - 1, local4 + 1, 512); - } - if (arg0 == 3) { - this.method3055(local23, local4, 32768); - this.method3055(local23 - 1, local4 + -1, 2048); - } - } - if (arg3 != 2) { - return; - } - if (arg0 == 0) { - this.method3055(local23, local4, 66560); - this.method3055(local23, local4 - 1, 4096); - this.method3055(local23 + 1, local4, 16384); - } - if (arg0 == 1) { - this.method3055(local23, local4, 5120); - this.method3055(local23 + 1, local4, 16384); - this.method3055(local23, local4 + 1, 65536); - } - if (arg0 == 2) { - this.method3055(local23, local4, 20480); - this.method3055(local23, local4 + 1, 65536); - this.method3055(local23 - 1, local4, 1024); - } - if (arg0 == 3) { - this.method3055(local23, local4, 81920); - this.method3055(local23 - 1, local4, 1024); - this.method3055(local23, local4 - 1, 4096); } } @OriginalMember(owner = "client!mj", name = "a", descriptor = "(IIIZII)V") - public final void method3040(@OriginalArg(0) int arg0, @OriginalArg(2) int arg1, @OriginalArg(3) boolean arg2, @OriginalArg(4) int arg3, @OriginalArg(5) int arg4) { - @Pc(4) int local4 = arg4 - this.anInt3912; - @Pc(13) int local13 = arg3 - this.anInt3907; - if (arg1 == 0) { - if (arg0 == 0) { - this.method3044(128, local4, local13); - this.method3044(8, local4 - 1, local13); + public final void flagWall(@OriginalArg(0) int angle, @OriginalArg(2) int shape, @OriginalArg(3) boolean blocksProjectiles, @OriginalArg(4) int startZ, @OriginalArg(5) int startX) { + @Pc(4) int x = startX - this.xOffset; + @Pc(13) int z = startZ - this.zOffset; + if (shape == 0) { + if (angle == 0) { + this.flag(128, x, z); + this.flag(8, x - 1, z); } - if (arg0 == 1) { - this.method3044(2, local4, local13); - this.method3044(32, local4, local13 + 1); + if (angle == 1) { + this.flag(2, x, z); + this.flag(32, x, z + 1); } - if (arg0 == 2) { - this.method3044(8, local4, local13); - this.method3044(128, local4 + 1, local13); + if (angle == 2) { + this.flag(8, x, z); + this.flag(128, x + 1, z); } - if (arg0 == 3) { - this.method3044(32, local4, local13); - this.method3044(2, local4, local13 - 1); + if (angle == 3) { + this.flag(32, x, z); + this.flag(2, x, z - 1); } } - if (arg1 == 1 || arg1 == 3) { - if (arg0 == 0) { - this.method3044(1, local4, local13); - this.method3044(16, local4 - 1, local13 + 1); + if (shape == 1 || shape == 3) { + if (angle == 0) { + this.flag(1, x, z); + this.flag(16, x - 1, z + 1); } - if (arg0 == 1) { - this.method3044(4, local4, local13); - this.method3044(64, local4 + 1, local13 + 1); + if (angle == 1) { + this.flag(4, x, z); + this.flag(64, x + 1, z + 1); } - if (arg0 == 2) { - this.method3044(16, local4, local13); - this.method3044(1, local4 + 1, local13 + -1); + if (angle == 2) { + this.flag(16, x, z); + this.flag(1, x + 1, z + -1); } - if (arg0 == 3) { - this.method3044(64, local4, local13); - this.method3044(4, local4 - 1, local13 + -1); + if (angle == 3) { + this.flag(64, x, z); + this.flag(4, x - 1, z + -1); } } - if (arg1 == 2) { - if (arg0 == 0) { - this.method3044(130, local4, local13); - this.method3044(8, local4 - 1, local13); - this.method3044(32, local4, local13 + 1); + if (shape == 2) { + if (angle == 0) { + this.flag(130, x, z); + this.flag(8, x - 1, z); + this.flag(32, x, z + 1); } - if (arg0 == 1) { - this.method3044(10, local4, local13); - this.method3044(32, local4, local13 + 1); - this.method3044(128, local4 + 1, local13); + if (angle == 1) { + this.flag(10, x, z); + this.flag(32, x, z + 1); + this.flag(128, x + 1, z); } - if (arg0 == 2) { - this.method3044(40, local4, local13); - this.method3044(128, local4 + 1, local13); - this.method3044(2, local4, local13 - 1); + if (angle == 2) { + this.flag(40, x, z); + this.flag(128, x + 1, z); + this.flag(2, x, z - 1); } - if (arg0 == 3) { - this.method3044(160, local4, local13); - this.method3044(2, local4, local13 - 1); - this.method3044(8, local4 - 1, local13); + if (angle == 3) { + this.flag(160, x, z); + this.flag(2, x, z - 1); + this.flag(8, x - 1, z); } } - if (!arg2) { - return; - } - if (arg1 == 0) { - if (arg0 == 0) { - this.method3044(65536, local4, local13); - this.method3044(4096, local4 - 1, local13); + if (blocksProjectiles) { + if (shape == 0) { + if (angle == 0) { + this.flag(65536, x, z); + this.flag(4096, x - 1, z); + } + if (angle == 1) { + this.flag(1024, x, z); + this.flag(16384, x, z + 1); + } + if (angle == 2) { + this.flag(4096, x, z); + this.flag(65536, x + 1, z); + } + if (angle == 3) { + this.flag(16384, x, z); + this.flag(1024, x, z - 1); + } } - if (arg0 == 1) { - this.method3044(1024, local4, local13); - this.method3044(16384, local4, local13 + 1); + if (shape == 1 || shape == 3) { + if (angle == 0) { + this.flag(512, x, z); + this.flag(8192, x - 1, z + 1); + } + if (angle == 1) { + this.flag(2048, x, z); + this.flag(32768, x + 1, z + 1); + } + if (angle == 2) { + this.flag(8192, x, z); + this.flag(512, x + 1, z + -1); + } + if (angle == 3) { + this.flag(32768, x, z); + this.flag(2048, x - 1, z - 1); + } } - if (arg0 == 2) { - this.method3044(4096, local4, local13); - this.method3044(65536, local4 + 1, local13); + if (shape == 2) { + if (angle == 0) { + this.flag(66560, x, z); + this.flag(4096, x - 1, z); + this.flag(16384, x, z + 1); + } + if (angle == 1) { + this.flag(5120, x, z); + this.flag(16384, x, z + 1); + this.flag(65536, x + 1, z); + } + if (angle == 2) { + this.flag(20480, x, z); + this.flag(65536, x + 1, z); + this.flag(1024, x, z - 1); + } + if (angle == 3) { + this.flag(81920, x, z); + this.flag(1024, x, z - 1); + this.flag(4096, x - 1, z); + } } - if (arg0 == 3) { - this.method3044(16384, local4, local13); - this.method3044(1024, local4, local13 - 1); - } - } - if (arg1 == 1 || arg1 == 3) { - if (arg0 == 0) { - this.method3044(512, local4, local13); - this.method3044(8192, local4 - 1, local13 + 1); - } - if (arg0 == 1) { - this.method3044(2048, local4, local13); - this.method3044(32768, local4 + 1, local13 + 1); - } - if (arg0 == 2) { - this.method3044(8192, local4, local13); - this.method3044(512, local4 + 1, local13 + -1); - } - if (arg0 == 3) { - this.method3044(32768, local4, local13); - this.method3044(2048, local4 - 1, local13 - 1); - } - } - if (arg1 != 2) { - return; - } - if (arg0 == 0) { - this.method3044(66560, local4, local13); - this.method3044(4096, local4 - 1, local13); - this.method3044(16384, local4, local13 + 1); - } - if (arg0 == 1) { - this.method3044(5120, local4, local13); - this.method3044(16384, local4, local13 + 1); - this.method3044(65536, local4 + 1, local13); - } - if (arg0 == 2) { - this.method3044(20480, local4, local13); - this.method3044(65536, local4 + 1, local13); - this.method3044(1024, local4, local13 - 1); - } - if (arg0 == 3) { - this.method3044(81920, local4, local13); - this.method3044(1024, local4, local13 - 1); - this.method3044(4096, local4 - 1, local13); } } @OriginalMember(owner = "client!mj", name = "a", descriptor = "(IIIIIIIIB)Z") - private boolean method3041(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) int arg4, @OriginalArg(5) int arg5, @OriginalArg(6) int arg6, @OriginalArg(7) int arg7) { + private boolean isInsideRect(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) int arg4, @OriginalArg(5) int arg5, @OriginalArg(6) int arg6, @OriginalArg(7) int arg7) { if (arg1 + arg2 > arg7 && arg2 < arg0 + arg7) { return arg3 + arg5 > arg4 && arg6 + arg4 > arg5; } else { @@ -295,243 +292,243 @@ public final class CollisionMap { } @OriginalMember(owner = "client!mj", name = "a", descriptor = "(IIZIIIII)Z") - public final boolean isAtWall(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(3) int arg2, @OriginalArg(4) int arg3, @OriginalArg(5) int arg4, @OriginalArg(6) int arg5, @OriginalArg(7) int arg6) { - if (arg5 == 1) { - if (arg1 == arg3 && arg2 == arg0) { + public final boolean isAtWall(@OriginalArg(0) int srcZ, @OriginalArg(1) int destX, @OriginalArg(3) int destZ, @OriginalArg(4) int srcX, @OriginalArg(5) int destType, @OriginalArg(6) int size, @OriginalArg(7) int destAngle) { + if (size == 1) { + if (destX == srcX && destZ == srcZ) { return true; } - } else if (arg1 <= arg3 && arg1 + arg5 - 1 >= arg3 && arg0 <= arg0 && arg0 <= arg5 + arg0 - 1) { + } else if (destX <= srcX && destX + size - 1 >= srcX && srcZ <= size + srcZ - 1) { return true; } - @Pc(49) int local49 = arg2 - this.anInt3907; - @Pc(54) int local54 = arg3 - this.anInt3912; - @Pc(59) int local59 = arg0 - this.anInt3907; - @Pc(64) int local64 = arg1 - this.anInt3912; - if (arg5 == 1) { - if (arg4 == 0) { - if (arg6 == 0) { - if (local64 == local54 - 1 && local49 == local59) { + @Pc(49) int endZ = destZ - this.zOffset; + @Pc(54) int startX = srcX - this.xOffset; + @Pc(59) int startZ = srcZ - this.zOffset; + @Pc(64) int endX = destX - this.xOffset; + if (size == 1) { + if (destType == 0) { + if (destAngle == 0) { + if (endX == startX - 1 && endZ == startZ) { return true; } - if (local64 == local54 && local59 + 1 == local49 && (this.flags[local64][local49] & 0x12C0120) == 0) { + if (endX == startX && startZ + 1 == endZ && (this.flags[endX][endZ] & 0x12C0120) == 0) { return true; } - if (local54 == local64 && local59 - 1 == local49 && (this.flags[local64][local49] & 0x12C0102) == 0) { + if (startX == endX && startZ - 1 == endZ && (this.flags[endX][endZ] & 0x12C0102) == 0) { return true; } - } else if (arg6 == 1) { - if (local54 == local64 && local49 == local59 + 1) { + } else if (destAngle == 1) { + if (startX == endX && endZ == startZ + 1) { return true; } - if (local54 - 1 == local64 && local59 == local49 && (this.flags[local64][local49] & 0x12C0108) == 0) { + if (startX - 1 == endX && startZ == endZ && (this.flags[endX][endZ] & 0x12C0108) == 0) { return true; } - if (local64 == local54 + 1 && local49 == local59 && (this.flags[local64][local49] & 0x12C0180) == 0) { + if (endX == startX + 1 && endZ == startZ && (this.flags[endX][endZ] & 0x12C0180) == 0) { return true; } - } else if (arg6 == 2) { - if (local54 + 1 == local64 && local49 == local59) { + } else if (destAngle == 2) { + if (startX + 1 == endX && endZ == startZ) { return true; } - if (local54 == local64 && local49 == local59 + 1 && (this.flags[local64][local49] & 0x12C0120) == 0) { + if (startX == endX && endZ == startZ + 1 && (this.flags[endX][endZ] & 0x12C0120) == 0) { return true; } - if (local54 == local64 && local59 - 1 == local49 && (this.flags[local64][local49] & 0x12C0102) == 0) { + if (startX == endX && startZ - 1 == endZ && (this.flags[endX][endZ] & 0x12C0102) == 0) { return true; } - } else if (arg6 == 3) { - if (local64 == local54 && local59 - 1 == local49) { + } else if (destAngle == 3) { + if (endX == startX && startZ - 1 == endZ) { return true; } - if (local54 - 1 == local64 && local59 == local49 && (this.flags[local64][local49] & 0x12C0108) == 0) { + if (startX - 1 == endX && startZ == endZ && (this.flags[endX][endZ] & 0x12C0108) == 0) { return true; } - if (local54 + 1 == local64 && local49 == local59 && (this.flags[local64][local49] & 0x12C0180) == 0) { + if (startX + 1 == endX && endZ == startZ && (this.flags[endX][endZ] & 0x12C0180) == 0) { return true; } } } - if (arg4 == 2) { - if (arg6 == 0) { - if (local64 == local54 - 1 && local59 == local49) { + if (destType == 2) { + if (destAngle == 0) { + if (endX == startX - 1 && startZ == endZ) { return true; } - if (local64 == local54 && local49 == local59 + 1) { + if (endX == startX && endZ == startZ + 1) { return true; } - if (local64 == local54 + 1 && local49 == local59 && (this.flags[local64][local49] & 0x12C0180) == 0) { + if (endX == startX + 1 && endZ == startZ && (this.flags[endX][endZ] & 0x12C0180) == 0) { return true; } - if (local54 == local64 && local49 == local59 - 1 && (this.flags[local64][local49] & 0x12C0102) == 0) { + if (startX == endX && endZ == startZ - 1 && (this.flags[endX][endZ] & 0x12C0102) == 0) { return true; } - } else if (arg6 == 1) { - if (local64 == local54 - 1 && local59 == local49 && (this.flags[local64][local49] & 0x12C0108) == 0) { + } else if (destAngle == 1) { + if (endX == startX - 1 && startZ == endZ && (this.flags[endX][endZ] & 0x12C0108) == 0) { return true; } - if (local54 == local64 && local59 + 1 == local49) { + if (startX == endX && startZ + 1 == endZ) { return true; } - if (local64 == local54 + 1 && local59 == local49) { + if (endX == startX + 1 && startZ == endZ) { return true; } - if (local54 == local64 && local49 == local59 - 1 && (this.flags[local64][local49] & 0x12C0102) == 0) { + if (startX == endX && endZ == startZ - 1 && (this.flags[endX][endZ] & 0x12C0102) == 0) { return true; } - } else if (arg6 == 2) { - if (local64 == local54 - 1 && local59 == local49 && (this.flags[local64][local49] & 0x12C0108) == 0) { + } else if (destAngle == 2) { + if (endX == startX - 1 && startZ == endZ && (this.flags[endX][endZ] & 0x12C0108) == 0) { return true; } - if (local54 == local64 && local49 == local59 + 1 && (this.flags[local64][local49] & 0x12C0120) == 0) { + if (startX == endX && endZ == startZ + 1 && (this.flags[endX][endZ] & 0x12C0120) == 0) { return true; } - if (local54 + 1 == local64 && local59 == local49) { + if (startX + 1 == endX && startZ == endZ) { return true; } - if (local64 == local54 && local59 - 1 == local49) { + if (endX == startX && startZ - 1 == endZ) { return true; } - } else if (arg6 == 3) { - if (local64 == local54 - 1 && local59 == local49) { + } else if (destAngle == 3) { + if (endX == startX - 1 && startZ == endZ) { return true; } - if (local64 == local54 && local59 + 1 == local49 && (this.flags[local64][local49] & 0x12C0120) == 0) { + if (endX == startX && startZ + 1 == endZ && (this.flags[endX][endZ] & 0x12C0120) == 0) { return true; } - if (local64 == local54 + 1 && local59 == local49 && (this.flags[local64][local49] & 0x12C0180) == 0) { + if (endX == startX + 1 && startZ == endZ && (this.flags[endX][endZ] & 0x12C0180) == 0) { return true; } - if (local64 == local54 && local49 == local59 - 1) { + if (endX == startX && endZ == startZ - 1) { return true; } } } - if (arg4 == 9) { - if (local64 == local54 && local59 + 1 == local49 && (this.flags[local64][local49] & 0x20) == 0) { + if (destType == 9) { + if (endX == startX && startZ + 1 == endZ && (this.flags[endX][endZ] & 0x20) == 0) { return true; } - if (local64 == local54 && local49 == local59 - 1 && (this.flags[local64][local49] & 0x2) == 0) { + if (endX == startX && endZ == startZ - 1 && (this.flags[endX][endZ] & 0x2) == 0) { return true; } - if (local64 == local54 - 1 && local49 == local59 && (this.flags[local64][local49] & 0x8) == 0) { + if (endX == startX - 1 && endZ == startZ && (this.flags[endX][endZ] & 0x8) == 0) { return true; } - if (local54 + 1 == local64 && local59 == local49 && (this.flags[local64][local49] & 0x80) == 0) { + if (startX + 1 == endX && startZ == endZ && (this.flags[endX][endZ] & 0x80) == 0) { return true; } } } else { - @Pc(785) int local785 = arg5 + local64 - 1; - @Pc(792) int local792 = local49 + arg5 - 1; - if (arg4 == 0) { - if (arg6 == 0) { - if (local64 == local54 - arg5 && local49 <= local59 && local59 <= local792) { + @Pc(785) int x1 = size + endX - 1; + @Pc(792) int z1 = endZ + size - 1; + if (destType == 0) { + if (destAngle == 0) { + if (endX == startX - size && endZ <= startZ && startZ <= z1) { return true; } - if (local64 <= local54 && local785 >= local54 && local59 + 1 == local49 && (this.flags[local54][local49] & 0x12C0120) == 0) { + if (endX <= startX && x1 >= startX && startZ + 1 == endZ && (this.flags[startX][endZ] & 0x12C0120) == 0) { return true; } - if (local64 <= local54 && local785 >= local54 && local59 - arg5 == local49 && (this.flags[local54][local792] & 0x12C0102) == 0) { + if (endX <= startX && x1 >= startX && startZ - size == endZ && (this.flags[startX][z1] & 0x12C0102) == 0) { return true; } - } else if (arg6 == 1) { - if (local54 >= local64 && local54 <= local785 && local59 + 1 == local49) { + } else if (destAngle == 1) { + if (startX >= endX && startX <= x1 && startZ + 1 == endZ) { return true; } - if (local64 == local54 - arg5 && local49 <= local59 && local792 >= local59 && (this.flags[local785][local59] & 0x12C0108) == 0) { + if (endX == startX - size && endZ <= startZ && z1 >= startZ && (this.flags[x1][startZ] & 0x12C0108) == 0) { return true; } - if (local64 == local54 + 1 && local49 <= local59 && local792 >= local59 && (this.flags[local64][local59] & 0x12C0180) == 0) { + if (endX == startX + 1 && endZ <= startZ && z1 >= startZ && (this.flags[endX][startZ] & 0x12C0180) == 0) { return true; } - } else if (arg6 == 2) { - if (local54 + 1 == local64 && local49 <= local59 && local59 <= local792) { + } else if (destAngle == 2) { + if (startX + 1 == endX && endZ <= startZ && startZ <= z1) { return true; } - if (local54 >= local64 && local785 >= local54 && local49 == local59 + 1 && (this.flags[local54][local49] & 0x12C0120) == 0) { + if (startX >= endX && x1 >= startX && endZ == startZ + 1 && (this.flags[startX][endZ] & 0x12C0120) == 0) { return true; } - if (local54 >= local64 && local785 >= local54 && local59 - arg5 == local49 && (this.flags[local54][local792] & 0x12C0102) == 0) { + if (startX >= endX && x1 >= startX && startZ - size == endZ && (this.flags[startX][z1] & 0x12C0102) == 0) { return true; } - } else if (arg6 == 3) { - if (local64 <= local54 && local785 >= local54 && local59 - arg5 == local49) { + } else if (destAngle == 3) { + if (endX <= startX && x1 >= startX && startZ - size == endZ) { return true; } - if (local64 == local54 - arg5 && local59 >= local49 && local792 >= local59 && (this.flags[local785][local59] & 0x12C0108) == 0) { + if (endX == startX - size && startZ >= endZ && z1 >= startZ && (this.flags[x1][startZ] & 0x12C0108) == 0) { return true; } - if (local54 + 1 == local64 && local49 <= local59 && local59 <= local792 && (this.flags[local64][local59] & 0x12C0180) == 0) { + if (startX + 1 == endX && endZ <= startZ && startZ <= z1 && (this.flags[endX][startZ] & 0x12C0180) == 0) { return true; } } } - if (arg4 == 2) { - if (arg6 == 0) { - if (local64 == local54 - arg5 && local59 >= local49 && local59 <= local792) { + if (destType == 2) { + if (destAngle == 0) { + if (endX == startX - size && startZ >= endZ && startZ <= z1) { return true; } - if (local64 <= local54 && local785 >= local54 && local49 == local59 + 1) { + if (endX <= startX && x1 >= startX && endZ == startZ + 1) { return true; } - if (local54 + 1 == local64 && local59 >= local49 && local59 <= local792 && (this.flags[local64][local59] & 0x12C0180) == 0) { + if (startX + 1 == endX && startZ >= endZ && startZ <= z1 && (this.flags[endX][startZ] & 0x12C0180) == 0) { return true; } - if (local54 >= local64 && local785 >= local54 && local59 - arg5 == local49 && (this.flags[local54][local792] & 0x12C0102) == 0) { + if (startX >= endX && x1 >= startX && startZ - size == endZ && (this.flags[startX][z1] & 0x12C0102) == 0) { return true; } - } else if (arg6 == 1) { - if (local64 == local54 - arg5 && local59 >= local49 && local59 <= local792 && (this.flags[local785][local59] & 0x12C0108) == 0) { + } else if (destAngle == 1) { + if (endX == startX - size && startZ >= endZ && startZ <= z1 && (this.flags[x1][startZ] & 0x12C0108) == 0) { return true; } - if (local64 <= local54 && local785 >= local54 && local49 == local59 + 1) { + if (endX <= startX && x1 >= startX && endZ == startZ + 1) { return true; } - if (local54 + 1 == local64 && local59 >= local49 && local59 <= local792) { + if (startX + 1 == endX && startZ >= endZ && startZ <= z1) { return true; } - if (local54 >= local64 && local54 <= local785 && local49 == local59 - arg5 && (this.flags[local54][local792] & 0x12C0102) == 0) { + if (startX >= endX && startX <= x1 && endZ == startZ - size && (this.flags[startX][z1] & 0x12C0102) == 0) { return true; } - } else if (arg6 == 2) { - if (local54 - arg5 == local64 && local49 <= local59 && local792 >= local59 && (this.flags[local785][local59] & 0x12C0108) == 0) { + } else if (destAngle == 2) { + if (startX - size == endX && endZ <= startZ && z1 >= startZ && (this.flags[x1][startZ] & 0x12C0108) == 0) { return true; } - if (local64 <= local54 && local54 <= local785 && local49 == local59 + 1 && (this.flags[local54][local49] & 0x12C0120) == 0) { + if (endX <= startX && startX <= x1 && endZ == startZ + 1 && (this.flags[startX][endZ] & 0x12C0120) == 0) { return true; } - if (local64 == local54 + 1 && local49 <= local59 && local59 <= local792) { + if (endX == startX + 1 && endZ <= startZ && startZ <= z1) { return true; } - if (local64 <= local54 && local785 >= local54 && local59 - arg5 == local49) { + if (endX <= startX && x1 >= startX && startZ - size == endZ) { return true; } - } else if (arg6 == 3) { - if (local54 - arg5 == local64 && local59 >= local49 && local59 <= local792) { + } else if (destAngle == 3) { + if (startX - size == endX && startZ >= endZ && startZ <= z1) { return true; } - if (local64 <= local54 && local54 <= local785 && local59 + 1 == local49 && (this.flags[local54][local49] & 0x12C0120) == 0) { + if (endX <= startX && startX <= x1 && startZ + 1 == endZ && (this.flags[startX][endZ] & 0x12C0120) == 0) { return true; } - if (local64 == local54 + 1 && local59 >= local49 && local59 <= local792 && (this.flags[local64][local59] & 0x12C0180) == 0) { + if (endX == startX + 1 && startZ >= endZ && startZ <= z1 && (this.flags[endX][startZ] & 0x12C0180) == 0) { return true; } - if (local64 <= local54 && local785 >= local54 && local59 - arg5 == local49) { + if (endX <= startX && x1 >= startX && startZ - size == endZ) { return true; } } } - if (arg4 == 9) { - if (local64 <= local54 && local54 <= local785 && local49 == local59 + 1 && (this.flags[local54][local49] & 0x12C0120) == 0) { + if (destType == 9) { + if (endX <= startX && startX <= x1 && endZ == startZ + 1 && (this.flags[startX][endZ] & 0x12C0120) == 0) { return true; } - if (local54 >= local64 && local54 <= local785 && local49 == local59 - arg5 && (this.flags[local54][local792] & 0x12C0102) == 0) { + if (startX >= endX && startX <= x1 && endZ == startZ - size && (this.flags[startX][z1] & 0x12C0102) == 0) { return true; } - if (local54 - arg5 == local64 && local59 >= local49 && local59 <= local792 && (this.flags[local785][local59] & 0x12C0108) == 0) { + if (startX - size == endX && startZ >= endZ && startZ <= z1 && (this.flags[x1][startZ] & 0x12C0108) == 0) { return true; } - if (local64 == local54 + 1 && local59 >= local49 && local792 >= local59 && (this.flags[local64][local59] & 0x12C0180) == 0) { + if (endX == startX + 1 && startZ >= endZ && z1 >= startZ && (this.flags[endX][startZ] & 0x12C0180) == 0) { return true; } } @@ -540,18 +537,18 @@ public final class CollisionMap { } @OriginalMember(owner = "client!mj", name = "a", descriptor = "(IZBIII)V") - public final void flagScenery(@OriginalArg(0) int arg0, @OriginalArg(1) boolean arg1, @OriginalArg(3) int arg2, @OriginalArg(4) int arg3, @OriginalArg(5) int arg4) { - @Pc(6) int local6 = arg2 - this.anInt3907; - @Pc(11) int local11 = arg0 - this.anInt3912; - @Pc(17) int local17 = 256; - if (arg1) { - local17 = 131328; + public final void flagScenery(@OriginalArg(0) int startX, @OriginalArg(1) boolean blocksProjectiles, @OriginalArg(3) int startZ, @OriginalArg(4) int arg3, @OriginalArg(5) int arg4) { + @Pc(6) int z = startZ - this.zOffset; + @Pc(11) int x = startX - this.xOffset; + @Pc(17) int flags = 256; + if (blocksProjectiles) { + flags = 131328; } - for (@Pc(25) int local25 = local11; local25 < local11 + arg3; local25++) { - if (local25 >= 0 && local25 < this.anInt3899) { - for (@Pc(47) int local47 = local6; local47 < arg4 + local6; local47++) { - if (local47 >= 0 && this.anInt3904 > local47) { - this.method3044(local17, local25, local47); + for (@Pc(25) int x0 = x; x0 < x + arg3; x0++) { + if (x0 >= 0 && x0 < this.width) { + for (@Pc(47) int z0 = z; z0 < arg4 + z; z0++) { + if (z0 >= 0 && this.length > z0) { + this.flag(flags, x0, z0); } } } @@ -559,120 +556,120 @@ public final class CollisionMap { } @OriginalMember(owner = "client!mj", name = "a", descriptor = "(IBII)V") - private void method3044(@OriginalArg(0) int arg0, @OriginalArg(2) int arg1, @OriginalArg(3) int arg2) { - this.flags[arg1][arg2] |= arg0; + private void flag(@OriginalArg(0) int flags, @OriginalArg(2) int x, @OriginalArg(3) int z) { + this.flags[x][z] |= flags; } @OriginalMember(owner = "client!mj", name = "a", descriptor = "(IIIIIIII)Z") - public final boolean isAtWallDecor(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) int arg4, @OriginalArg(5) int arg5, @OriginalArg(6) int arg6) { - if (arg4 == 1) { - if (arg2 == arg6 && arg0 == arg3) { + public final boolean isAtWallDecor(@OriginalArg(0) int srcZ, @OriginalArg(1) int destType, @OriginalArg(2) int srcX, @OriginalArg(3) int destZ, @OriginalArg(4) int size, @OriginalArg(5) int destAngle, @OriginalArg(6) int destX) { + if (size == 1) { + if (srcX == destX && srcZ == destZ) { return true; } - } else if (arg6 <= arg2 && arg4 + arg6 - 1 >= arg2 && arg0 <= arg0 && arg0 + arg4 - 1 >= arg0) { + } else if (destX <= srcX && size + destX - 1 >= srcX && srcZ + size - 1 >= srcZ) { return true; } - @Pc(62) int local62 = arg6 - this.anInt3912; - @Pc(67) int local67 = arg0 - this.anInt3907; - @Pc(72) int local72 = arg2 - this.anInt3912; - @Pc(77) int local77 = arg3 - this.anInt3907; - if (arg4 == 1) { - if (arg1 == 6 || arg1 == 7) { - if (arg1 == 7) { - arg5 = arg5 + 2 & 0x3; + @Pc(62) int endX = destX - this.xOffset; + @Pc(67) int startZ = srcZ - this.zOffset; + @Pc(72) int startX = srcX - this.xOffset; + @Pc(77) int endZ = destZ - this.zOffset; + if (size == 1) { + if (destType == 6 || destType == 7) { + if (destType == 7) { + destAngle = destAngle + 2 & 0x3; } - if (arg5 == 0) { - if (local62 == local72 + 1 && local67 == local77 && (this.flags[local62][local77] & 0x80) == 0) { + if (destAngle == 0) { + if (endX == startX + 1 && startZ == endZ && (this.flags[endX][endZ] & 0x80) == 0) { return true; } - if (local72 == local62 && local77 == local67 - 1 && (this.flags[local62][local77] & 0x2) == 0) { + if (startX == endX && endZ == startZ - 1 && (this.flags[endX][endZ] & 0x2) == 0) { return true; } - } else if (arg5 == 1) { - if (local62 == local72 - 1 && local67 == local77 && (this.flags[local62][local77] & 0x8) == 0) { + } else if (destAngle == 1) { + if (endX == startX - 1 && startZ == endZ && (this.flags[endX][endZ] & 0x8) == 0) { return true; } - if (local72 == local62 && local77 == local67 - 1 && (this.flags[local62][local77] & 0x2) == 0) { + if (startX == endX && endZ == startZ - 1 && (this.flags[endX][endZ] & 0x2) == 0) { return true; } - } else if (arg5 == 2) { - if (local62 == local72 - 1 && local77 == local67 && (this.flags[local62][local77] & 0x8) == 0) { + } else if (destAngle == 2) { + if (endX == startX - 1 && endZ == startZ && (this.flags[endX][endZ] & 0x8) == 0) { return true; } - if (local72 == local62 && local67 + 1 == local77 && (this.flags[local62][local77] & 0x20) == 0) { + if (startX == endX && startZ + 1 == endZ && (this.flags[endX][endZ] & 0x20) == 0) { return true; } - } else if (arg5 == 3) { - if (local62 == local72 + 1 && local77 == local67 && (this.flags[local62][local77] & 0x80) == 0) { + } else if (destAngle == 3) { + if (endX == startX + 1 && endZ == startZ && (this.flags[endX][endZ] & 0x80) == 0) { return true; } - if (local72 == local62 && local77 == local67 + 1 && (this.flags[local62][local77] & 0x20) == 0) { + if (startX == endX && endZ == startZ + 1 && (this.flags[endX][endZ] & 0x20) == 0) { return true; } } } - if (arg1 == 8) { - if (local62 == local72 && local67 + 1 == local77 && (this.flags[local62][local77] & 0x20) == 0) { + if (destType == 8) { + if (endX == startX && startZ + 1 == endZ && (this.flags[endX][endZ] & 0x20) == 0) { return true; } - if (local62 == local72 && local67 - 1 == local77 && (this.flags[local62][local77] & 0x2) == 0) { + if (endX == startX && startZ - 1 == endZ && (this.flags[endX][endZ] & 0x2) == 0) { return true; } - if (local72 - 1 == local62 && local77 == local67 && (this.flags[local62][local77] & 0x8) == 0) { + if (startX - 1 == endX && endZ == startZ && (this.flags[endX][endZ] & 0x8) == 0) { return true; } - if (local62 == local72 + 1 && local67 == local77 && (this.flags[local62][local77] & 0x80) == 0) { + if (endX == startX + 1 && startZ == endZ && (this.flags[endX][endZ] & 0x80) == 0) { return true; } } } else { - @Pc(414) int local414 = local62 + arg4 - 1; - @Pc(420) int local420 = local77 + arg4 - 1; - if (arg1 == 6 || arg1 == 7) { - if (arg1 == 7) { - arg5 = arg5 + 2 & 0x3; + @Pc(414) int x1 = endX + size - 1; + @Pc(420) int z1 = endZ + size - 1; + if (destType == 6 || destType == 7) { + if (destType == 7) { + destAngle = destAngle + 2 & 0x3; } - if (arg5 == 0) { - if (local72 + 1 == local62 && local77 <= local67 && local67 <= local420 && (this.flags[local62][local67] & 0x80) == 0) { + if (destAngle == 0) { + if (startX + 1 == endX && endZ <= startZ && startZ <= z1 && (this.flags[endX][startZ] & 0x80) == 0) { return true; } - if (local72 >= local62 && local414 >= local72 && local67 - arg4 == local77 && (this.flags[local72][local420] & 0x2) == 0) { + if (startX >= endX && x1 >= startX && startZ - size == endZ && (this.flags[startX][z1] & 0x2) == 0) { return true; } - } else if (arg5 == 1) { - if (local72 - arg4 == local62 && local67 >= local77 && local420 >= local67 && (this.flags[local414][local67] & 0x8) == 0) { + } else if (destAngle == 1) { + if (startX - size == endX && startZ >= endZ && z1 >= startZ && (this.flags[x1][startZ] & 0x8) == 0) { return true; } - if (local72 >= local62 && local414 >= local72 && local67 - arg4 == local77 && (this.flags[local72][local420] & 0x2) == 0) { + if (startX >= endX && x1 >= startX && startZ - size == endZ && (this.flags[startX][z1] & 0x2) == 0) { return true; } - } else if (arg5 == 2) { - if (local62 == local72 - arg4 && local67 >= local77 && local67 <= local420 && (this.flags[local414][local67] & 0x8) == 0) { + } else if (destAngle == 2) { + if (endX == startX - size && startZ >= endZ && startZ <= z1 && (this.flags[x1][startZ] & 0x8) == 0) { return true; } - if (local62 <= local72 && local72 <= local414 && local77 == local67 + 1 && (this.flags[local72][local77] & 0x20) == 0) { + if (endX <= startX && startX <= x1 && endZ == startZ + 1 && (this.flags[startX][endZ] & 0x20) == 0) { return true; } - } else if (arg5 == 3) { - if (local72 + 1 == local62 && local77 <= local67 && local67 <= local420 && (this.flags[local62][local67] & 0x80) == 0) { + } else if (destAngle == 3) { + if (startX + 1 == endX && endZ <= startZ && startZ <= z1 && (this.flags[endX][startZ] & 0x80) == 0) { return true; } - if (local72 >= local62 && local72 <= local414 && local77 == local67 + 1 && (this.flags[local72][local77] & 0x20) == 0) { + if (startX >= endX && startX <= x1 && endZ == startZ + 1 && (this.flags[startX][endZ] & 0x20) == 0) { return true; } } } - if (arg1 == 8) { - if (local62 <= local72 && local414 >= local72 && local77 == local67 + 1 && (this.flags[local72][local77] & 0x20) == 0) { + if (destType == 8) { + if (endX <= startX && x1 >= startX && endZ == startZ + 1 && (this.flags[startX][endZ] & 0x20) == 0) { return true; } - if (local72 >= local62 && local414 >= local72 && local77 == local67 - arg4 && (this.flags[local72][local420] & 0x2) == 0) { + if (startX >= endX && x1 >= startX && endZ == startZ - size && (this.flags[startX][z1] & 0x2) == 0) { return true; } - if (local62 == local72 - arg4 && local77 <= local67 && local420 >= local67 && (this.flags[local414][local67] & 0x8) == 0) { + if (endX == startX - size && endZ <= startZ && z1 >= startZ && (this.flags[x1][startZ] & 0x8) == 0) { return true; } - if (local62 == local72 + 1 && local67 >= local77 && local67 <= local420 && (this.flags[local62][local67] & 0x80) == 0) { + if (endX == startX + 1 && startZ >= endZ && startZ <= z1 && (this.flags[endX][startZ] & 0x80) == 0) { return true; } } @@ -681,77 +678,77 @@ public final class CollisionMap { } @OriginalMember(owner = "client!mj", name = "a", descriptor = "(IIIIZIIIII)Z") - private boolean method3048(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(5) int arg4, @OriginalArg(6) int arg5, @OriginalArg(7) int arg6, @OriginalArg(8) int arg7, @OriginalArg(9) int arg8) { + private boolean isOutsideRect(@OriginalArg(0) int arg0, @OriginalArg(1) int z1, @OriginalArg(2) int arg2, @OriginalArg(3) int destBlockedSides, @OriginalArg(5) int arg4, @OriginalArg(6) int arg5, @OriginalArg(7) int destZ, @OriginalArg(8) int arg7, @OriginalArg(9) int destLength) { @Pc(9) int local9 = arg5 + arg7; - @Pc(13) int local13 = arg6 + arg8; + @Pc(13) int destZ1 = destZ + destLength; @Pc(22) int local22 = arg2 + arg0; - @Pc(27) int local27 = arg1 + arg4; - @Pc(45) int local45; + @Pc(27) int local27 = z1 + arg4; + @Pc(45) int z0; @Pc(52) int local52; if (arg5 >= arg0 && arg5 < local22) { - if (local13 == arg1 && (arg3 & 0x4) == 0) { - local45 = arg5; + if (destZ1 == z1 && (destBlockedSides & 0x4) == 0) { + z0 = arg5; local52 = local22 >= local9 ? local9 : local22; - while (local52 > local45) { - if ((this.flags[local45 - this.anInt3912][local13 - this.anInt3907 - 1] & 0x2) == 0) { + while (local52 > z0) { + if ((this.flags[z0 - this.xOffset][destZ1 - this.zOffset - 1] & 0x2) == 0) { return true; } - local45++; + z0++; } - } else if (local27 == arg6 && (arg3 & 0x1) == 0) { - local45 = arg5; + } else if (local27 == destZ && (destBlockedSides & 0x1) == 0) { + z0 = arg5; local52 = local9 > local22 ? local22 : local9; - while (local52 > local45) { - if ((this.flags[local45 - this.anInt3912][arg6 - this.anInt3907] & 0x20) == 0) { + while (local52 > z0) { + if ((this.flags[z0 - this.xOffset][destZ - this.zOffset] & 0x20) == 0) { return true; } - local45++; + z0++; } } } else if (local9 > arg0 && local9 <= local22) { - if (arg1 == local13 && (arg3 & 0x4) == 0) { - for (local45 = arg0; local45 < local9; local45++) { - if ((this.flags[local45 - this.anInt3912][local13 - this.anInt3907 - 1] & 0x2) == 0) { + if (z1 == destZ1 && (destBlockedSides & 0x4) == 0) { + for (z0 = arg0; z0 < local9; z0++) { + if ((this.flags[z0 - this.xOffset][destZ1 - this.zOffset - 1] & 0x2) == 0) { return true; } } - } else if (arg6 == local27 && (arg3 & 0x1) == 0) { - for (local45 = arg0; local45 < local9; local45++) { - if ((this.flags[local45 - this.anInt3912][arg6 - this.anInt3907] & 0x20) == 0) { + } else if (destZ == local27 && (destBlockedSides & 0x1) == 0) { + for (z0 = arg0; z0 < local9; z0++) { + if ((this.flags[z0 - this.xOffset][destZ - this.zOffset] & 0x20) == 0) { return true; } } } - } else if (arg6 >= arg1 && local27 > arg6) { - if (local9 == arg0 && (arg3 & 0x8) == 0) { - local45 = arg6; - local52 = local27 >= local13 ? local13 : local27; - while (local45 < local52) { - if ((this.flags[local9 - this.anInt3912 - 1][local45 - this.anInt3907] & 0x8) == 0) { + } else if (destZ >= z1 && local27 > destZ) { + if (local9 == arg0 && (destBlockedSides & 0x8) == 0) { + z0 = destZ; + local52 = local27 >= destZ1 ? destZ1 : local27; + while (z0 < local52) { + if ((this.flags[local9 - this.xOffset - 1][z0 - this.zOffset] & 0x8) == 0) { return true; } - local45++; + z0++; } - } else if (arg5 == local22 && (arg3 & 0x2) == 0) { - local45 = arg6; - local52 = local27 < local13 ? local27 : local13; - while (local45 < local52) { - if ((this.flags[arg5 - this.anInt3912][local45 - this.anInt3907] & 0x80) == 0) { + } else if (arg5 == local22 && (destBlockedSides & 0x2) == 0) { + z0 = destZ; + local52 = local27 < destZ1 ? local27 : destZ1; + while (z0 < local52) { + if ((this.flags[arg5 - this.xOffset][z0 - this.zOffset] & 0x80) == 0) { return true; } - local45++; + z0++; } } - } else if (arg1 < local13 && local27 >= local13) { - if (local9 == arg0 && (arg3 & 0x8) == 0) { - for (local45 = arg1; local45 < local13; local45++) { - if ((this.flags[local9 - this.anInt3912 - 1][local45 - this.anInt3907] & 0x8) == 0) { + } else if (z1 < destZ1 && local27 >= destZ1) { + if (local9 == arg0 && (destBlockedSides & 0x8) == 0) { + for (z0 = z1; z0 < destZ1; z0++) { + if ((this.flags[local9 - this.xOffset - 1][z0 - this.zOffset] & 0x8) == 0) { return true; } } - } else if (local22 == arg5 && (arg3 & 0x2) == 0) { - for (local45 = arg1; local45 < local13; local45++) { - if ((this.flags[arg5 - this.anInt3912][local45 - this.anInt3907] & 0x80) == 0) { + } else if (local22 == arg5 && (destBlockedSides & 0x2) == 0) { + for (z0 = z1; z0 < destZ1; z0++) { + if ((this.flags[arg5 - this.xOffset][z0 - this.zOffset] & 0x80) == 0) { return true; } } @@ -762,9 +759,9 @@ public final class CollisionMap { @OriginalMember(owner = "client!mj", name = "a", descriptor = "(I)V") public final void clear() { - for (@Pc(3) int local3 = 0; local3 < this.anInt3899; local3++) { - for (@Pc(13) int local13 = 0; local13 < this.anInt3904; local13++) { - if (local3 == 0 || local13 == 0 || local3 >= this.anInt3899 - 5 || this.anInt3904 - 5 <= local13) { + for (@Pc(3) int local3 = 0; local3 < this.width; local3++) { + for (@Pc(13) int local13 = 0; local13 < this.length; local13++) { + if (local3 == 0 || local13 == 0 || local3 >= this.width - 5 || this.length - 5 <= local13) { this.flags[local3][local13] = 16777215; } else { this.flags[local3][local13] = 16777216; @@ -774,37 +771,38 @@ public final class CollisionMap { } @OriginalMember(owner = "client!mj", name = "a", descriptor = "(III)V") - public final void addRangeableFlag(@OriginalArg(0) int arg0, @OriginalArg(2) int arg1) { - @Pc(12) int local12 = arg0 - this.anInt3907; - @Pc(17) int local17 = arg1 - this.anInt3912; - this.flags[local17][local12] |= 0x200000; + public final void flagTile(@OriginalArg(0) int startZ, @OriginalArg(2) int startX) { + @Pc(12) int z = startZ - this.zOffset; + @Pc(17) int x = startX - this.xOffset; + this.flags[x][z] |= 0x200000; } @OriginalMember(owner = "client!mj", name = "a", descriptor = "(ZIIIIIIII)Z") - public final boolean isInsideOrOutsideRect(@OriginalArg(1) int arg0, @OriginalArg(2) int arg1, @OriginalArg(3) int arg2, @OriginalArg(4) int arg3, @OriginalArg(5) int arg4, @OriginalArg(6) int arg5, @OriginalArg(7) int arg6, @OriginalArg(8) int arg7) { - if (arg3 > 1) { - return this.method3041(arg3, arg4, arg0, arg7, arg1, arg6, arg3, arg2) ? true : this.method3048(arg0, arg6, arg4, arg5, arg7, arg2, arg1, arg3, arg3); + public final boolean isInsideOrOutsideRect(@OriginalArg(1) int destX, @OriginalArg(2) int z, @OriginalArg(3) int x, @OriginalArg(4) int size, @OriginalArg(5) int destWidth, @OriginalArg(6) int destBlockedSides, @OriginalArg(7) int destZ, @OriginalArg(8) int destLength) { + if (size > 1) { + return this.isInsideRect(size, destWidth, destX, destLength, z, destZ, size, x) || this.isOutsideRect(destX, destZ, destWidth, destBlockedSides, destLength, x, z, size, size); } - @Pc(41) int local41 = arg4 + arg0 - 1; - @Pc(47) int local47 = arg6 + arg7 - 1; - if (arg0 <= arg2 && local41 >= arg2 && arg6 <= arg1 && arg1 <= local47) { + + @Pc(41) int destX1 = destWidth + destX - 1; + @Pc(47) int destZ1 = destZ + destLength - 1; + if (destX <= x && destX1 >= x && destZ <= z && z <= destZ1) { return true; - } else if (arg0 - 1 == arg2 && arg1 >= arg6 && arg1 <= local47 && (this.flags[arg2 - this.anInt3912][arg1 - this.anInt3907] & 0x8) == 0 && (arg5 & 0x8) == 0) { + } else if (destX - 1 == x && z >= destZ && z <= destZ1 && (this.flags[x - this.xOffset][z - this.zOffset] & 0x8) == 0 && (destBlockedSides & 0x8) == 0) { return true; - } else if (arg2 == local41 + 1 && arg6 <= arg1 && local47 >= arg1 && (this.flags[arg2 - this.anInt3912][arg1 - this.anInt3907] & 0x80) == 0 && (arg5 & 0x2) == 0) { + } else if (x == destX1 + 1 && destZ <= z && destZ1 >= z && (this.flags[x - this.xOffset][z - this.zOffset] & 0x80) == 0 && (destBlockedSides & 0x2) == 0) { return true; - } else if (arg1 == arg6 - 1 && arg0 <= arg2 && local41 >= arg2 && (this.flags[arg2 - this.anInt3912][arg1 - this.anInt3907] & 0x2) == 0 && (arg5 & 0x4) == 0) { + } else if (z == destZ - 1 && destX <= x && destX1 >= x && (this.flags[x - this.xOffset][z - this.zOffset] & 0x2) == 0 && (destBlockedSides & 0x4) == 0) { return true; } else { - return arg1 == local47 + 1 && arg2 >= arg0 && local41 >= arg2 && (this.flags[arg2 - this.anInt3912][arg1 - this.anInt3907] & 0x20) == 0 && (arg5 & 0x1) == 0; + return z == destZ1 + 1 && x >= destX && destX1 >= x && (this.flags[x - this.xOffset][z - this.zOffset] & 0x20) == 0 && (destBlockedSides & 0x1) == 0; } } @OriginalMember(owner = "client!mj", name = "a", descriptor = "(IBI)V") - public final void method3053(@OriginalArg(0) int arg0, @OriginalArg(2) int arg1) { - @Pc(4) int local4 = arg1 - this.anInt3912; - @Pc(9) int local9 = arg0 - this.anInt3907; - this.flags[local4][local9] &= 0xFFFBFFFF; + public final void unflagGroundDecor(@OriginalArg(0) int startZ, @OriginalArg(2) int startX) { + @Pc(4) int x = startX - this.xOffset; + @Pc(9) int z = startZ - this.zOffset; + this.flags[x][z] &= 0xFFFBFFFF; } @OriginalMember(owner = "client!mj", name = "b", descriptor = "(IIIII)Z") @@ -812,13 +810,13 @@ public final class CollisionMap { if (arg3 == arg2 && arg0 == arg1) { return true; } - @Pc(22) int local22 = arg1 - this.anInt3907; - @Pc(33) int local33 = arg2 - this.anInt3912; - if (local33 < 0 || this.anInt3899 <= local33 || local22 < 0 || local22 >= this.anInt3904) { + @Pc(22) int local22 = arg1 - this.zOffset; + @Pc(33) int local33 = arg2 - this.xOffset; + if (local33 < 0 || this.width <= local33 || local22 < 0 || local22 >= this.length) { return false; } - @Pc(61) int local61 = arg0 - this.anInt3907; - @Pc(66) int local66 = arg3 - this.anInt3912; + @Pc(61) int local61 = arg0 - this.zOffset; + @Pc(66) int local66 = arg3 - this.xOffset; @Pc(77) int local77; if (local33 > local66) { local77 = local33 - local66; @@ -900,29 +898,29 @@ public final class CollisionMap { } @OriginalMember(owner = "client!mj", name = "a", descriptor = "(BIII)V") - private void method3055(@OriginalArg(1) int arg0, @OriginalArg(2) int arg1, @OriginalArg(3) int arg2) { - this.flags[arg1][arg0] &= ~arg2; + private void unflag(@OriginalArg(1) int z, @OriginalArg(2) int x, @OriginalArg(3) int flags) { + this.flags[x][z] &= ~flags; } @OriginalMember(owner = "client!mj", name = "a", descriptor = "(IIIZIII)V") - public final void unflagScenery(@OriginalArg(1) int arg0, @OriginalArg(2) int arg1, @OriginalArg(3) boolean arg2, @OriginalArg(4) int arg3, @OriginalArg(5) int arg4, @OriginalArg(6) int arg5) { - @Pc(6) int local6 = arg0 - this.anInt3912; - @Pc(11) int local11 = arg5 - this.anInt3907; - @Pc(13) int local13 = 256; - if (arg2) { - local13 = 131328; + public final void unflagScenery(@OriginalArg(1) int startX, @OriginalArg(2) int width, @OriginalArg(3) boolean blockProjectiles, @OriginalArg(4) int angle, @OriginalArg(5) int length, @OriginalArg(6) int startZ) { + @Pc(6) int x = startX - this.xOffset; + @Pc(11) int z = startZ - this.zOffset; + @Pc(13) int flags = 256; + if (blockProjectiles) { + flags = 131328; } - @Pc(40) int local40; - if (arg3 == 1 || arg3 == 3) { - local40 = arg1; - arg1 = arg4; - arg4 = local40; + @Pc(40) int temp; + if (angle == 1 || angle == 3) { + temp = width; + width = length; + length = temp; } - for (local40 = local6; local40 < local6 + arg1; local40++) { - if (local40 >= 0 && local40 < this.anInt3899) { - for (@Pc(61) int local61 = local11; local61 < arg4 + local11; local61++) { - if (local61 >= 0 && this.anInt3904 > local61) { - this.method3055(local61, local40, local13); + for (int x0 = x; x0 < x + width; x0++) { + if (x0 >= 0 && x0 < this.width) { + for (@Pc(61) int z0 = z; z0 < length + z; z0++) { + if (z0 >= 0 && this.length > z0) { + this.unflag(z0, x0, flags); } } } @@ -930,9 +928,9 @@ public final class CollisionMap { } @OriginalMember(owner = "client!mj", name = "b", descriptor = "(III)V") - public final void method3057(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1) { - @Pc(4) int local4 = arg1 - this.anInt3907; - @Pc(17) int local17 = arg0 - this.anInt3912; - this.flags[local17][local4] |= 0x40000; + public final void flagGroundDecor(@OriginalArg(0) int startX, @OriginalArg(1) int startZ) { + @Pc(4) int z = startZ - this.zOffset; + @Pc(17) int x = startX - this.xOffset; + this.flags[x][z] |= 0x40000; } } diff --git a/client/src/main/java/rt4/ColorUtils.java b/client/src/main/java/rt4/ColorUtils.java index 444c84f..f62ffe3 100644 --- a/client/src/main/java/rt4/ColorUtils.java +++ b/client/src/main/java/rt4/ColorUtils.java @@ -82,4 +82,40 @@ public class ColorUtils { Static251.aFloatArray28[2] = (float) (arg0 & 0xFF) / 255.0F * local74 * local11 * local7; return Static251.aFloatArray28; } + + @OriginalMember(owner = "client!gn", name = "a", descriptor = "(IZI)I") + public static int multiplyLightnessSafe(@OriginalArg(0) int arg0, @OriginalArg(2) int arg1) { + if (arg1 == -1) { + return 12345678; + } + arg0 = arg0 * (arg1 & 0x7F) >> 7; + if (arg0 < 2) { + arg0 = 2; + } else if (arg0 > 126) { + arg0 = 126; + } + return arg0 + (arg1 & 0xFF80); + } + + @OriginalMember(owner = "client!sj", name = "a", descriptor = "(BII)I") + public static int multiplyLightnessGrayscale(@OriginalArg(1) int arg0, @OriginalArg(2) int arg1) { + if (arg0 == -2) { + return 12345678; + } else if (arg0 == -1) { + if (arg1 < 2) { + arg1 = 2; + } else if (arg1 > 126) { + arg1 = 126; + } + return arg1; + } else { + arg1 = (arg0 & 0x7F) * arg1 >> 7; + if (arg1 < 2) { + arg1 = 2; + } else if (arg1 > 126) { + arg1 = 126; + } + return (arg0 & 0xFF80) + arg1; + } + } } diff --git a/client/src/main/java/rt4/GroundDecor.java b/client/src/main/java/rt4/GroundDecor.java index 96842d3..ae5b9b5 100644 --- a/client/src/main/java/rt4/GroundDecor.java +++ b/client/src/main/java/rt4/GroundDecor.java @@ -7,10 +7,10 @@ import org.openrs2.deob.annotation.OriginalMember; public final class GroundDecor { @OriginalMember(owner = "client!bm", name = "c", descriptor = "Lclient!th;") - public Entity primary; + public Entity entity; @OriginalMember(owner = "client!bm", name = "g", descriptor = "I") - public int anInt732; + public int xFine; @OriginalMember(owner = "client!bm", name = "i", descriptor = "I") public int anInt733; @@ -19,7 +19,7 @@ public final class GroundDecor { public long key; @OriginalMember(owner = "client!bm", name = "o", descriptor = "I") - public int anInt736; + public int zFine; @OriginalMember(owner = "client!bm", name = "n", descriptor = "Z") public boolean aBoolean49 = false; diff --git a/client/src/main/java/rt4/PathingEntity.java b/client/src/main/java/rt4/PathingEntity.java index bcdef34..ff26609 100644 --- a/client/src/main/java/rt4/PathingEntity.java +++ b/client/src/main/java/rt4/PathingEntity.java @@ -132,7 +132,7 @@ public abstract class PathingEntity extends Entity { public int anInt3385 = 0; @OriginalMember(owner = "client!fe", name = "pb", descriptor = "I") - public int anInt3390 = 0; + public int attachmentSetAt = 0; @OriginalMember(owner = "client!fe", name = "mb", descriptor = "[B") public final byte[] movementQueueSpeed = new byte[10]; @@ -162,7 +162,7 @@ public abstract class PathingEntity extends Entity { public int chatLoops = 100; @OriginalMember(owner = "client!fe", name = "V", descriptor = "I") - public int anInt3375 = 0; + public int attachmentResetAt = 0; @OriginalMember(owner = "client!fe", name = "Y", descriptor = "I") public int hitpointsBarVisibleUntil = -1000; diff --git a/client/src/main/java/rt4/Player.java b/client/src/main/java/rt4/Player.java index 276ef48..b7bf659 100644 --- a/client/src/main/java/rt4/Player.java +++ b/client/src/main/java/rt4/Player.java @@ -403,10 +403,10 @@ public final class Player extends PathingEntity { } @Pc(515) Model local515 = null; if (!this.aBoolean98 && this.attachment != null) { - if (client.loop >= this.anInt3375) { + if (client.loop >= this.attachmentResetAt) { this.attachment = null; } - if (this.anInt3390 <= client.loop && this.anInt3375 > client.loop) { + if (this.attachmentSetAt <= client.loop && this.attachmentResetAt > client.loop) { if (this.attachment instanceof Loc) { local515 = (Model) ((Loc) this.attachment).method1049(); } else { diff --git a/client/src/main/java/rt4/Protocol.java b/client/src/main/java/rt4/Protocol.java index ab10caa..61f70ee 100644 --- a/client/src/main/java/rt4/Protocol.java +++ b/client/src/main/java/rt4/Protocol.java @@ -164,7 +164,7 @@ public class Protocol { int local247 = inboundBuffer.g2(); int local633 = inboundBuffer.ig2badd(); if (!GlRenderer.enabled) { - SceneGraph.method2574(local625, local247, local633, local232, local39, local613, local19, local605, local31, local23, local609, local228); + AttachLocRequest.push(local625, local247, local633, local232, local39, local613, local19, local605, local31, local23, local609, local228); } } else if (opcode == ServerProt.LOCATION_PACKET_14) { int local15 = inboundBuffer.g1(); diff --git a/client/src/main/java/rt4/SceneGraph.java b/client/src/main/java/rt4/SceneGraph.java index e507676..7853a9b 100644 --- a/client/src/main/java/rt4/SceneGraph.java +++ b/client/src/main/java/rt4/SceneGraph.java @@ -27,21 +27,21 @@ public class SceneGraph { @OriginalMember(owner = "client!em", name = "t", descriptor = "[[[I") public static int[][][] anIntArrayArrayArray6; @OriginalMember(owner = "client!ka", name = "r", descriptor = "[I") - public static int[] anIntArray293; + public static int[] rowCount; @OriginalMember(owner = "client!lg", name = "k", descriptor = "I") public static int firstVisibleLevel = 99; @OriginalMember(owner = "client!ug", name = "d", descriptor = "[I") - public static int[] anIntArray479; + public static int[] rowChroma; @OriginalMember(owner = "client!l", name = "l", descriptor = "[I") - public static int[] anIntArray325; + public static int[] rowSaturation; @OriginalMember(owner = "client!s", name = "i", descriptor = "[I") - public static int[] anIntArray376; + public static int[] rowWeightedHue; @OriginalMember(owner = "client!jd", name = "d", descriptor = "[[[B") public static byte[][][] aByteArrayArrayArray9; @OriginalMember(owner = "client!wk", name = "v", descriptor = "[I") - public static int[] anIntArray568; + public static int[] rowLightness; @OriginalMember(owner = "client!ub", name = "h", descriptor = "[Lclient!pe;") - public static Class120[] aClass120Array2; + public static SceneGraph_Class120[] aClass120Array2; @OriginalMember(owner = "client!rh", name = "k", descriptor = "I") public static int anInt4870 = 0; @OriginalMember(owner = "client!bl", name = "T", descriptor = "I") @@ -55,7 +55,7 @@ public class SceneGraph { @OriginalMember(owner = "client!pk", name = "R", descriptor = "[[Lclient!hg;") public static GlTile[][] underWaterHdTiles; @OriginalMember(owner = "client!hc", name = "O", descriptor = "[Lclient!pe;") - public static Class120[] aClass120Array1; + public static SceneGraph_Class120[] aClass120Array1; @OriginalMember(owner = "client!ma", name = "i", descriptor = "I") public static int width; @OriginalMember(owner = "client!hk", name = "Y", descriptor = "I") @@ -71,7 +71,7 @@ public class SceneGraph { @OriginalMember(owner = "client!oj", name = "E", descriptor = "[[Lclient!hg;") public static GlTile[][] underwaterHdTiles; @OriginalMember(owner = "client!jm", name = "r", descriptor = "I") - public static int anInt3114; + public static int levels; @OriginalMember(owner = "client!sm", name = "e", descriptor = "[[[B") public static byte[][][] aByteArrayArrayArray13; @OriginalMember(owner = "client!wi", name = "db", descriptor = "I") @@ -88,6 +88,10 @@ public class SceneGraph { public static int currentChunkZ; @OriginalMember(owner = "client!ja", name = "q", descriptor = "I") public static int currentChunkX; + @OriginalMember(owner = "client!gm", name = "R", descriptor = "I") + public static int anInt2293 = (int) (Math.random() * 17.0D) - 8; + @OriginalMember(owner = "client!ok", name = "c", descriptor = "I") + public static int anInt4272 = (int) (Math.random() * 33.0D) - 16; @OriginalMember(owner = "client!km", name = "f", descriptor = "(I)Z") public static boolean allLevelsAreVisible() { @@ -172,27 +176,27 @@ public class SceneGraph { } @OriginalMember(owner = "client!vf", name = "a", descriptor = "(III)Lclient!jh;") - public static Wall getWall(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2) { - @Pc(7) Tile local7 = tiles[arg0][arg1][arg2]; - return local7 == null ? null : local7.wall; + public static Wall getWall(@OriginalArg(0) int level, @OriginalArg(1) int x, @OriginalArg(2) int z) { + @Pc(7) Tile tile = tiles[level][x][z]; + return tile == null ? null : tile.wall; } @OriginalMember(owner = "client!gj", name = "a", descriptor = "(III)Lclient!df;") - public static WallDecor getWallDecor(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2) { - @Pc(7) Tile local7 = tiles[arg0][arg1][arg2]; - return local7 == null ? null : local7.wallDecor; + public static WallDecor getWallDecor(@OriginalArg(0) int level, @OriginalArg(1) int x, @OriginalArg(2) int z) { + @Pc(7) Tile tile = tiles[level][x][z]; + return tile == null ? null : tile.wallDecor; } @OriginalMember(owner = "client!kf", name = "b", descriptor = "(III)Lclient!ec;") - public static Scenery getScenery(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2) { - @Pc(7) Tile local7 = tiles[arg0][arg1][arg2]; - if (local7 == null) { + public static Scenery getScenery(@OriginalArg(0) int level, @OriginalArg(1) int x, @OriginalArg(2) int z) { + @Pc(7) Tile tile = tiles[level][x][z]; + if (tile == null) { return null; } - for (@Pc(13) int local13 = 0; local13 < local7.sceneryLen; local13++) { - @Pc(22) Scenery local22 = local7.scenery[local13]; - if ((local22.key >> 29 & 0x3L) == 2L && local22.anInt1701 == arg1 && local22.anInt1696 == arg2) { - return local22; + for (@Pc(13) int i = 0; i < tile.sceneryLen; i++) { + @Pc(22) Scenery scenery = tile.scenery[i]; + if ((scenery.key >> 29 & 0x3L) == 2L && scenery.xMin == x && scenery.zMin == z) { + return scenery; } } return null; @@ -226,46 +230,46 @@ public class SceneGraph { } @OriginalMember(owner = "client!pl", name = "a", descriptor = "(ZI)V") - public static void method3535(@OriginalArg(0) boolean arg0) { - anIntArray376 = new int[104]; - anIntArray325 = new int[104]; + public static void load(@OriginalArg(0) boolean underwater) { + rowWeightedHue = new int[104]; + rowSaturation = new int[104]; firstVisibleLevel = 99; - anIntArray479 = new int[104]; + rowChroma = new int[104]; @Pc(14) byte plane; - if (arg0) { + if (underwater) { plane = 1; } else { plane = 4; } tileShapes = new byte[plane][104][104]; - anIntArray293 = new int[104]; + rowCount = new int[104]; anIntArrayArrayArray6 = new int[plane][105][105]; aByteArrayArrayArray9 = new byte[plane][105][105]; tileOverlays = new byte[plane][104][104]; - anIntArray568 = new int[104]; + rowLightness = new int[104]; tileAngles = new byte[plane][104][104]; tileUnderlays = new byte[plane][104][104]; } @OriginalMember(owner = "client!ib", name = "b", descriptor = "(I)V") - public static void method2255() { - anIntArray479 = null; + public static void unload() { + rowChroma = null; anIntArrayArrayArray6 = null; - anIntArray293 = null; + rowCount = null; tileShapes = null; tileAngles = null; aByteArrayArrayArray9 = null; tileOverlays = null; tileUnderlays = null; - anIntArray325 = null; - anIntArray376 = null; - anIntArray568 = null; + rowSaturation = null; + rowWeightedHue = null; + rowLightness = null; } @OriginalMember(owner = "client!um", name = "c", descriptor = "(III)Z") public static boolean method4394(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2) { for (@Pc(1) int local1 = 0; local1 < anInt4870; local1++) { - @Pc(8) Class120 local8 = aClass120Array2[local1]; + @Pc(8) SceneGraph_Class120 local8 = aClass120Array2[local1]; @Pc(17) int local17; @Pc(29) int local29; @Pc(39) int local39; @@ -332,14 +336,14 @@ public class SceneGraph { } @OriginalMember(owner = "client!bj", name = "a", descriptor = "(III)J") - public static long getGroundDecorKey(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2) { - @Pc(7) Tile local7 = tiles[arg0][arg1][arg2]; - return local7 == null || local7.groundDecor == null ? 0L : local7.groundDecor.key; + public static long getGroundDecorKey(@OriginalArg(0) int level, @OriginalArg(1) int x, @OriginalArg(2) int z) { + @Pc(7) Tile tile = tiles[level][x][z]; + return tile == null || tile.groundDecor == null ? 0L : tile.groundDecor.key; } @OriginalMember(owner = "client!wj", name = "a", descriptor = "(Z)V") - public static void setUnderwater(@OriginalArg(0) boolean arg0) { - if (arg0) { + public static void setUnderwater(@OriginalArg(0) boolean underwater) { + if (underwater) { tiles = underWaterGroundTiles; tileHeights = underwaterTileHeights; underwaterHdTiles = underWaterHdTiles; @@ -348,156 +352,138 @@ public class SceneGraph { tileHeights = surfaceTileHeights; underwaterHdTiles = surfaceHdTiles; } - anInt3114 = tiles.length; + levels = tiles.length; } @OriginalMember(owner = "client!wj", name = "a", descriptor = "(IIZLclient!wa;IIBII)V") - public static void readTile(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) boolean arg2, @OriginalArg(3) Buffer arg3, @OriginalArg(4) int arg4, @OriginalArg(5) int arg5, @OriginalArg(7) int arg6, @OriginalArg(8) int arg7) { - @Pc(32) int local32; - if (arg5 < 0 || arg5 >= 104 || arg4 < 0 || arg4 >= 104) { + public static void readTile(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) boolean arg2, @OriginalArg(3) Buffer buffer, @OriginalArg(4) int z, @OriginalArg(5) int x, @OriginalArg(7) int angle, @OriginalArg(8) int level) { + @Pc(32) int opcode; + if (x < 0 || x >= 104 || z < 0 || z >= 104) { while (true) { - local32 = arg3.g1(); - if (local32 == 0) { + opcode = buffer.g1(); + if (opcode == 0) { break; } - if (local32 == 1) { - arg3.g1(); + if (opcode == 1) { + buffer.g1(); break; } - if (local32 <= 49) { - arg3.g1(); + if (opcode <= 49) { + buffer.g1(); } } return; } if (!arg2) { - tileFlags[arg7][arg5][arg4] = 0; + tileFlags[level][x][z] = 0; } while (true) { - local32 = arg3.g1(); - if (local32 == 0) { + opcode = buffer.g1(); + if (opcode == 0) { if (arg2) { - tileHeights[0][arg5][arg4] = surfaceTileHeights[0][arg5][arg4]; - } else if (arg7 == 0) { - tileHeights[0][arg5][arg4] = -PerlinNoise.getTileHeight(arg4 + arg1 + 556238, arg0 + arg5 + 932731) * 8; + tileHeights[0][x][z] = surfaceTileHeights[0][x][z]; + } else if (level == 0) { + tileHeights[0][x][z] = -PerlinNoise.getTileHeight(z + arg1 + 556238, arg0 + x + 932731) * 8; } else { - tileHeights[arg7][arg5][arg4] = tileHeights[arg7 - 1][arg5][arg4] - 240; + tileHeights[level][x][z] = tileHeights[level - 1][x][z] - 240; } break; } - if (local32 == 1) { - @Pc(111) int local111 = arg3.g1(); + if (opcode == 1) { + @Pc(111) int height = buffer.g1(); if (arg2) { - tileHeights[0][arg5][arg4] = surfaceTileHeights[0][arg5][arg4] + local111 * 8; + tileHeights[0][x][z] = surfaceTileHeights[0][x][z] + height * 8; } else { - if (local111 == 1) { - local111 = 0; + if (height == 1) { + height = 0; } - if (arg7 == 0) { - tileHeights[0][arg5][arg4] = -local111 * 8; + if (level == 0) { + tileHeights[0][x][z] = -height * 8; } else { - tileHeights[arg7][arg5][arg4] = tileHeights[arg7 - 1][arg5][arg4] - local111 * 8; + tileHeights[level][x][z] = tileHeights[level - 1][x][z] - height * 8; } } break; } - if (local32 <= 49) { - tileOverlays[arg7][arg5][arg4] = arg3.g1b(); - tileShapes[arg7][arg5][arg4] = (byte) ((local32 - 2) / 4); - tileAngles[arg7][arg5][arg4] = (byte) (local32 + arg6 - 2 & 0x3); - } else if (local32 > 81) { - tileUnderlays[arg7][arg5][arg4] = (byte) (local32 - 81); + if (opcode <= 49) { + tileOverlays[level][x][z] = buffer.g1b(); + tileShapes[level][x][z] = (byte) ((opcode - 2) / 4); + tileAngles[level][x][z] = (byte) (opcode + angle - 2 & 0x3); + } else if (opcode > 81) { + tileUnderlays[level][x][z] = (byte) (opcode - 81); } else if (!arg2) { - tileFlags[arg7][arg5][arg4] = (byte) (local32 - 49); + tileFlags[level][x][z] = (byte) (opcode - 49); } } } @OriginalMember(owner = "client!hd", name = "a", descriptor = "(IIIIIIII)V") - public static void method1881(@OriginalArg(0) int arg0, @OriginalArg(2) int arg1, @OriginalArg(3) int arg2, @OriginalArg(4) int arg3, @OriginalArg(5) int arg4, @OriginalArg(6) int arg5, @OriginalArg(7) int arg6) { - if (arg5 < 0 || arg3 < 0 || arg5 >= 103 || arg3 >= 103) { + public static void method1881(@OriginalArg(0) int level, @OriginalArg(2) int arg1, @OriginalArg(3) int shape, @OriginalArg(4) int z, @OriginalArg(5) int layer, @OriginalArg(6) int x, @OriginalArg(7) int arg6) { + if (x < 0 || z < 0 || x >= 103 || z >= 103) { return; } - @Pc(38) int local38; - if (arg4 == 0) { - @Pc(28) Wall local28 = getWall(arg0, arg5, arg3); - if (local28 != null) { - local38 = Integer.MAX_VALUE & (int) (local28.key >>> 32); - if (arg2 == 2) { - local28.primary = new Loc(local38, 2, arg1 + 4, arg0, arg5, arg3, arg6, false, local28.primary); - local28.aClass8_6 = new Loc(local38, 2, arg1 + 1 & 0x3, arg0, arg5, arg3, arg6, false, local28.aClass8_6); + @Pc(38) int locId; + if (layer == 0) { + @Pc(28) Wall wall = getWall(level, x, z); + if (wall != null) { + locId = Integer.MAX_VALUE & (int) (wall.key >>> 32); + if (shape == 2) { + wall.primary = new Loc(locId, 2, arg1 + 4, level, x, z, arg6, false, wall.primary); + wall.secondary = new Loc(locId, 2, arg1 + 1 & 0x3, level, x, z, arg6, false, wall.secondary); } else { - local28.primary = new Loc(local38, arg2, arg1, arg0, arg5, arg3, arg6, false, local28.primary); + wall.primary = new Loc(locId, shape, arg1, level, x, z, arg6, false, wall.primary); } } } - if (arg4 == 1) { - @Pc(106) WallDecor local106 = getWallDecor(arg0, arg5, arg3); - if (local106 != null) { - local38 = (int) (local106.key >>> 32) & Integer.MAX_VALUE; - if (arg2 == 4 || arg2 == 5) { - local106.primary = new Loc(local38, 4, arg1, arg0, arg5, arg3, arg6, false, local106.primary); - } else if (arg2 == 6) { - local106.primary = new Loc(local38, 4, arg1 + 4, arg0, arg5, arg3, arg6, false, local106.primary); - } else if (arg2 == 7) { - local106.primary = new Loc(local38, 4, (arg1 + 2 & 0x3) + 4, arg0, arg5, arg3, arg6, false, local106.primary); - } else if (arg2 == 8) { - local106.primary = new Loc(local38, 4, arg1 + 4, arg0, arg5, arg3, arg6, false, local106.primary); - local106.aClass8_2 = new Loc(local38, 4, (arg1 + 2 & 0x3) + 4, arg0, arg5, arg3, arg6, false, local106.aClass8_2); + if (layer == 1) { + @Pc(106) WallDecor wallDecor = getWallDecor(level, x, z); + if (wallDecor != null) { + locId = (int) (wallDecor.key >>> 32) & Integer.MAX_VALUE; + if (shape == 4 || shape == 5) { + wallDecor.primary = new Loc(locId, 4, arg1, level, x, z, arg6, false, wallDecor.primary); + } else if (shape == 6) { + wallDecor.primary = new Loc(locId, 4, arg1 + 4, level, x, z, arg6, false, wallDecor.primary); + } else if (shape == 7) { + wallDecor.primary = new Loc(locId, 4, (arg1 + 2 & 0x3) + 4, level, x, z, arg6, false, wallDecor.primary); + } else if (shape == 8) { + wallDecor.primary = new Loc(locId, 4, arg1 + 4, level, x, z, arg6, false, wallDecor.primary); + wallDecor.secondary = new Loc(locId, 4, (arg1 + 2 & 0x3) + 4, level, x, z, arg6, false, wallDecor.secondary); } } } - if (arg4 == 2) { - if (arg2 == 11) { - arg2 = 10; + if (layer == 2) { + if (shape == 11) { + shape = 10; } - @Pc(255) Scenery local255 = getScenery(arg0, arg5, arg3); - if (local255 != null) { - local255.primary = new Loc((int) (local255.key >>> 32) & Integer.MAX_VALUE, arg2, arg1, arg0, arg5, arg3, arg6, false, local255.primary); + @Pc(255) Scenery scenery = getScenery(level, x, z); + if (scenery != null) { + scenery.entity = new Loc((int) (scenery.key >>> 32) & Integer.MAX_VALUE, shape, arg1, level, x, z, arg6, false, scenery.entity); } } - if (arg4 == 3) { - @Pc(290) GroundDecor local290 = getGroundDecor(arg0, arg5, arg3); - if (local290 != null) { - local290.primary = new Loc(Integer.MAX_VALUE & (int) (local290.key >>> 32), 22, arg1, arg0, arg5, arg3, arg6, false, local290.primary); + if (layer == 3) { + @Pc(290) GroundDecor groundDecor = getGroundDecor(level, x, z); + if (groundDecor != null) { + groundDecor.entity = new Loc(Integer.MAX_VALUE & (int) (groundDecor.key >>> 32), 22, arg1, level, x, z, arg6, false, groundDecor.entity); } } } @OriginalMember(owner = "client!nh", name = "a", descriptor = "(IIIILclient!th;JZ)V") - public static void setGroundDecor(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) Entity arg4, @OriginalArg(5) long arg5, @OriginalArg(6) boolean arg6) { - if (arg4 == null) { + public static void setGroundDecor(@OriginalArg(0) int level, @OriginalArg(1) int x, @OriginalArg(2) int z, @OriginalArg(3) int arg3, @OriginalArg(4) Entity entity, @OriginalArg(5) long key, @OriginalArg(6) boolean arg6) { + if (entity == null) { return; } - @Pc(6) GroundDecor local6 = new GroundDecor(); - local6.primary = arg4; - local6.anInt732 = arg1 * 128 + 64; - local6.anInt736 = arg2 * 128 + 64; - local6.anInt733 = arg3; - local6.key = arg5; - local6.aBoolean49 = arg6; - if (tiles[arg0][arg1][arg2] == null) { - tiles[arg0][arg1][arg2] = new Tile(arg0, arg1, arg2); + @Pc(6) GroundDecor groundDecor = new GroundDecor(); + groundDecor.entity = entity; + groundDecor.xFine = x * 128 + 64; + groundDecor.zFine = z * 128 + 64; + groundDecor.anInt733 = arg3; + groundDecor.key = key; + groundDecor.aBoolean49 = arg6; + if (tiles[level][x][z] == null) { + tiles[level][x][z] = new Tile(level, x, z); } - tiles[arg0][arg1][arg2].groundDecor = local6; - } - - @OriginalMember(owner = "client!nh", name = "a", descriptor = "(IIIIIIIIIIIII)V") - public static void method2574(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) int arg4, @OriginalArg(5) int arg5, @OriginalArg(6) int arg6, @OriginalArg(7) int arg7, @OriginalArg(8) int arg8, @OriginalArg(9) int arg9, @OriginalArg(11) int arg10, @OriginalArg(12) int arg11) { - @Pc(7) AttachLocRequest local7 = new AttachLocRequest(); - local7.angle = arg6; - local7.anInt1205 = arg3; - local7.anInt1187 = arg1; - local7.anInt1200 = arg5; - local7.entityId = arg2; - local7.x = arg8; - local7.anInt1197 = arg10; - local7.z = arg4; - local7.locId = arg11; - local7.anInt1188 = arg7; - local7.anInt1191 = arg0; - local7.shape = arg9; - AttachLocRequest.queue.addTail(local7); + tiles[level][x][z].groundDecor = groundDecor; } @OriginalMember(owner = "client!ia", name = "a", descriptor = "(IB)I") @@ -535,25 +521,25 @@ public class SceneGraph { } @OriginalMember(owner = "client!vf", name = "a", descriptor = "(IIIILclient!th;Lclient!th;IIJ)V") - public static void setWall(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) Entity arg4, @OriginalArg(5) Entity arg5, @OriginalArg(6) int arg6, @OriginalArg(7) int arg7, @OriginalArg(8) long arg8) { - if (arg4 == null && arg5 == null) { + public static void setWall(@OriginalArg(0) int level, @OriginalArg(1) int x, @OriginalArg(2) int z, @OriginalArg(3) int arg3, @OriginalArg(4) Entity primary, @OriginalArg(5) Entity secondary, @OriginalArg(6) int arg6, @OriginalArg(7) int arg7, @OriginalArg(8) long key) { + if (primary == null && secondary == null) { return; } - @Pc(8) Wall local8 = new Wall(); - local8.key = arg8; - local8.anInt3048 = arg1 * 128 + 64; - local8.anInt3044 = arg2 * 128 + 64; - local8.anInt3051 = arg3; - local8.primary = arg4; - local8.aClass8_6 = arg5; - local8.anInt3049 = arg6; - local8.anInt3052 = arg7; - for (@Pc(42) int local42 = arg0; local42 >= 0; local42--) { - if (tiles[local42][arg1][arg2] == null) { - tiles[local42][arg1][arg2] = new Tile(local42, arg1, arg2); + @Pc(8) Wall wall = new Wall(); + wall.key = key; + wall.xFine = x * 128 + 64; + wall.zFine = z * 128 + 64; + wall.anInt3051 = arg3; + wall.primary = primary; + wall.secondary = secondary; + wall.anInt3049 = arg6; + wall.anInt3052 = arg7; + for (@Pc(42) int level0 = level; level0 >= 0; level0--) { + if (tiles[level0][x][z] == null) { + tiles[level0][x][z] = new Tile(level0, x, z); } } - tiles[arg0][arg1][arg2].wall = local8; + tiles[level][x][z].wall = wall; } @OriginalMember(owner = "client!cd", name = "a", descriptor = "(IIIIZ)V") @@ -580,9 +566,9 @@ public class SceneGraph { underWaterHdTiles = null; } setUnderwater(false); - aClass120Array1 = new Class120[500]; + aClass120Array1 = new SceneGraph_Class120[500]; anInt917 = 0; - aClass120Array2 = new Class120[500]; + aClass120Array2 = new SceneGraph_Class120[500]; anInt4870 = 0; anIntArrayArrayArray12 = new int[4][width + 1][length + 1]; scenery = new Scenery[5000]; @@ -594,29 +580,638 @@ public class SceneGraph { } @OriginalMember(owner = "client!vj", name = "a", descriptor = "(III)J") - public static long getWallKey(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2) { - @Pc(7) Tile local7 = tiles[arg0][arg1][arg2]; - return local7 == null || local7.wall == null ? 0L : local7.wall.key; + public static long getWallKey(@OriginalArg(0) int level, @OriginalArg(1) int x, @OriginalArg(2) int z) { + @Pc(7) Tile tile = tiles[level][x][z]; + return tile == null || tile.wall == null ? 0L : tile.wall.key; } @OriginalMember(owner = "client!l", name = "a", descriptor = "(III)J") - public static long getWallDecorKey(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2) { - @Pc(7) Tile local7 = tiles[arg0][arg1][arg2]; - return local7 == null || local7.wallDecor == null ? 0L : local7.wallDecor.key; + public static long getWallDecorKey(@OriginalArg(0) int level, @OriginalArg(1) int x, @OriginalArg(2) int z) { + @Pc(7) Tile tile = tiles[level][x][z]; + return tile == null || tile.wallDecor == null ? 0L : tile.wallDecor.key; } @OriginalMember(owner = "client!cl", name = "a", descriptor = "(III)J") - public static long getSceneryKey(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2) { - @Pc(7) Tile local7 = tiles[arg0][arg1][arg2]; - if (local7 == null) { + public static long getSceneryKey(@OriginalArg(0) int level, @OriginalArg(1) int x, @OriginalArg(2) int z) { + @Pc(7) Tile tile = tiles[level][x][z]; + if (tile == null) { return 0L; } - for (@Pc(13) int local13 = 0; local13 < local7.sceneryLen; local13++) { - @Pc(22) Scenery local22 = local7.scenery[local13]; - if ((local22.key >> 29 & 0x3L) == 2L && local22.anInt1701 == arg1 && local22.anInt1696 == arg2) { - return local22.key; + for (@Pc(13) int i = 0; i < tile.sceneryLen; i++) { + @Pc(22) Scenery scenery = tile.scenery[i]; + if ((scenery.key >> 29 & 0x3L) == 2L && scenery.xMin == x && scenery.zMin == z) { + return scenery.key; } } return 0L; } + + @OriginalMember(owner = "client!g", name = "a", descriptor = "(III)Lclient!df;") + public static WallDecor removeWallDecor(@OriginalArg(0) int level, @OriginalArg(1) int x, @OriginalArg(2) int z) { + @Pc(7) Tile tile = tiles[level][x][z]; + if (tile == null) { + return null; + } else { + @Pc(14) WallDecor wallDecor = tile.wallDecor; + tile.wallDecor = null; + return wallDecor; + } + } + + @OriginalMember(owner = "client!dk", name = "a", descriptor = "(III)Lclient!ec;") + public static Scenery removeScenery(@OriginalArg(0) int level, @OriginalArg(1) int x, @OriginalArg(2) int z) { + @Pc(7) Tile tile = tiles[level][x][z]; + if (tile == null) { + return null; + } + for (@Pc(13) int i = 0; i < tile.sceneryLen; i++) { + @Pc(22) Scenery scenery = tile.scenery[i]; + if ((scenery.key >> 29 & 0x3L) == 2L && scenery.xMin == x && scenery.zMin == z) { + removeScenery(scenery); + return scenery; + } + } + return null; + } + + @OriginalMember(owner = "client!vl", name = "a", descriptor = "(III)Lclient!bm;") + public static GroundDecor removeGroundDecor(@OriginalArg(0) int level, @OriginalArg(1) int x, @OriginalArg(2) int z) { + @Pc(7) Tile tile = tiles[level][x][z]; + if (tile == null) { + return null; + } else { + @Pc(14) GroundDecor groundDecor = tile.groundDecor; + tile.groundDecor = null; + return groundDecor; + } + } + + @OriginalMember(owner = "client!vk", name = "a", descriptor = "(Lclient!ec;)V") + public static void removeScenery(@OriginalArg(0) Scenery scenery) { + for (@Pc(2) int x = scenery.xMin; x <= scenery.xMax; x++) { + for (@Pc(9) int z = scenery.zMin; z <= scenery.zMax; z++) { + @Pc(22) Tile tile = tiles[scenery.level][x][z]; + if (tile != null) { + @Pc(26) int i; + for (i = 0; i < tile.sceneryLen; i++) { + if (tile.scenery[i] == scenery) { + tile.sceneryLen--; + for (@Pc(44) int j = i; j < tile.sceneryLen; j++) { + tile.scenery[j] = tile.scenery[j + 1]; + tile.interiorFlags[j] = tile.interiorFlags[j + 1]; + } + tile.scenery[tile.sceneryLen] = null; + break; + } + } + tile.allInteriorFlags = 0; + for (i = 0; i < tile.sceneryLen; i++) { + tile.allInteriorFlags |= tile.interiorFlags[i]; + } + } + } + } + } + + @OriginalMember(owner = "client!di", name = "a", descriptor = "([Lclient!mj;ZI)V") + public static void method1169(@OriginalArg(0) CollisionMap[] collisionMaps, @OriginalArg(1) boolean underwater) { + @Pc(10) int level; + @Pc(15) int x; + if (!underwater) { + for (level = 0; level < 4; level++) { + for (x = 0; x < 104; x++) { + for (@Pc(22) int z = 0; z < 104; z++) { + if ((tileFlags[level][x][z] & 0x1) == 1) { + @Pc(43) int transformedLevel = level; + if ((tileFlags[1][x][z] & 0x2) == 2) { + transformedLevel = level - 1; + } + if (transformedLevel >= 0) { + collisionMaps[transformedLevel].flagTile(z, x); + } + } + } + } + } + anInt4272 += (int) (Math.random() * 5.0D) - 2; + if (anInt4272 < -16) { + anInt4272 = -16; + } + if (anInt4272 > 16) { + anInt4272 = 16; + } + anInt2293 += (int) (Math.random() * 5.0D) - 2; + if (anInt2293 < -8) { + anInt2293 = -8; + } + if (anInt2293 > 8) { + anInt2293 = 8; + } + } + @Pc(128) byte levels; + if (underwater) { + levels = 1; + } else { + levels = 4; + } + level = anInt2293 >> 2 << 10; + @Pc(142) int[][] local142 = new int[104][104]; + @Pc(146) int[][] local146 = new int[104][104]; + x = anInt4272 >> 1; + @Pc(152) int local152; + @Pc(168) int local168; + @Pc(173) int local173; + @Pc(178) int local178; + @Pc(194) int overlay; + @Pc(200) int local200; + @Pc(202) int local202; + @Pc(209) int local209; + @Pc(349) int local349; + @Pc(234) int local234; + @Pc(254) int local254; + @Pc(267) int local267; + for (local152 = 0; local152 < levels; local152++) { + @Pc(159) byte[][] local159 = aByteArrayArrayArray9[local152]; + @Pc(273) int local273; + @Pc(326) int local326; + @Pc(332) int local332; + @Pc(322) int local322; + if (!GlRenderer.enabled) { + local168 = (int) Math.sqrt(5100.0D); + local173 = local168 * 768 >> 8; + for (local178 = 1; local178 < 103; local178++) { + for (overlay = 1; overlay < 103; overlay++) { + local209 = tileHeights[local152][overlay][local178 + 1] - tileHeights[local152][overlay][local178 - 1]; + local202 = tileHeights[local152][overlay + 1][local178] - tileHeights[local152][overlay - 1][local178]; + local349 = (int) Math.sqrt((double) (local202 * local202 + local209 * local209 + 65536)); + local267 = (local209 << 8) / local349; + local254 = -65536 / local349; + local234 = (local202 << 8) / local349; + local273 = (local159[overlay][local178] >> 1) + (local159[overlay][local178 - 1] >> 2) + (local159[overlay - -1][local178] >> 3) + (local159[overlay - 1][local178] >> 2) + (local159[overlay][local178 + 1] >> 3); + local200 = (local267 * -50 + local234 * -50 + local254 * -10) / local173 + 74; + local146[overlay][local178] = local200 - local273; + } + } + } else if (Preferences.highDetailLighting) { + for (local168 = 1; local168 < 103; local168++) { + for (local173 = 1; local173 < 103; local173++) { + overlay = (local159[local173 + 1][local168] >> 3) + (local159[local173 - 1][local168] >> 2) + (local159[local173][local168 + -1] >> 2) + (local159[local173][local168 + 1] >> 3) + (local159[local173][local168] >> 1); + local146[local173][local168] = 74 - overlay; + } + } + } else { + local168 = (int) FogManager.aFloatArray18[0]; + local173 = (int) FogManager.aFloatArray18[1]; + local178 = (int) FogManager.aFloatArray18[2]; + overlay = (int) Math.sqrt((double) (local173 * local173 + local168 * local168 + local178 * local178)); + local200 = overlay * 1024 >> 8; + for (local202 = 1; local202 < 103; local202++) { + for (local209 = 1; local209 < 103; local209++) { + local234 = tileHeights[local152][local209 + 1][local202] - tileHeights[local152][local209 - 1][local202]; + local254 = tileHeights[local152][local209][local202 + 1] - tileHeights[local152][local209][local202 - 1]; + local267 = (int) Math.sqrt((double) (local234 * local234 + local254 * local254 + 65536)); + local273 = (local234 << 8) / local267; + local322 = (local159[local209][local202 + 1] >> 3) + (local159[local209][local202 - 1] >> 2) + (local159[local209 - 1][local202] >> 2) + (local159[local209 + 1][local202] >> 3) + (local159[local209][local202] >> 1); + local326 = -65536 / local267; + local332 = (local254 << 8) / local267; + local349 = (local178 * local332 + local168 * local273 + local326 * local173) / local200 + 96; + local146[local209][local202] = local349 - (int) ((float) local322 * 1.7F); + } + } + } + for (local168 = 0; local168 < 104; local168++) { + rowWeightedHue[local168] = 0; + rowSaturation[local168] = 0; + rowLightness[local168] = 0; + rowChroma[local168] = 0; + rowCount[local168] = 0; + } + for (local168 = -5; local168 < 104; local168++) { + for (local173 = 0; local173 < 104; local173++) { + local178 = local168 + 5; + @Pc(729) int local729; + if (local178 < 104) { + overlay = tileUnderlays[local152][local178][local173] & 0xFF; + if (overlay > 0) { + @Pc(693) FluType type = FluTypeList.get(overlay - 1); + rowWeightedHue[local173] += type.weightedHue; + rowSaturation[local173] += type.saturation; + rowLightness[local173] += type.lightness; + rowChroma[local173] += type.chroma; + local729 = rowCount[local173]++; + } + } + overlay = local168 - 5; + if (overlay >= 0) { + local200 = tileUnderlays[local152][overlay][local173] & 0xFF; + if (local200 > 0) { + @Pc(758) FluType local758 = FluTypeList.get(local200 - 1); + rowWeightedHue[local173] -= local758.weightedHue; + rowSaturation[local173] -= local758.saturation; + rowLightness[local173] -= local758.lightness; + rowChroma[local173] -= local758.chroma; + local729 = rowCount[local173]--; + } + } + } + if (local168 >= 0) { + local173 = 0; + overlay = 0; + local178 = 0; + local200 = 0; + local202 = 0; + for (local209 = -5; local209 < 104; local209++) { + local349 = local209 + 5; + if (local349 < 104) { + local178 += rowSaturation[local349]; + local202 += rowCount[local349]; + local173 += rowWeightedHue[local349]; + local200 += rowChroma[local349]; + overlay += rowLightness[local349]; + } + local234 = local209 - 5; + if (local234 >= 0) { + local178 -= rowSaturation[local234]; + local200 -= rowChroma[local234]; + local173 -= rowWeightedHue[local234]; + local202 -= rowCount[local234]; + overlay -= rowLightness[local234]; + } + if (local209 >= 0 && local202 > 0) { + local142[local168][local209] = Static54.method1309(overlay / local202, local178 / local202, local173 * 256 / local200); + } + } + } + } + for (local168 = 1; local168 < 103; local168++) { + label771: for (local173 = 1; local173 < 103; local173++) { + if (underwater || allLevelsAreVisible() || (tileFlags[0][local168][local173] & 0x2) != 0 || (tileFlags[local152][local168][local173] & 0x10) == 0 && Static4.method22(local173, local168, local152) == LoginManager.centralPlane) { + if (firstVisibleLevel > local152) { + firstVisibleLevel = local152; + } + local178 = tileUnderlays[local152][local168][local173] & 0xFF; + overlay = tileOverlays[local152][local168][local173] & 0xFF; + if (local178 > 0 || overlay > 0) { + local202 = tileHeights[local152][local168 + 1][local173]; + local200 = tileHeights[local152][local168][local173]; + local349 = tileHeights[local152][local168][local173 + 1]; + local209 = tileHeights[local152][local168 + 1][local173 + 1]; + if (local152 > 0) { + @Pc(1067) boolean local1067 = true; + if (local178 == 0 && tileShapes[local152][local168][local173] != 0) { + local1067 = false; + } + if (overlay > 0 && !FloTypeList.method4395(overlay - 1).aBoolean312) { + local1067 = false; + } + if (local1067 && local200 == local202 && local200 == local209 && local349 == local200) { + anIntArrayArrayArray6[local152][local168][local173] |= 0x4; + } + } + if (local178 <= 0) { + local234 = -1; + local254 = 0; + } else { + local234 = local142[local168][local173]; + local267 = (local234 & 0x7F) + x; + if (local267 < 0) { + local267 = 0; + } else if (local267 > 127) { + local267 = 127; + } + local273 = (local234 & 0x380) + (local234 + level & 0xFC00) + local267; + local254 = Rasteriser.palette[ColorUtils.multiplyLightnessSafe(96, local273)]; + } + local267 = local146[local168][local173]; + local332 = local146[local168][local173 + 1]; + local273 = local146[local168 + 1][local173]; + local326 = local146[local168 + 1][local173 + 1]; + if (overlay == 0) { + setTile(local152, local168, local173, 0, 0, -1, local200, local202, local209, local349, ColorUtils.multiplyLightnessSafe(local267, local234), ColorUtils.multiplyLightnessSafe(local273, local234), ColorUtils.multiplyLightnessSafe(local326, local234), ColorUtils.multiplyLightnessSafe(local332, local234), 0, 0, 0, 0, local254, 0); + if (GlRenderer.enabled && local152 > 0 && local234 != -1 && FluTypeList.get(local178 - 1).aBoolean198) { + Static242.method4197(0, 0, true, false, local168, local173, local200 - tileHeights[0][local168][local173], -tileHeights[0][local168 + 1][local173] + local202, local209 - tileHeights[0][local168 + 1][local173 + 1], local349 - tileHeights[0][local168][local173 + 1]); + } + if (GlRenderer.enabled && !underwater && anIntArrayArray11 != null && local152 == 0) { + for (local322 = local168 - 1; local322 <= local168 + 1; local322++) { + for (@Pc(1794) int local1794 = local173 - 1; local1794 <= local173 + 1; local1794++) { + if ((local322 != local168 || local173 != local1794) && local322 >= 0 && local322 < 104 && local1794 >= 0 && local1794 < 104) { + @Pc(1834) int local1834 = tileOverlays[local152][local322][local1794] & 0xFF; + if (local1834 != 0) { + @Pc(1842) FloType local1842 = FloTypeList.method4395(local1834 - 1); + if (local1842.texture != -1 && Rasteriser.textureProvider.getMaterialType(local1842.texture) == MaterialManager.WATER) { + anIntArrayArray11[local168][local173] = local1842.anInt5889 + (local1842.anInt5898 << 24); + continue label771; + } + } + } + } + } + } + } else { + local322 = tileShapes[local152][local168][local173] + 1; + @Pc(1242) byte local1242 = tileAngles[local152][local168][local173]; + @Pc(1248) FloType local1248 = FloTypeList.method4395(overlay - 1); + @Pc(1301) int local1301; + @Pc(1353) int local1353; + @Pc(1288) int texture; + if (GlRenderer.enabled && !underwater && anIntArrayArray11 != null && local152 == 0) { + if (local1248.texture != -1 && Rasteriser.textureProvider.getMaterialType(local1248.texture) == MaterialManager.WATER) { + anIntArrayArray11[local168][local173] = (local1248.anInt5898 << 24) + local1248.anInt5889; + } else { + label737: for (texture = local168 - 1; texture <= local168 + 1; texture++) { + for (local1301 = local173 - 1; local1301 <= local173 + 1; local1301++) { + if ((local168 != texture || local1301 != local173) && texture >= 0 && texture < 104 && local1301 >= 0 && local1301 < 104) { + local1353 = tileOverlays[local152][texture][local1301] & 0xFF; + if (local1353 != 0) { + @Pc(1366) FloType local1366 = FloTypeList.method4395(local1353 - 1); + if (local1366.texture != -1 && Rasteriser.textureProvider.getMaterialType(local1366.texture) == MaterialManager.WATER) { + anIntArrayArray11[local168][local173] = local1366.anInt5889 + (local1366.anInt5898 << 24); + break label737; + } + } + } + } + } + } + } + texture = local1248.texture; + if (texture >= 0 && !Rasteriser.textureProvider.method3236(texture)) { + texture = -1; + } + @Pc(1458) int local1458; + @Pc(1429) int local1429; + if (texture >= 0) { + local1301 = -1; + local1353 = Rasteriser.palette[ColorUtils.multiplyLightnessGrayscale(Rasteriser.textureProvider.getAverageColor(texture), 96)]; + } else if (local1248.anInt5899 == -1) { + local1301 = -2; + local1353 = 0; + } else { + local1301 = local1248.anInt5899; + local1429 = x + (local1301 & 0x7F); + if (local1429 < 0) { + local1429 = 0; + } else if (local1429 > 127) { + local1429 = 127; + } + local1458 = (local1301 & 0x380) + ((local1301 + level & 0xFC00) + local1429); + local1353 = Rasteriser.palette[ColorUtils.multiplyLightnessGrayscale(local1458, 96)]; + } + if (local1248.anInt5894 >= 0) { + local1429 = local1248.anInt5894; + local1458 = x + (local1429 & 0x7F); + if (local1458 < 0) { + local1458 = 0; + } else if (local1458 > 127) { + local1458 = 127; + } + @Pc(1529) int local1529 = (local1429 & 0x380) + ((local1429 + level & 0xFC00) + local1458); + local1353 = Rasteriser.palette[ColorUtils.multiplyLightnessGrayscale(local1529, 96)]; + } + setTile(local152, local168, local173, local322, local1242, texture, local200, local202, local209, local349, ColorUtils.multiplyLightnessSafe(local267, local234), ColorUtils.multiplyLightnessSafe(local273, local234), ColorUtils.multiplyLightnessSafe(local326, local234), ColorUtils.multiplyLightnessSafe(local332, local234), ColorUtils.multiplyLightnessGrayscale(local1301, local267), ColorUtils.multiplyLightnessGrayscale(local1301, local273), ColorUtils.multiplyLightnessGrayscale(local1301, local326), ColorUtils.multiplyLightnessGrayscale(local1301, local332), local254, local1353); + if (GlRenderer.enabled && local152 > 0) { + Static242.method4197(local322, local1242, local1301 == -2 || !local1248.aBoolean311, local234 == -1 || !FluTypeList.get(local178 - 1).aBoolean198, local168, local173, local200 - tileHeights[0][local168][local173], local202 - tileHeights[0][local168 + 1][local173], local209 - tileHeights[0][local168 + 1][local173 + 1], -tileHeights[0][local168][local173 + 1] + local349); + } + } + } + } + } + } + if (GlRenderer.enabled) { + @Pc(1888) float[][] local1888 = new float[105][105]; + @Pc(1892) int[][] local1892 = tileHeights[local152]; + @Pc(1896) float[][] local1896 = new float[105][105]; + @Pc(1900) float[][] local1900 = new float[105][105]; + local200 = 1; + while (true) { + if (local200 > 103) { + @Pc(2025) GlTile[] local2025; + if (underwater) { + local2025 = Static193.method3501(tileFlags, tileShapes[local152], tileUnderlays[local152], local146, local1896, anIntArrayArray11, tileOverlays[local152], tileAngles[local152], local1888, local152, local1900, local142, tileHeights[local152], surfaceTileHeights[0]); + method2280(local152, local2025); + break; + } + local2025 = Static193.method3501(tileFlags, tileShapes[local152], tileUnderlays[local152], local146, local1896, null, tileOverlays[local152], tileAngles[local152], local1888, local152, local1900, local142, tileHeights[local152], null); + @Pc(2049) GlTile[] local2049 = Static1.method2(local1896, local1888, tileHeights[local152], local152, local1900, tileAngles[local152], local146, tileShapes[local152], tileUnderlays[local152], tileOverlays[local152], tileFlags); + @Pc(2057) GlTile[] local2057 = new GlTile[local2025.length + local2049.length]; + for (local349 = 0; local349 < local2025.length; local349++) { + local2057[local349] = local2025[local349]; + } + for (local349 = 0; local349 < local2049.length; local349++) { + local2057[local2025.length + local349] = local2049[local349]; + } + method2280(local152, local2057); + Static221.method3393(local1900, tileUnderlays[local152], tileAngles[local152], LightingManager.lights, local152, LightingManager.lightCount, local1896, tileShapes[local152], tileOverlays[local152], tileHeights[local152], local1888); + break; + } + for (local202 = 1; local202 <= 103; local202++) { + local349 = local1892[local202][local200 + 1] - local1892[local202][local200 - 1]; + local209 = local1892[local202 + 1][local200] - local1892[local202 - 1][local200]; + @Pc(1962) float local1962 = (float) Math.sqrt((double) (local209 * local209 + local349 * local349 + 65536)); + local1888[local202][local200] = (float) local209 / local1962; + local1896[local202][local200] = -256.0F / local1962; + local1900[local202][local200] = (float) local349 / local1962; + } + local200++; + } + } + tileUnderlays[local152] = null; + tileOverlays[local152] = null; + tileShapes[local152] = null; + tileAngles[local152] = null; + aByteArrayArrayArray9[local152] = null; + } + method3801(); + if (underwater) { + return; + } + @Pc(2204) int local2204; + for (local152 = 0; local152 < 104; local152++) { + for (local2204 = 0; local2204 < 104; local2204++) { + if ((tileFlags[1][local152][local2204] & 0x2) == 2) { + Static224.method3884(local152, local2204); + } + } + } + for (local152 = 0; local152 < 4; local152++) { + for (local2204 = 0; local2204 <= 104; local2204++) { + for (local168 = 0; local168 <= 104; local168++) { + if ((anIntArrayArrayArray6[local152][local168][local2204] & 0x1) != 0) { + local200 = local152; + for (local173 = local2204; local173 > 0 && (anIntArrayArrayArray6[local152][local168][local173 - 1] & 0x1) != 0; local173--) { + } + overlay = local152; + for (local178 = local2204; local178 < 104 && (anIntArrayArrayArray6[local152][local168][local178 + 1] & 0x1) != 0; local178++) { + } + label454: while (overlay > 0) { + for (local202 = local173; local202 <= local178; local202++) { + if ((anIntArrayArrayArray6[overlay - 1][local168][local202] & 0x1) == 0) { + break label454; + } + } + overlay--; + } + label443: while (local200 < 3) { + for (local202 = local173; local202 <= local178; local202++) { + if ((anIntArrayArrayArray6[local200 + 1][local168][local202] & 0x1) == 0) { + break label443; + } + } + local200++; + } + local202 = (local200 + 1 - overlay) * (-local173 + (local178 - -1)); + if (local202 >= 8) { + local349 = tileHeights[local200][local168][local173] - 240; + local234 = tileHeights[overlay][local168][local173]; + SceneGraph_Class120.method4647(1, local168 * 128, local168 * 128, local173 * 128, local178 * 128 + 128, local349, local234); + for (local254 = overlay; local254 <= local200; local254++) { + for (local267 = local173; local267 <= local178; local267++) { + anIntArrayArrayArray6[local254][local168][local267] &= 0xFFFFFFFE; + } + } + } + } + if ((anIntArrayArrayArray6[local152][local168][local2204] & 0x2) != 0) { + for (local173 = local168; local173 > 0 && (anIntArrayArrayArray6[local152][local173 - 1][local2204] & 0x2) != 0; local173--) { + } + local200 = local152; + overlay = local152; + for (local178 = local168; local178 < 104 && (anIntArrayArrayArray6[local152][local178 + 1][local2204] & 0x2) != 0; local178++) { + } + label508: while (overlay > 0) { + for (local202 = local173; local202 <= local178; local202++) { + if ((anIntArrayArrayArray6[overlay - 1][local202][local2204] & 0x2) == 0) { + break label508; + } + } + overlay--; + } + label497: while (local200 < 3) { + for (local202 = local173; local202 <= local178; local202++) { + if ((anIntArrayArrayArray6[local200 + 1][local202][local2204] & 0x2) == 0) { + break label497; + } + } + local200++; + } + local202 = (local178 + 1 - local173) * (-overlay + local200 - -1); + if (local202 >= 8) { + local349 = tileHeights[local200][local173][local2204] - 240; + local234 = tileHeights[overlay][local173][local2204]; + SceneGraph_Class120.method4647(2, local173 * 128, local178 * 128 + 128, local2204 * 128, local2204 * 128, local349, local234); + for (local254 = overlay; local254 <= local200; local254++) { + for (local267 = local173; local267 <= local178; local267++) { + anIntArrayArrayArray6[local254][local267][local2204] &= 0xFFFFFFFD; + } + } + } + } + if ((anIntArrayArrayArray6[local152][local168][local2204] & 0x4) != 0) { + local173 = local168; + local178 = local168; + for (overlay = local2204; overlay > 0 && (anIntArrayArrayArray6[local152][local168][overlay - 1] & 0x4) != 0; overlay--) { + } + for (local200 = local2204; local200 < 104 && (anIntArrayArrayArray6[local152][local168][local200 + 1] & 0x4) != 0; local200++) { + } + label562: while (local173 > 0) { + for (local202 = overlay; local202 <= local200; local202++) { + if ((anIntArrayArrayArray6[local152][local173 - 1][local202] & 0x4) == 0) { + break label562; + } + } + local173--; + } + label551: while (local178 < 104) { + for (local202 = overlay; local202 <= local200; local202++) { + if ((anIntArrayArrayArray6[local152][local178 + 1][local202] & 0x4) == 0) { + break label551; + } + } + local178++; + } + if ((local178 + 1 - local173) * (local200 - (overlay - 1)) >= 4) { + local202 = tileHeights[local152][local173][overlay]; + SceneGraph_Class120.method4647(4, local173 * 128, local178 * 128 + 128, overlay * 128, local200 * 128 + 128, local202, local202); + for (local209 = local173; local209 <= local178; local209++) { + for (local349 = overlay; local349 <= local200; local349++) { + anIntArrayArrayArray6[local152][local209][local349] &= 0xFFFFFFFB; + } + } + } + } + } + } + } + } + + @OriginalMember(owner = "client!ih", name = "a", descriptor = "(I[Lclient!hg;)V") + public static void method2280(@OriginalArg(0) int arg0, @OriginalArg(1) GlTile[] arg1) { + underwaterHdTiles[arg0] = arg1; + } + + @OriginalMember(owner = "client!ob", name = "a", descriptor = "(IIIIIIIIIIIIIIIIIIII)V") + public static void setTile(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) int arg4, @OriginalArg(5) int arg5, @OriginalArg(6) int arg6, @OriginalArg(7) int arg7, @OriginalArg(8) int arg8, @OriginalArg(9) int arg9, @OriginalArg(10) int arg10, @OriginalArg(11) int arg11, @OriginalArg(12) int arg12, @OriginalArg(13) int arg13, @OriginalArg(14) int arg14, @OriginalArg(15) int arg15, @OriginalArg(16) int arg16, @OriginalArg(17) int arg17, @OriginalArg(18) int arg18, @OriginalArg(19) int arg19) { + @Pc(12) PlainTile local12; + @Pc(14) int local14; + if (arg3 == 0) { + local12 = new PlainTile(arg10, arg11, arg12, arg13, -1, arg18, false); + for (local14 = arg0; local14 >= 0; local14--) { + if (tiles[local14][arg1][arg2] == null) { + tiles[local14][arg1][arg2] = new Tile(local14, arg1, arg2); + } + } + tiles[arg0][arg1][arg2].plainTile = local12; + } else if (arg3 == 1) { + local12 = new PlainTile(arg14, arg15, arg16, arg17, arg5, arg19, arg6 == arg7 && arg6 == arg8 && arg6 == arg9); + for (local14 = arg0; local14 >= 0; local14--) { + if (tiles[local14][arg1][arg2] == null) { + tiles[local14][arg1][arg2] = new Tile(local14, arg1, arg2); + } + } + tiles[arg0][arg1][arg2].plainTile = local12; + } else { + @Pc(134) ShapedTile local134 = new ShapedTile(arg3, arg4, arg5, arg1, arg2, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19); + for (local14 = arg0; local14 >= 0; local14--) { + if (tiles[local14][arg1][arg2] == null) { + tiles[local14][arg1][arg2] = new Tile(local14, arg1, arg2); + } + } + tiles[arg0][arg1][arg2].shapedTile = local134; + } + } + + @OriginalMember(owner = "client!rm", name = "a", descriptor = "(III)V") + public static void method3801() { + for (@Pc(1) int level = 0; level < levels; level++) { + for (@Pc(6) int x = 0; x < width; x++) { + for (@Pc(11) int z = 0; z < length; z++) { + @Pc(22) Tile local22 = tiles[level][x][z]; + if (local22 != null) { + @Pc(27) Wall local27 = local22.wall; + if (local27 != null && local27.primary.method4543()) { + Static69.method1544(local27.primary, level, x, z, 1, 1); + if (local27.secondary != null && local27.secondary.method4543()) { + Static69.method1544(local27.secondary, level, x, z, 1, 1); + local27.primary.method4544(local27.secondary, 0, 0, 0, false); + local27.secondary = local27.secondary.createModel(); + } + local27.primary = local27.primary.createModel(); + } + for (@Pc(83) int local83 = 0; local83 < local22.sceneryLen; local83++) { + @Pc(92) Scenery local92 = local22.scenery[local83]; + if (local92 != null && local92.entity.method4543()) { + Static69.method1544(local92.entity, level, x, z, local92.xMax + 1 - local92.xMin, local92.zMax - local92.zMin + 1); + local92.entity = local92.entity.createModel(); + } + } + @Pc(131) GroundDecor local131 = local22.groundDecor; + if (local131 != null && local131.entity.method4543()) { + Static264.method3574(local131.entity, level, x, z); + local131.entity = local131.entity.createModel(); + } + } + } + } + } + } } diff --git a/client/src/main/java/rt4/Class120.java b/client/src/main/java/rt4/SceneGraph_Class120.java similarity index 67% rename from client/src/main/java/rt4/Class120.java rename to client/src/main/java/rt4/SceneGraph_Class120.java index 9c9b9a8..502a45c 100644 --- a/client/src/main/java/rt4/Class120.java +++ b/client/src/main/java/rt4/SceneGraph_Class120.java @@ -1,10 +1,12 @@ package rt4; +import org.openrs2.deob.annotation.OriginalArg; import org.openrs2.deob.annotation.OriginalClass; import org.openrs2.deob.annotation.OriginalMember; +import org.openrs2.deob.annotation.Pc; @OriginalClass("client!pe") -public final class Class120 { +public final class SceneGraph_Class120 { @OriginalMember(owner = "client!pe", name = "b", descriptor = "I") public int anInt4444; @@ -59,4 +61,21 @@ public final class Class120 { @OriginalMember(owner = "client!pe", name = "y", descriptor = "I") public int anInt4464; + + @OriginalMember(owner = "client!wj", name = "a", descriptor = "(IIIIIII)V") + public static void method4647(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) int arg4, @OriginalArg(5) int arg5, @OriginalArg(6) int arg6) { + @Pc(3) SceneGraph_Class120 local3 = new SceneGraph_Class120(); + local3.anInt4452 = arg1 / 128; + local3.anInt4446 = arg2 / 128; + local3.anInt4461 = arg3 / 128; + local3.anInt4464 = arg4 / 128; + local3.anInt4453 = arg0; + local3.anInt4460 = arg1; + local3.anInt4445 = arg2; + local3.anInt4458 = arg3; + local3.anInt4449 = arg4; + local3.anInt4444 = arg5; + local3.anInt4447 = arg6; + SceneGraph.aClass120Array1[SceneGraph.anInt917++] = local3; + } } diff --git a/client/src/main/java/rt4/Scenery.java b/client/src/main/java/rt4/Scenery.java index 55165c1..9a03d46 100644 --- a/client/src/main/java/rt4/Scenery.java +++ b/client/src/main/java/rt4/Scenery.java @@ -7,19 +7,19 @@ import org.openrs2.deob.annotation.OriginalMember; public final class Scenery { @OriginalMember(owner = "client!ec", name = "a", descriptor = "I") - public int anInt1696; + public int zMin; @OriginalMember(owner = "client!ec", name = "c", descriptor = "Lclient!th;") - public Entity primary; + public Entity entity; @OriginalMember(owner = "client!ec", name = "e", descriptor = "I") - public int anInt1698; + public int zMax; @OriginalMember(owner = "client!ec", name = "f", descriptor = "I") public int anInt1699; @OriginalMember(owner = "client!ec", name = "h", descriptor = "I") - public int anInt1701; + public int xMin; @OriginalMember(owner = "client!ec", name = "j", descriptor = "I") public int anInt1703; @@ -34,10 +34,10 @@ public final class Scenery { public int anInt1707; @OriginalMember(owner = "client!ec", name = "s", descriptor = "I") - public int anInt1709; + public int level; @OriginalMember(owner = "client!ec", name = "w", descriptor = "I") - public int anInt1713; + public int xMax; @OriginalMember(owner = "client!ec", name = "x", descriptor = "I") public int anInt1714; diff --git a/client/src/main/java/rt4/Static105.java b/client/src/main/java/rt4/Static105.java index 81fee04..6034fd7 100644 --- a/client/src/main/java/rt4/Static105.java +++ b/client/src/main/java/rt4/Static105.java @@ -24,16 +24,16 @@ public final class Static105 { } @Pc(58) Scenery local58 = new Scenery(); local58.key = arg11; - local58.anInt1709 = arg0; + local58.level = arg0; local58.anInt1699 = arg5; local58.anInt1703 = arg6; local58.anInt1706 = arg7; - local58.primary = arg8; + local58.entity = arg8; local58.anInt1714 = arg9; - local58.anInt1701 = arg1; - local58.anInt1696 = arg2; - local58.anInt1713 = arg1 + arg3 - 1; - local58.anInt1698 = arg2 + arg4 - 1; + local58.xMin = arg1; + local58.zMin = arg2; + local58.xMax = arg1 + arg3 - 1; + local58.zMax = arg2 + arg4 - 1; @Pc(108) int local108; for (local17 = arg1; local17 < arg1 + arg3; local17++) { for (local108 = arg2; local108 < arg2 + arg4; local108++) { @@ -57,8 +57,8 @@ public final class Static105 { } @Pc(174) Tile local174 = SceneGraph.tiles[arg0][local17][local108]; local174.scenery[local174.sceneryLen] = local58; - local174.anIntArray59[local174.sceneryLen] = local115; - local174.anInt664 |= local115; + local174.interiorFlags[local174.sceneryLen] = local115; + local174.allInteriorFlags |= local115; local174.sceneryLen++; if (local6 && SceneGraph.anIntArrayArray11[local17][local108] != 0) { local8 = SceneGraph.anIntArrayArray11[local17][local108]; diff --git a/client/src/main/java/rt4/Static123.java b/client/src/main/java/rt4/Static123.java index 67fb5ce..dd0c9d3 100644 --- a/client/src/main/java/rt4/Static123.java +++ b/client/src/main/java/rt4/Static123.java @@ -28,7 +28,7 @@ public final class Static123 { public static void method2419() { SceneGraph.anInt4870 = 0; label194: for (@Pc(3) int local3 = 0; local3 < SceneGraph.anInt917; local3++) { - @Pc(10) Class120 local10 = SceneGraph.aClass120Array1[local3]; + @Pc(10) SceneGraph_Class120 local10 = SceneGraph.aClass120Array1[local3]; @Pc(14) int local14; if (Static8.anIntArray8 != null) { for (local14 = 0; local14 < Static8.anIntArray8.length; local14++) { diff --git a/client/src/main/java/rt4/Static16.java b/client/src/main/java/rt4/Static16.java index e5c8441..fd72939 100644 --- a/client/src/main/java/rt4/Static16.java +++ b/client/src/main/java/rt4/Static16.java @@ -27,8 +27,8 @@ public final class Static16 { @Pc(54) Tile local54 = local30[local32][local42]; if (local54 != null) { @Pc(71) GlModel local71; - if (local54.groundDecor != null && local54.groundDecor.primary instanceof GlModel) { - local71 = (GlModel) local54.groundDecor.primary; + if (local54.groundDecor != null && local54.groundDecor.entity instanceof GlModel) { + local71 = (GlModel) local54.groundDecor.entity; if ((local54.groundDecor.key & Long.MIN_VALUE) == 0L) { local71.method4111(false, true, true, false, true, true); } else { @@ -44,8 +44,8 @@ public final class Static16 { local71.method4111(true, true, true, true, true, true); } } - if (local54.wallDecor.aClass8_2 instanceof GlModel) { - local71 = (GlModel) local54.wallDecor.aClass8_2; + if (local54.wallDecor.secondary instanceof GlModel) { + local71 = (GlModel) local54.wallDecor.secondary; if ((Long.MIN_VALUE & local54.wallDecor.key) == 0L) { local71.method4111(false, true, true, false, true, true); } else { @@ -62,8 +62,8 @@ public final class Static16 { local71.method4111(true, true, true, true, true, true); } } - if (local54.wall.aClass8_6 instanceof GlModel) { - local71 = (GlModel) local54.wall.aClass8_6; + if (local54.wall.secondary instanceof GlModel) { + local71 = (GlModel) local54.wall.secondary; if ((Long.MIN_VALUE & local54.wall.key) == 0L) { local71.method4111(false, true, true, false, true, true); } else { @@ -72,8 +72,8 @@ public final class Static16 { } } for (@Pc(270) int local270 = 0; local270 < local54.sceneryLen; local270++) { - if (local54.scenery[local270].primary instanceof GlModel) { - @Pc(293) GlModel local293 = (GlModel) local54.scenery[local270].primary; + if (local54.scenery[local270].entity instanceof GlModel) { + @Pc(293) GlModel local293 = (GlModel) local54.scenery[local270].entity; if ((Long.MIN_VALUE & local54.scenery[local270].key) == 0L) { local293.method4111(false, true, true, false, true, true); } else { diff --git a/client/src/main/java/rt4/Static176.java b/client/src/main/java/rt4/Static176.java index 8f858ed..d495086 100644 --- a/client/src/main/java/rt4/Static176.java +++ b/client/src/main/java/rt4/Static176.java @@ -67,37 +67,6 @@ public final class Static176 { } } - @OriginalMember(owner = "client!ob", name = "a", descriptor = "(IIIIIIIIIIIIIIIIIIII)V") - public static void method3305(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) int arg4, @OriginalArg(5) int arg5, @OriginalArg(6) int arg6, @OriginalArg(7) int arg7, @OriginalArg(8) int arg8, @OriginalArg(9) int arg9, @OriginalArg(10) int arg10, @OriginalArg(11) int arg11, @OriginalArg(12) int arg12, @OriginalArg(13) int arg13, @OriginalArg(14) int arg14, @OriginalArg(15) int arg15, @OriginalArg(16) int arg16, @OriginalArg(17) int arg17, @OriginalArg(18) int arg18, @OriginalArg(19) int arg19) { - @Pc(12) PlainTile local12; - @Pc(14) int local14; - if (arg3 == 0) { - local12 = new PlainTile(arg10, arg11, arg12, arg13, -1, arg18, false); - for (local14 = arg0; local14 >= 0; local14--) { - if (SceneGraph.tiles[local14][arg1][arg2] == null) { - SceneGraph.tiles[local14][arg1][arg2] = new Tile(local14, arg1, arg2); - } - } - SceneGraph.tiles[arg0][arg1][arg2].plainTile = local12; - } else if (arg3 == 1) { - local12 = new PlainTile(arg14, arg15, arg16, arg17, arg5, arg19, arg6 == arg7 && arg6 == arg8 && arg6 == arg9); - for (local14 = arg0; local14 >= 0; local14--) { - if (SceneGraph.tiles[local14][arg1][arg2] == null) { - SceneGraph.tiles[local14][arg1][arg2] = new Tile(local14, arg1, arg2); - } - } - SceneGraph.tiles[arg0][arg1][arg2].plainTile = local12; - } else { - @Pc(134) ShapedTile local134 = new ShapedTile(arg3, arg4, arg5, arg1, arg2, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19); - for (local14 = arg0; local14 >= 0; local14--) { - if (SceneGraph.tiles[local14][arg1][arg2] == null) { - SceneGraph.tiles[local14][arg1][arg2] = new Tile(local14, arg1, arg2); - } - } - SceneGraph.tiles[arg0][arg1][arg2].shapedTile = local134; - } - } - @OriginalMember(owner = "client!ob", name = "a", descriptor = "(IIIIII)V") public static void method3308(@OriginalArg(1) int arg0, @OriginalArg(2) int arg1, @OriginalArg(3) int arg2, @OriginalArg(4) int arg3, @OriginalArg(5) int arg4) { for (@Pc(8) int local8 = arg2; local8 <= arg0; local8++) { diff --git a/client/src/main/java/rt4/Static183.java b/client/src/main/java/rt4/Static183.java index 49a3fab..055c026 100644 --- a/client/src/main/java/rt4/Static183.java +++ b/client/src/main/java/rt4/Static183.java @@ -9,10 +9,7 @@ public final class Static183 { @OriginalMember(owner = "client!ok", name = "b", descriptor = "I") public static int anInt4271; - @OriginalMember(owner = "client!ok", name = "c", descriptor = "I") - public static int anInt4272 = (int) (Math.random() * 33.0D) - 16; - - @OriginalMember(owner = "client!ok", name = "f", descriptor = "J") + @OriginalMember(owner = "client!ok", name = "f", descriptor = "J") public static long prevClickTime = 0L; @OriginalMember(owner = "client!ok", name = "a", descriptor = "(IIB)Lclient!ce;") diff --git a/client/src/main/java/rt4/Static185.java b/client/src/main/java/rt4/Static185.java index d214444..fa8efbc 100644 --- a/client/src/main/java/rt4/Static185.java +++ b/client/src/main/java/rt4/Static185.java @@ -99,7 +99,7 @@ public final class Static185 { } SceneGraph.setGroundDecor(arg2, arg7, arg8, local199, local387, local261, local62.aBoolean211); if (local62.anInt4435 == 1 && arg4 != null) { - arg4.method3057(arg7, arg8); + arg4.flagGroundDecor(arg7, arg8); } } } else if (arg6 == 10 || arg6 == 11) { @@ -198,7 +198,7 @@ public final class Static185 { } } if (local62.anInt4435 != 0 && arg4 != null) { - arg4.method3040(arg9, arg6, local62.aBoolean207, arg8, arg7); + arg4.flagWall(arg9, arg6, local62.aBoolean207, arg8, arg7); } if (local62.wallDecorOffsetScale != 16) { Static18.method559(arg2, arg7, arg8, local62.wallDecorOffsetScale); @@ -226,7 +226,7 @@ public final class Static185 { } } if (local62.anInt4435 != 0 && arg4 != null) { - arg4.method3040(arg9, arg6, local62.aBoolean207, arg8, arg7); + arg4.flagWall(arg9, arg6, local62.aBoolean207, arg8, arg7); } } else { @Pc(1226) int local1226; @@ -266,7 +266,7 @@ public final class Static185 { } } if (local62.anInt4435 != 0 && arg4 != null) { - arg4.method3040(arg9, arg6, local62.aBoolean207, arg8, arg7); + arg4.flagWall(arg9, arg6, local62.aBoolean207, arg8, arg7); } if (local62.wallDecorOffsetScale != 16) { Static18.method559(arg2, arg7, arg8, local62.wallDecorOffsetScale); @@ -294,7 +294,7 @@ public final class Static185 { } } if (local62.anInt4435 != 0 && arg4 != null) { - arg4.method3040(arg9, arg6, local62.aBoolean207, arg8, arg7); + arg4.flagWall(arg9, arg6, local62.aBoolean207, arg8, arg7); } } else if (arg6 == 9) { if (local62.anInt4430 == -1 && local62.multiLocs == null && !local62.aBoolean214) { diff --git a/client/src/main/java/rt4/Static220.java b/client/src/main/java/rt4/Static220.java index 1506548..2351f82 100644 --- a/client/src/main/java/rt4/Static220.java +++ b/client/src/main/java/rt4/Static220.java @@ -55,38 +55,4 @@ public final class Static220 { Static69.method1543(Player.level, arg1, arg0, SceneGraph.getTileHeight(Player.level, arg1 * 128 + 64, arg0 * 128 + 64), local30.value, local152, local89, local91); } - @OriginalMember(owner = "client!rm", name = "a", descriptor = "(III)V") - public static void method3801() { - for (@Pc(1) int local1 = 0; local1 < SceneGraph.anInt3114; local1++) { - for (@Pc(6) int local6 = 0; local6 < SceneGraph.width; local6++) { - for (@Pc(11) int local11 = 0; local11 < SceneGraph.length; local11++) { - @Pc(22) Tile local22 = SceneGraph.tiles[local1][local6][local11]; - if (local22 != null) { - @Pc(27) Wall local27 = local22.wall; - if (local27 != null && local27.primary.method4543()) { - Static69.method1544(local27.primary, local1, local6, local11, 1, 1); - if (local27.aClass8_6 != null && local27.aClass8_6.method4543()) { - Static69.method1544(local27.aClass8_6, local1, local6, local11, 1, 1); - local27.primary.method4544(local27.aClass8_6, 0, 0, 0, false); - local27.aClass8_6 = local27.aClass8_6.createModel(); - } - local27.primary = local27.primary.createModel(); - } - for (@Pc(83) int local83 = 0; local83 < local22.sceneryLen; local83++) { - @Pc(92) Scenery local92 = local22.scenery[local83]; - if (local92 != null && local92.primary.method4543()) { - Static69.method1544(local92.primary, local1, local6, local11, local92.anInt1713 + 1 - local92.anInt1701, local92.anInt1698 - local92.anInt1696 + 1); - local92.primary = local92.primary.createModel(); - } - } - @Pc(131) GroundDecor local131 = local22.groundDecor; - if (local131 != null && local131.primary.method4543()) { - Static264.method3574(local131.primary, local1, local6, local11); - local131.primary = local131.primary.createModel(); - } - } - } - } - } - } } diff --git a/client/src/main/java/rt4/Static223.java b/client/src/main/java/rt4/Static223.java index 926dc09..1344040 100644 --- a/client/src/main/java/rt4/Static223.java +++ b/client/src/main/java/rt4/Static223.java @@ -43,7 +43,7 @@ public final class Static223 { public static void method3858() { for (@Pc(1) int local1 = 0; local1 < SceneGraph.sceneryLen; local1++) { @Pc(8) Scenery local8 = SceneGraph.scenery[local1]; - Static266.method4193(local8); + SceneGraph.removeScenery(local8); SceneGraph.scenery[local1] = null; } SceneGraph.sceneryLen = 0; diff --git a/client/src/main/java/rt4/Static224.java b/client/src/main/java/rt4/Static224.java index c52f4de..7120242 100644 --- a/client/src/main/java/rt4/Static224.java +++ b/client/src/main/java/rt4/Static224.java @@ -18,8 +18,8 @@ public final class Static224 { local30.anInt672--; for (@Pc(40) int local40 = 0; local40 < local30.sceneryLen; local40++) { @Pc(49) Scenery local49 = local30.scenery[local40]; - if ((local49.key >> 29 & 0x3L) == 2L && local49.anInt1701 == arg0 && local49.anInt1696 == arg1) { - local49.anInt1709--; + if ((local49.key >> 29 & 0x3L) == 2L && local49.xMin == arg0 && local49.zMin == arg1) { + local49.level--; } } } diff --git a/client/src/main/java/rt4/Static230.java b/client/src/main/java/rt4/Static230.java index 5ce522e..8306dc8 100644 --- a/client/src/main/java/rt4/Static230.java +++ b/client/src/main/java/rt4/Static230.java @@ -42,28 +42,6 @@ public final class Static230 { PlayerAppearance.aClass99_21.clear(); } - @OriginalMember(owner = "client!sj", name = "a", descriptor = "(BII)I") - public static int method3949(@OriginalArg(1) int arg0, @OriginalArg(2) int arg1) { - if (arg0 == -2) { - return 12345678; - } else if (arg0 == -1) { - if (arg1 < 2) { - arg1 = 2; - } else if (arg1 > 126) { - arg1 = 126; - } - return arg1; - } else { - arg1 = (arg0 & 0x7F) * arg1 >> 7; - if (arg1 < 2) { - arg1 = 2; - } else if (arg1 > 126) { - arg1 = 126; - } - return (arg0 & 0xFF80) + arg1; - } - } - @OriginalMember(owner = "client!sj", name = "a", descriptor = "(IIBIII)V") public static void method3950(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(3) int arg2, @OriginalArg(4) int arg3, @OriginalArg(5) int arg4) { if (arg0 >= TextureOp29.anInt4164 && arg3 <= TextureOp29.anInt5063 && TextureOp29.anInt5773 <= arg4 && TextureOp29.anInt2869 >= arg2) { diff --git a/client/src/main/java/rt4/Static247.java b/client/src/main/java/rt4/Static247.java index e9c5fe8..67e5188 100644 --- a/client/src/main/java/rt4/Static247.java +++ b/client/src/main/java/rt4/Static247.java @@ -114,25 +114,25 @@ public final class Static247 { } if (local18 <= Static167.anInt4069 && local18 > Static31.anInt987) { local153 = local31[local18 - 1][local21]; - if (local153 != null && local153.aBoolean46 && (local153.aBoolean45 || (local8.anInt664 & 0x1) == 0)) { + if (local153 != null && local153.aBoolean46 && (local153.aBoolean45 || (local8.allInteriorFlags & 0x1) == 0)) { continue; } } if (local18 >= Static167.anInt4069 && local18 < Static2.anInt15 - 1) { local153 = local31[local18 + 1][local21]; - if (local153 != null && local153.aBoolean46 && (local153.aBoolean45 || (local8.anInt664 & 0x4) == 0)) { + if (local153 != null && local153.aBoolean46 && (local153.aBoolean45 || (local8.allInteriorFlags & 0x4) == 0)) { continue; } } if (local21 <= Static193.anInt4539 && local21 > Static80.anInt4698) { local153 = local31[local18][local21 - 1]; - if (local153 != null && local153.aBoolean46 && (local153.aBoolean45 || (local8.anInt664 & 0x8) == 0)) { + if (local153 != null && local153.aBoolean46 && (local153.aBoolean45 || (local8.allInteriorFlags & 0x8) == 0)) { continue; } } if (local21 >= Static193.anInt4539 && local21 < Static215.anInt4866 - 1) { local153 = local31[local18][local21 + 1]; - if (local153 != null && local153.aBoolean46 && (local153.aBoolean45 || (local8.anInt664 & 0x2) == 0)) { + if (local153 != null && local153.aBoolean46 && (local153.aBoolean45 || (local8.allInteriorFlags & 0x2) == 0)) { continue; } } @@ -167,7 +167,7 @@ public final class Static247 { LightingManager.method2388(var22.anInt3049, Static149.anInt3555, Static123.anInt3947, Static217.anInt4903, local27, local18, local21); } } - var22.primary.render(0, Static109.anInt2886, Static121.anInt3038, Static231.anInt5205, Static81.anInt2222, var22.anInt3048 - Static149.anInt3555, var22.anInt3051 - Static123.anInt3947, var22.anInt3044 - Static217.anInt4903, var22.key, local24, null); + var22.primary.render(0, Static109.anInt2886, Static121.anInt3038, Static231.anInt5205, Static81.anInt2222, var22.xFine - Static149.anInt3555, var22.anInt3051 - Static123.anInt3947, var22.zFine - Static217.anInt4903, var22.key, local24, null); } for (local65 = 0; local65 < local153.sceneryLen; local65++) { var25 = local153.scenery[local65]; @@ -175,7 +175,7 @@ public final class Static247 { if (GlRenderer.enabled) { LightingManager.method2393(Static149.anInt3555, Static123.anInt3947, Static217.anInt4903, local24, local18, local21); } - var25.primary.render(var25.anInt1714, Static109.anInt2886, Static121.anInt3038, Static231.anInt5205, Static81.anInt2222, var25.anInt1699 - Static149.anInt3555, var25.anInt1706 - Static123.anInt3947, var25.anInt1703 - Static217.anInt4903, var25.key, local24, null); + var25.entity.render(var25.anInt1714, Static109.anInt2886, Static121.anInt3038, Static231.anInt5205, Static81.anInt2222, var25.anInt1699 - Static149.anInt3555, var25.anInt1706 - Static123.anInt3947, var25.anInt1703 - Static217.anInt4903, var25.key, local24, null); } } if (GlRenderer.enabled) { @@ -209,7 +209,7 @@ public final class Static247 { if (GlRenderer.enabled) { LightingManager.method2393(Static149.anInt3555, Static123.anInt3947, Static217.anInt4903, local24, local18, local21); } - local549.primary.render(0, Static109.anInt2886, Static121.anInt3038, Static231.anInt5205, Static81.anInt2222, local549.anInt732 - Static149.anInt3555, local549.anInt733 - Static123.anInt3947, local549.anInt736 - Static217.anInt4903, local549.key, local24, null); + local549.entity.render(0, Static109.anInt2886, Static121.anInt3038, Static231.anInt5205, Static81.anInt2222, local549.xFine - Static149.anInt3555, local549.anInt733 - Static123.anInt3947, local549.zFine - Static217.anInt4903, local549.key, local24, null); if (GlRenderer.enabled && local549.aBoolean49) { GlRenderer.method4159(local33); } @@ -257,13 +257,13 @@ public final class Static247 { if (GlRenderer.enabled) { LightingManager.method2393(Static149.anInt3555, Static123.anInt3947, Static217.anInt4903, local24, local18, local21); } - local616.primary.render(0, Static109.anInt2886, Static121.anInt3038, Static231.anInt5205, Static81.anInt2222, local616.anInt3048 - Static149.anInt3555, local616.anInt3051 - Static123.anInt3947, local616.anInt3044 - Static217.anInt4903, local616.key, local24, null); + local616.primary.render(0, Static109.anInt2886, Static121.anInt3038, Static231.anInt5205, Static81.anInt2222, local616.xFine - Static149.anInt3555, local616.anInt3051 - Static123.anInt3947, local616.zFine - Static217.anInt4903, local616.key, local24, null); } if ((local616.anInt3052 & local65) != 0 && !Static260.method3850(local27, local18, local21, local616.anInt3052)) { if (GlRenderer.enabled) { LightingManager.method2393(Static149.anInt3555, Static123.anInt3947, Static217.anInt4903, local24, local18, local21); } - local616.aClass8_6.render(0, Static109.anInt2886, Static121.anInt3038, Static231.anInt5205, Static81.anInt2222, local616.anInt3048 - Static149.anInt3555, local616.anInt3051 - Static123.anInt3947, local616.anInt3044 - Static217.anInt4903, local616.key, local24, null); + local616.secondary.render(0, Static109.anInt2886, Static121.anInt3038, Static231.anInt5205, Static81.anInt2222, local616.xFine - Static149.anInt3555, local616.anInt3051 - Static123.anInt3947, local616.zFine - Static217.anInt4903, local616.key, local24, null); } } if (local619 != null && !method4611(local27, local18, local21, local619.primary.getMinY())) { @@ -296,11 +296,11 @@ public final class Static247 { LightingManager.method2393(Static149.anInt3555, Static123.anInt3947, Static217.anInt4903, local24, local18, local21); } local619.primary.render(0, Static109.anInt2886, Static121.anInt3038, Static231.anInt5205, Static81.anInt2222, local894 + local619.anInt1394, local899, local904 + local619.anInt1392, local619.key, local24, null); - } else if (local619.aClass8_2 != null) { + } else if (local619.secondary != null) { if (GlRenderer.enabled) { LightingManager.method2393(Static149.anInt3555, Static123.anInt3947, Static217.anInt4903, local24, local18, local21); } - local619.aClass8_2.render(0, Static109.anInt2886, Static121.anInt3038, Static231.anInt5205, Static81.anInt2222, local894, local899, local904, local619.key, local24, null); + local619.secondary.render(0, Static109.anInt2886, Static121.anInt3038, Static231.anInt5205, Static81.anInt2222, local894, local899, local904, local619.key, local24, null); } } if (GlRenderer.enabled) { @@ -316,7 +316,7 @@ public final class Static247 { if (GlRenderer.enabled) { LightingManager.method2393(Static149.anInt3555, Static123.anInt3947, Static217.anInt4903, local24, local18, local21); } - local1001.primary.render(0, Static109.anInt2886, Static121.anInt3038, Static231.anInt5205, Static81.anInt2222, local1001.anInt732 - Static149.anInt3555, local1001.anInt733 - Static123.anInt3947, local1001.anInt736 - Static217.anInt4903, local1001.key, local24, null); + local1001.entity.render(0, Static109.anInt2886, Static121.anInt3038, Static231.anInt5205, Static81.anInt2222, local1001.xFine - Static149.anInt3555, local1001.anInt733 - Static123.anInt3947, local1001.zFine - Static217.anInt4903, local1001.key, local24, null); if (GlRenderer.enabled && local1001.aBoolean49) { GlRenderer.method4159(local33); } @@ -337,7 +337,7 @@ public final class Static247 { } } } - local894 = local8.anInt664; + local894 = local8.allInteriorFlags; if (local894 != 0) { if (local18 < Static167.anInt4069 && (local894 & 0x4) != 0) { var32 = local31[local18 + 1][local21]; @@ -369,7 +369,7 @@ public final class Static247 { if (local8.anInt663 != 0) { var24 = true; for (var10 = 0; var10 < local8.sceneryLen; var10++) { - if (local8.scenery[var10].anInt1707 != Static13.anInt437 && (local8.anIntArray59[var10] & local8.anInt663) == local8.anInt665) { + if (local8.scenery[var10].anInt1707 != Static13.anInt437 && (local8.interiorFlags[var10] & local8.anInt663) == local8.anInt665) { var24 = false; break; } @@ -380,8 +380,8 @@ public final class Static247 { if (GlRenderer.enabled) { label882: { if ((var22.key & 0xFC000L) == 16384L) { - local65 = var22.anInt3048 - Static149.anInt3555; - local115 = var22.anInt3044 - Static217.anInt4903; + local65 = var22.xFine - Static149.anInt3555; + local115 = var22.zFine - Static217.anInt4903; local1332 = (int) (var22.key >> 20 & 0x3L); if (local1332 == 0) { local65 -= 64; @@ -416,7 +416,7 @@ public final class Static247 { LightingManager.method2393(Static149.anInt3555, Static123.anInt3947, Static217.anInt4903, local24, local18, local21); } } - var22.primary.render(0, Static109.anInt2886, Static121.anInt3038, Static231.anInt5205, Static81.anInt2222, var22.anInt3048 - Static149.anInt3555, var22.anInt3051 - Static123.anInt3947, var22.anInt3044 - Static217.anInt4903, var22.key, local24, null); + var22.primary.render(0, Static109.anInt2886, Static121.anInt3038, Static231.anInt5205, Static81.anInt2222, var22.xFine - Static149.anInt3555, var22.anInt3051 - Static123.anInt3947, var22.zFine - Static217.anInt4903, var22.key, local24, null); } local8.anInt663 = 0; } @@ -431,8 +431,8 @@ public final class Static247 { label767: for (local65 = 0; local65 < var9; local65++) { var25 = local8.scenery[local65]; if (var25.anInt1707 != Static13.anInt437) { - for (local1332 = var25.anInt1701; local1332 <= var25.anInt1713; local1332++) { - for (local894 = var25.anInt1696; local894 <= var25.anInt1698; local894++) { + for (local1332 = var25.xMin; local1332 <= var25.xMax; local1332++) { + for (local894 = var25.zMin; local894 <= var25.zMax; local894++) { var32 = local31[local1332][local894]; if (var32.aBoolean45) { local8.aBoolean47 = true; @@ -440,16 +440,16 @@ public final class Static247 { } if (var32.anInt663 != 0) { local904 = 0; - if (local1332 > var25.anInt1701) { + if (local1332 > var25.xMin) { local904++; } - if (local1332 < var25.anInt1713) { + if (local1332 < var25.xMax) { local904 += 4; } - if (local894 > var25.anInt1696) { + if (local894 > var25.zMin) { local904 += 8; } - if (local894 < var25.anInt1698) { + if (local894 < var25.zMax) { local904 += 2; } if ((local904 & var32.anInt663) == local8.anInt667) { @@ -460,13 +460,13 @@ public final class Static247 { } } SceneGraph.aClass31Array2[var10++] = var25; - local1332 = Static167.anInt4069 - var25.anInt1701; - local894 = var25.anInt1713 - Static167.anInt4069; + local1332 = Static167.anInt4069 - var25.xMin; + local894 = var25.xMax - Static167.anInt4069; if (local894 > local1332) { local1332 = local894; } - local899 = Static193.anInt4539 - var25.anInt1696; - local904 = var25.anInt1698 - Static193.anInt4539; + local899 = Static193.anInt4539 - var25.zMin; + local904 = var25.zMax - Static193.anInt4539; if (local904 > local899) { var25.anInt1705 = local1332 + local904; } else { @@ -499,7 +499,7 @@ public final class Static247 { } @Pc(1697) Scenery local1697 = SceneGraph.aClass31Array2[local115]; local1697.anInt1707 = Static13.anInt437; - if (!Static73.method1599(local27, local1697.anInt1701, local1697.anInt1713, local1697.anInt1696, local1697.anInt1698, local1697.primary.getMinY())) { + if (!Static73.method1599(local27, local1697.xMin, local1697.xMax, local1697.zMin, local1697.zMax, local1697.entity.getMinY())) { if (GlRenderer.enabled) { if ((local1697.key & 0xFC000L) == 147456L) { LightingManager.method2393(Static149.anInt3555, Static123.anInt3947, Static217.anInt4903, local24, local18, local21); @@ -518,13 +518,13 @@ public final class Static247 { LightingManager.method2397(local24, local18, local21 + 1, local18 - 1, local21); } } else { - LightingManager.method2391(Static149.anInt3555, Static123.anInt3947, Static217.anInt4903, local24, local1697.anInt1701, local1697.anInt1696, local1697.anInt1713, local1697.anInt1698); + LightingManager.method2391(Static149.anInt3555, Static123.anInt3947, Static217.anInt4903, local24, local1697.xMin, local1697.zMin, local1697.xMax, local1697.zMax); } } - local1697.primary.render(local1697.anInt1714, Static109.anInt2886, Static121.anInt3038, Static231.anInt5205, Static81.anInt2222, local1697.anInt1699 - Static149.anInt3555, local1697.anInt1706 - Static123.anInt3947, local1697.anInt1703 - Static217.anInt4903, local1697.key, local24, null); + local1697.entity.render(local1697.anInt1714, Static109.anInt2886, Static121.anInt3038, Static231.anInt5205, Static81.anInt2222, local1697.anInt1699 - Static149.anInt3555, local1697.anInt1706 - Static123.anInt3947, local1697.anInt1703 - Static217.anInt4903, local1697.key, local24, null); } - for (local894 = local1697.anInt1701; local894 <= local1697.anInt1713; local894++) { - for (local899 = local1697.anInt1696; local899 <= local1697.anInt1698; local899++) { + for (local894 = local1697.xMin; local894 <= local1697.xMax; local894++) { + for (local899 = local1697.zMin; local899 <= local1697.zMax; local899++) { @Pc(1863) Tile local1863 = local31[local894][local899]; if (local1863.anInt663 != 0) { Static7.aClass69_32.addTail(local1863); @@ -609,11 +609,11 @@ public final class Static247 { LightingManager.method2393(Static149.anInt3555, Static123.anInt3947, Static217.anInt4903, local24, local18, local21); } local2109.primary.render(0, Static109.anInt2886, Static121.anInt3038, Static231.anInt5205, Static81.anInt2222, local65 + local2109.anInt1394, local115, local1332 + local2109.anInt1392, local2109.key, local24, null); - } else if (local2109.aClass8_2 != null) { + } else if (local2109.secondary != null) { if (GlRenderer.enabled) { LightingManager.method2393(Static149.anInt3555, Static123.anInt3947, Static217.anInt4903, local24, local18, local21); } - local2109.aClass8_2.render(0, Static109.anInt2886, Static121.anInt3038, Static231.anInt5205, Static81.anInt2222, local65, local115, local1332, local2109.key, local24, null); + local2109.secondary.render(0, Static109.anInt2886, Static121.anInt3038, Static231.anInt5205, Static81.anInt2222, local65, local115, local1332, local2109.key, local24, null); } } } @@ -623,18 +623,18 @@ public final class Static247 { if (GlRenderer.enabled) { LightingManager.method2388(local2275.anInt3052, Static149.anInt3555, Static123.anInt3947, Static217.anInt4903, local27, local18, local21); } - local2275.aClass8_6.render(0, Static109.anInt2886, Static121.anInt3038, Static231.anInt5205, Static81.anInt2222, local2275.anInt3048 - Static149.anInt3555, local2275.anInt3051 - Static123.anInt3947, local2275.anInt3044 - Static217.anInt4903, local2275.key, local24, null); + local2275.secondary.render(0, Static109.anInt2886, Static121.anInt3038, Static231.anInt5205, Static81.anInt2222, local2275.xFine - Static149.anInt3555, local2275.anInt3051 - Static123.anInt3947, local2275.zFine - Static217.anInt4903, local2275.key, local24, null); } if ((local2275.anInt3049 & local8.anInt670) != 0 && !Static260.method3850(local27, local18, local21, local2275.anInt3049)) { if (GlRenderer.enabled) { LightingManager.method2388(local2275.anInt3049, Static149.anInt3555, Static123.anInt3947, Static217.anInt4903, local27, local18, local21); } - local2275.primary.render(0, Static109.anInt2886, Static121.anInt3038, Static231.anInt5205, Static81.anInt2222, local2275.anInt3048 - Static149.anInt3555, local2275.anInt3051 - Static123.anInt3947, local2275.anInt3044 - Static217.anInt4903, local2275.key, local24, null); + local2275.primary.render(0, Static109.anInt2886, Static121.anInt3038, Static231.anInt5205, Static81.anInt2222, local2275.xFine - Static149.anInt3555, local2275.anInt3051 - Static123.anInt3947, local2275.zFine - Static217.anInt4903, local2275.key, local24, null); } } } @Pc(2388) Tile local2388; - if (local24 < SceneGraph.anInt3114 - 1) { + if (local24 < SceneGraph.levels - 1) { local2388 = SceneGraph.tiles[local24 + 1][local18][local21]; if (local2388 != null && local2388.aBoolean46) { Static7.aClass69_32.addTail(local2388); diff --git a/client/src/main/java/rt4/Static248.java b/client/src/main/java/rt4/Static248.java index 99f27e7..de2e70c 100644 --- a/client/src/main/java/rt4/Static248.java +++ b/client/src/main/java/rt4/Static248.java @@ -21,7 +21,7 @@ public final class Static248 { @Pc(32) int local32; @Pc(37) int local37; @Pc(183) int local183; - for (@Pc(23) int local23 = Static235.anInt5276; local23 < SceneGraph.anInt3114; local23++) { + for (@Pc(23) int local23 = Static235.anInt5276; local23 < SceneGraph.levels; local23++) { @Pc(30) Tile[][] local30 = SceneGraph.tiles[local23]; for (local32 = Static31.anInt987; local32 < Static2.anInt15; local32++) { for (local37 = Static80.anInt4698; local37 < Static215.anInt4866; local37++) { @@ -43,26 +43,26 @@ public final class Static248 { if (local32 >= local9 && local32 <= local13 && local37 >= local17 && local37 <= local21) { if (local46.wall != null) { @Pc(103) Wall local103 = local46.wall; - local103.primary.method4545(0, local23, local103.anInt3051, local103.anInt3048, local103.anInt3044); - if (local103.aClass8_6 != null) { - local103.aClass8_6.method4545(0, local23, local103.anInt3051, local103.anInt3048, local103.anInt3044); + local103.primary.method4545(0, local23, local103.anInt3051, local103.xFine, local103.zFine); + if (local103.secondary != null) { + local103.secondary.method4545(0, local23, local103.anInt3051, local103.xFine, local103.zFine); } } if (local46.wallDecor != null) { @Pc(134) WallDecor local134 = local46.wallDecor; local134.primary.method4545(local134.anInt1388, local23, local134.anInt1391, local134.anInt1390, local134.anInt1393); - if (local134.aClass8_2 != null) { - local134.aClass8_2.method4545(local134.anInt1388, local23, local134.anInt1391, local134.anInt1390, local134.anInt1393); + if (local134.secondary != null) { + local134.secondary.method4545(local134.anInt1388, local23, local134.anInt1391, local134.anInt1390, local134.anInt1393); } } if (local46.groundDecor != null) { @Pc(167) GroundDecor local167 = local46.groundDecor; - local167.primary.method4545(0, local23, local167.anInt733, local167.anInt732, local167.anInt736); + local167.entity.method4545(0, local23, local167.anInt733, local167.xFine, local167.zFine); } if (local46.scenery != null) { for (local183 = 0; local183 < local46.sceneryLen; local183++) { @Pc(192) Scenery local192 = local46.scenery[local183]; - local192.primary.method4545(local192.anInt1714, local23, local192.anInt1706, local192.anInt1699, local192.anInt1703); + local192.entity.method4545(local192.anInt1714, local23, local192.anInt1706, local192.anInt1699, local192.anInt1703); } } } @@ -97,7 +97,7 @@ public final class Static248 { } else { local32 = Static235.anInt5276; while (true) { - if (local32 >= SceneGraph.anInt3114) { + if (local32 >= SceneGraph.levels) { LightingManager.method2402(Static167.anInt4069, Static193.anInt4539, SceneGraph.tiles); break; } @@ -125,7 +125,7 @@ public final class Static248 { @Pc(406) Tile[][] local406; @Pc(415) int local415; @Pc(428) int local428; - for (local399 = Static235.anInt5276; local399 < SceneGraph.anInt3114; local399++) { + for (local399 = Static235.anInt5276; local399 < SceneGraph.levels; local399++) { local406 = SceneGraph.tiles[local399]; for (local37 = -SceneGraph.visibility; local37 <= 0; local37++) { local415 = Static167.anInt4069 + local37; @@ -172,7 +172,7 @@ public final class Static248 { } } } - for (local399 = Static235.anInt5276; local399 < SceneGraph.anInt3114; local399++) { + for (local399 = Static235.anInt5276; local399 < SceneGraph.levels; local399++) { local406 = SceneGraph.tiles[local399]; for (local37 = -SceneGraph.visibility; local37 <= 0; local37++) { local415 = Static167.anInt4069 + local37; diff --git a/client/src/main/java/rt4/Static253.java b/client/src/main/java/rt4/Static253.java index 0d4b41b..99b9609 100644 --- a/client/src/main/java/rt4/Static253.java +++ b/client/src/main/java/rt4/Static253.java @@ -604,7 +604,7 @@ public final class Static253 { } } } - if (local39.attachment == null || client.loop < local39.anInt3390 || local39.anInt3375 <= client.loop) { + if (local39.attachment == null || client.loop < local39.attachmentSetAt || local39.attachmentResetAt <= client.loop) { local39.anInt3424 = SceneGraph.getTileHeight(Player.level, local39.xFine, local39.zFine); Static43.method1141(Player.level, local39.xFine, local39.zFine, local39.anInt3424, (local82 - 1) * 64 + 60, local39, local39.anInt3381, local272, local39.aBoolean171); } else { diff --git a/client/src/main/java/rt4/Static254.java b/client/src/main/java/rt4/Static254.java index e7461df..d2735fb 100644 --- a/client/src/main/java/rt4/Static254.java +++ b/client/src/main/java/rt4/Static254.java @@ -76,9 +76,9 @@ public final class Static254 { if (local395 != null && local395.sceneryLen > 0) { for (local227 = 0; local227 < local395.sceneryLen; local227++) { @Pc(418) Scenery local418 = local395.scenery[local227]; - if (local418.anInt1713 != local418.anInt1701 || local418.anInt1698 != local418.anInt1696) { - for (local358 = local418.anInt1701; local358 <= local418.anInt1713; local358++) { - for (@Pc(450) int local450 = local418.anInt1696; local450 <= local418.anInt1698; local450++) { + if (local418.xMax != local418.xMin || local418.zMax != local418.zMin) { + for (local358 = local418.xMin; local358 <= local418.xMax; local358++) { + for (@Pc(450) int local450 = local418.zMin; local450 <= local418.zMax; local450++) { Static266.aByteArrayArrayArray15[local150][local358][local450] = local14; } } diff --git a/client/src/main/java/rt4/Static264.java b/client/src/main/java/rt4/Static264.java index 36fa9c0..a47f7bc 100644 --- a/client/src/main/java/rt4/Static264.java +++ b/client/src/main/java/rt4/Static264.java @@ -28,26 +28,26 @@ public final class Static264 { @Pc(12) Tile local12; if (arg2 < SceneGraph.width) { local12 = SceneGraph.tiles[arg1][arg2 + 1][arg3]; - if (local12 != null && local12.groundDecor != null && local12.groundDecor.primary.method4543()) { - arg0.method4544(local12.groundDecor.primary, 128, 0, 0, true); + if (local12 != null && local12.groundDecor != null && local12.groundDecor.entity.method4543()) { + arg0.method4544(local12.groundDecor.entity, 128, 0, 0, true); } } if (arg3 < SceneGraph.width) { local12 = SceneGraph.tiles[arg1][arg2][arg3 + 1]; - if (local12 != null && local12.groundDecor != null && local12.groundDecor.primary.method4543()) { - arg0.method4544(local12.groundDecor.primary, 0, 0, 128, true); + if (local12 != null && local12.groundDecor != null && local12.groundDecor.entity.method4543()) { + arg0.method4544(local12.groundDecor.entity, 0, 0, 128, true); } } if (arg2 < SceneGraph.width && arg3 < SceneGraph.length) { local12 = SceneGraph.tiles[arg1][arg2 + 1][arg3 + 1]; - if (local12 != null && local12.groundDecor != null && local12.groundDecor.primary.method4543()) { - arg0.method4544(local12.groundDecor.primary, 128, 0, 128, true); + if (local12 != null && local12.groundDecor != null && local12.groundDecor.entity.method4543()) { + arg0.method4544(local12.groundDecor.entity, 128, 0, 128, true); } } if (arg2 < SceneGraph.width && arg3 > 0) { local12 = SceneGraph.tiles[arg1][arg2 + 1][arg3 - 1]; - if (local12 != null && local12.groundDecor != null && local12.groundDecor.primary.method4543()) { - arg0.method4544(local12.groundDecor.primary, 128, 0, -128, true); + if (local12 != null && local12.groundDecor != null && local12.groundDecor.entity.method4543()) { + arg0.method4544(local12.groundDecor.entity, 128, 0, -128, true); } } } diff --git a/client/src/main/java/rt4/Static266.java b/client/src/main/java/rt4/Static266.java index ea5e925..fdb2a40 100644 --- a/client/src/main/java/rt4/Static266.java +++ b/client/src/main/java/rt4/Static266.java @@ -1,8 +1,6 @@ package rt4; -import org.openrs2.deob.annotation.OriginalArg; import org.openrs2.deob.annotation.OriginalMember; -import org.openrs2.deob.annotation.Pc; public final class Static266 { @@ -15,30 +13,4 @@ public final class Static266 { @OriginalMember(owner = "client!vk", name = "d", descriptor = "Lclient!na;") public static final JagString aClass100_1010 = JagString.parse("null"); - @OriginalMember(owner = "client!vk", name = "a", descriptor = "(Lclient!ec;)V") - public static void method4193(@OriginalArg(0) Scenery arg0) { - for (@Pc(2) int local2 = arg0.anInt1701; local2 <= arg0.anInt1713; local2++) { - for (@Pc(9) int local9 = arg0.anInt1696; local9 <= arg0.anInt1698; local9++) { - @Pc(22) Tile local22 = SceneGraph.tiles[arg0.anInt1709][local2][local9]; - if (local22 != null) { - @Pc(26) int local26; - for (local26 = 0; local26 < local22.sceneryLen; local26++) { - if (local22.scenery[local26] == arg0) { - local22.sceneryLen--; - for (@Pc(44) int local44 = local26; local44 < local22.sceneryLen; local44++) { - local22.scenery[local44] = local22.scenery[local44 + 1]; - local22.anIntArray59[local44] = local22.anIntArray59[local44 + 1]; - } - local22.scenery[local22.sceneryLen] = null; - break; - } - } - local22.anInt664 = 0; - for (local26 = 0; local26 < local22.sceneryLen; local26++) { - local22.anInt664 |= local22.anIntArray59[local26]; - } - } - } - } - } } diff --git a/client/src/main/java/rt4/Static267.java b/client/src/main/java/rt4/Static267.java index d8f2695..821a5cd 100644 --- a/client/src/main/java/rt4/Static267.java +++ b/client/src/main/java/rt4/Static267.java @@ -20,18 +20,6 @@ public final class Static267 { @OriginalMember(owner = "client!vl", name = "l", descriptor = "I") public static int anInt5776 = 0; - @OriginalMember(owner = "client!vl", name = "a", descriptor = "(III)Lclient!bm;") - public static GroundDecor method4526(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2) { - @Pc(7) Tile local7 = SceneGraph.tiles[arg0][arg1][arg2]; - if (local7 == null) { - return null; - } else { - @Pc(14) GroundDecor local14 = local7.groundDecor; - local7.groundDecor = null; - return local14; - } - } - @OriginalMember(owner = "client!vl", name = "a", descriptor = "(I)Z") public static boolean isShowingVideoAd() { if (client.objectTag) { diff --git a/client/src/main/java/rt4/Static43.java b/client/src/main/java/rt4/Static43.java index cd3ee42..a93de82 100644 --- a/client/src/main/java/rt4/Static43.java +++ b/client/src/main/java/rt4/Static43.java @@ -40,114 +40,114 @@ public final class Static43 { } @OriginalMember(owner = "client!dg", name = "a", descriptor = "(IIIIIILclient!mj;)V") - public static void method1144(@OriginalArg(1) int arg0, @OriginalArg(2) int arg1, @OriginalArg(3) int arg2, @OriginalArg(4) int arg3, @OriginalArg(5) int arg4, @OriginalArg(6) CollisionMap arg5) { - @Pc(9) long local9 = 0L; + public static void method1144(@OriginalArg(1) int z, @OriginalArg(2) int x, @OriginalArg(3) int level, @OriginalArg(4) int arg3, @OriginalArg(5) int arg4, @OriginalArg(6) CollisionMap collision) { + @Pc(9) long key = 0L; if (arg3 == 0) { - local9 = SceneGraph.getWallKey(arg2, arg1, arg0); + key = SceneGraph.getWallKey(level, x, z); } else if (arg3 == 1) { - local9 = SceneGraph.getWallDecorKey(arg2, arg1, arg0); + key = SceneGraph.getWallDecorKey(level, x, z); } else if (arg3 == 2) { - local9 = SceneGraph.getSceneryKey(arg2, arg1, arg0); + key = SceneGraph.getSceneryKey(level, x, z); } else if (arg3 == 3) { - local9 = SceneGraph.getGroundDecorKey(arg2, arg1, arg0); + key = SceneGraph.getGroundDecorKey(level, x, z); } - @Pc(57) int local57 = (int) local9 >> 14 & 0x1F; - @Pc(70) int local70 = (int) (local9 >>> 32) & Integer.MAX_VALUE; - @Pc(74) LocType local74 = LocTypeList.get(local70); - if (local74.hasAreaSound()) { - AreaSoundManager.remove(arg1, local74, arg0, arg2); + @Pc(57) int shape = (int) key >> 14 & 0x1F; + @Pc(70) int id = (int) (key >>> 32) & Integer.MAX_VALUE; + @Pc(74) LocType type = LocTypeList.get(id); + if (type.hasAreaSound()) { + AreaSoundManager.remove(x, type, z, level); } - @Pc(92) int local92 = (int) local9 >> 20 & 0x3; - if (local9 == 0L) { + @Pc(92) int angle = (int) key >> 20 & 0x3; + if (key == 0L) { return; } @Pc(100) Entity local100 = null; @Pc(102) Entity local102 = null; if (arg3 == 0) { - @Pc(110) Wall local110 = SceneGraph.removeWall(arg2, arg1, arg0); - if (local110 != null) { - local100 = local110.primary; - local102 = local110.aClass8_6; + @Pc(110) Wall wall = SceneGraph.removeWall(level, x, z); + if (wall != null) { + local100 = wall.primary; + local102 = wall.secondary; } - if (local74.anInt4435 != 0) { - arg5.method3039(local92, local74.aBoolean207, arg0, local57, arg1); + if (type.anInt4435 != 0) { + collision.unflagWall(angle, type.aBoolean207, z, shape, x); } } else if (arg3 == 1) { - @Pc(233) WallDecor local233 = Static75.method1633(arg2, arg1, arg0); - if (local233 != null) { - local100 = local233.primary; - local102 = local233.aClass8_2; + @Pc(233) WallDecor wallDecor = SceneGraph.removeWallDecor(level, x, z); + if (wallDecor != null) { + local100 = wallDecor.primary; + local102 = wallDecor.secondary; } } else if (arg3 == 2) { - @Pc(148) Scenery local148 = Static47.method3996(arg2, arg1, arg0); - if (local148 != null) { - local100 = local148.primary; + @Pc(148) Scenery scenery = SceneGraph.removeScenery(level, x, z); + if (scenery != null) { + local100 = scenery.entity; } - if (local74.anInt4435 != 0 && local74.width + arg1 < 104 && local74.width + arg0 < 104 && arg1 + local74.length < 104 && arg0 + local74.length < 104) { - arg5.unflagScenery(arg1, local74.width, local74.aBoolean207, local92, local74.length, arg0); + if (type.anInt4435 != 0 && type.width + x < 104 && type.width + z < 104 && x + type.length < 104 && z + type.length < 104) { + collision.unflagScenery(x, type.width, type.aBoolean207, angle, type.length, z); } } else if (arg3 == 3) { - @Pc(211) GroundDecor local211 = Static267.method4526(arg2, arg1, arg0); - if (local211 != null) { - local100 = local211.primary; + @Pc(211) GroundDecor groundDecor = SceneGraph.removeGroundDecor(level, x, z); + if (groundDecor != null) { + local100 = groundDecor.entity; } - if (local74.anInt4435 == 1) { - arg5.method3053(arg0, arg1); + if (type.anInt4435 == 1) { + collision.unflagGroundDecor(z, x); } } - if (!GlRenderer.enabled || !local74.aBoolean212) { + if (!GlRenderer.enabled || !type.aBoolean212) { return; } - if (local57 == 2) { + if (shape == 2) { if (local100 instanceof Loc) { ((Loc) local100).method1046(); } else { - Loc.method181(local74, 0, local92 + 4, 0, local57, arg1, arg0, arg4); + Loc.method181(type, 0, angle + 4, 0, shape, x, z, arg4); } if (local102 instanceof Loc) { ((Loc) local102).method1046(); } else { - Loc.method181(local74, 0, local92 + 1 & 0x3, 0, local57, arg1, arg0, arg4); + Loc.method181(type, 0, angle + 1 & 0x3, 0, shape, x, z, arg4); } - } else if (local57 == 5) { + } else if (shape == 5) { if (local100 instanceof Loc) { ((Loc) local100).method1046(); } else { - Loc.method181(local74, Static238.anIntArray469[local92] * 8, local92, Static34.anIntArray80[local92] * 8, 4, arg1, arg0, arg4); + Loc.method181(type, Static238.anIntArray469[angle] * 8, angle, Static34.anIntArray80[angle] * 8, 4, x, z, arg4); } - } else if (local57 == 6) { + } else if (shape == 6) { if (local100 instanceof Loc) { ((Loc) local100).method1046(); } else { - Loc.method181(local74, Static64.anIntArray154[local92] * 8, local92 + 4, Static114.anIntArray565[local92] * 8, 4, arg1, arg0, arg4); + Loc.method181(type, Static64.anIntArray154[angle] * 8, angle + 4, Static114.anIntArray565[angle] * 8, 4, x, z, arg4); } - } else if (local57 == 7) { + } else if (shape == 7) { if (local100 instanceof Loc) { ((Loc) local100).method1046(); } else { - Loc.method181(local74, 0, (local92 + 2 & 0x3) + 4, 0, 4, arg1, arg0, arg4); + Loc.method181(type, 0, (angle + 2 & 0x3) + 4, 0, 4, x, z, arg4); } - } else if (local57 == 8) { + } else if (shape == 8) { if (local100 instanceof Loc) { ((Loc) local100).method1046(); } else { - Loc.method181(local74, Static64.anIntArray154[local92] * 8, local92 + 4, Static114.anIntArray565[local92] * 8, 4, arg1, arg0, arg4); + Loc.method181(type, Static64.anIntArray154[angle] * 8, angle + 4, Static114.anIntArray565[angle] * 8, 4, x, z, arg4); } if (local102 instanceof Loc) { ((Loc) local102).method1046(); } else { - Loc.method181(local74, Static64.anIntArray154[local92] * 8, (local92 + 2 & 0x3) + 4, Static114.anIntArray565[local92] * 8, 4, arg1, arg0, arg4); + Loc.method181(type, Static64.anIntArray154[angle] * 8, (angle + 2 & 0x3) + 4, Static114.anIntArray565[angle] * 8, 4, x, z, arg4); } - } else if (local57 == 11) { + } else if (shape == 11) { if (local100 instanceof Loc) { ((Loc) local100).method1046(); } else { - Loc.method181(local74, 0, local92 + 4, 0, 10, arg1, arg0, arg4); + Loc.method181(type, 0, angle + 4, 0, 10, x, z, arg4); } } else if (local100 instanceof Loc) { ((Loc) local100).method1046(); } else { - Loc.method181(local74, 0, local92, 0, local57, arg1, arg0, arg4); + Loc.method181(type, 0, angle, 0, shape, x, z, arg4); } } } diff --git a/client/src/main/java/rt4/Static45.java b/client/src/main/java/rt4/Static45.java deleted file mode 100644 index 00b4941..0000000 --- a/client/src/main/java/rt4/Static45.java +++ /dev/null @@ -1,504 +0,0 @@ -package rt4; - -import org.openrs2.deob.annotation.OriginalArg; -import org.openrs2.deob.annotation.OriginalMember; -import org.openrs2.deob.annotation.Pc; - -public final class Static45 { - - @OriginalMember(owner = "client!gm", name = "R", descriptor = "I") - public static int anInt2293 = (int) (Math.random() * 17.0D) - 8; - - @OriginalMember(owner = "client!di", name = "a", descriptor = "([Lclient!mj;ZI)V") - public static void method1169(@OriginalArg(0) CollisionMap[] collisionMaps, @OriginalArg(1) boolean underwater) { - @Pc(10) int level; - @Pc(15) int x; - if (!underwater) { - for (level = 0; level < 4; level++) { - for (x = 0; x < 104; x++) { - for (@Pc(22) int z = 0; z < 104; z++) { - if ((SceneGraph.tileFlags[level][x][z] & 0x1) == 1) { - @Pc(43) int transformedLevel = level; - if ((SceneGraph.tileFlags[1][x][z] & 0x2) == 2) { - transformedLevel = level - 1; - } - if (transformedLevel >= 0) { - collisionMaps[transformedLevel].addRangeableFlag(z, x); - } - } - } - } - } - Static183.anInt4272 += (int) (Math.random() * 5.0D) - 2; - if (Static183.anInt4272 < -16) { - Static183.anInt4272 = -16; - } - if (Static183.anInt4272 > 16) { - Static183.anInt4272 = 16; - } - anInt2293 += (int) (Math.random() * 5.0D) - 2; - if (anInt2293 < -8) { - anInt2293 = -8; - } - if (anInt2293 > 8) { - anInt2293 = 8; - } - } - @Pc(128) byte local128; - if (underwater) { - local128 = 1; - } else { - local128 = 4; - } - level = anInt2293 >> 2 << 10; - @Pc(142) int[][] local142 = new int[104][104]; - @Pc(146) int[][] local146 = new int[104][104]; - x = Static183.anInt4272 >> 1; - @Pc(152) int local152; - @Pc(168) int local168; - @Pc(173) int local173; - @Pc(178) int local178; - @Pc(194) int local194; - @Pc(200) int local200; - @Pc(202) int local202; - @Pc(209) int local209; - @Pc(349) int local349; - @Pc(234) int local234; - @Pc(254) int local254; - @Pc(267) int local267; - for (local152 = 0; local152 < local128; local152++) { - @Pc(159) byte[][] local159 = SceneGraph.aByteArrayArrayArray9[local152]; - @Pc(273) int local273; - @Pc(326) int local326; - @Pc(332) int local332; - @Pc(322) int local322; - if (!GlRenderer.enabled) { - local168 = (int) Math.sqrt(5100.0D); - local173 = local168 * 768 >> 8; - for (local178 = 1; local178 < 103; local178++) { - for (local194 = 1; local194 < 103; local194++) { - local209 = SceneGraph.tileHeights[local152][local194][local178 + 1] - SceneGraph.tileHeights[local152][local194][local178 - 1]; - local202 = SceneGraph.tileHeights[local152][local194 + 1][local178] - SceneGraph.tileHeights[local152][local194 - 1][local178]; - local349 = (int) Math.sqrt((double) (local202 * local202 + local209 * local209 + 65536)); - local267 = (local209 << 8) / local349; - local254 = -65536 / local349; - local234 = (local202 << 8) / local349; - local273 = (local159[local194][local178] >> 1) + (local159[local194][local178 - 1] >> 2) + (local159[local194 - -1][local178] >> 3) + (local159[local194 - 1][local178] >> 2) + (local159[local194][local178 + 1] >> 3); - local200 = (local267 * -50 + local234 * -50 + local254 * -10) / local173 + 74; - local146[local194][local178] = local200 - local273; - } - } - } else if (Preferences.highDetailLighting) { - for (local168 = 1; local168 < 103; local168++) { - for (local173 = 1; local173 < 103; local173++) { - local194 = (local159[local173 + 1][local168] >> 3) + (local159[local173 - 1][local168] >> 2) + (local159[local173][local168 + -1] >> 2) + (local159[local173][local168 + 1] >> 3) + (local159[local173][local168] >> 1); - local146[local173][local168] = 74 - local194; - } - } - } else { - local168 = (int) FogManager.aFloatArray18[0]; - local173 = (int) FogManager.aFloatArray18[1]; - local178 = (int) FogManager.aFloatArray18[2]; - local194 = (int) Math.sqrt((double) (local173 * local173 + local168 * local168 + local178 * local178)); - local200 = local194 * 1024 >> 8; - for (local202 = 1; local202 < 103; local202++) { - for (local209 = 1; local209 < 103; local209++) { - local234 = SceneGraph.tileHeights[local152][local209 + 1][local202] - SceneGraph.tileHeights[local152][local209 - 1][local202]; - local254 = SceneGraph.tileHeights[local152][local209][local202 + 1] - SceneGraph.tileHeights[local152][local209][local202 - 1]; - local267 = (int) Math.sqrt((double) (local234 * local234 + local254 * local254 + 65536)); - local273 = (local234 << 8) / local267; - local322 = (local159[local209][local202 + 1] >> 3) + (local159[local209][local202 - 1] >> 2) + (local159[local209 - 1][local202] >> 2) + (local159[local209 + 1][local202] >> 3) + (local159[local209][local202] >> 1); - local326 = -65536 / local267; - local332 = (local254 << 8) / local267; - local349 = (local178 * local332 + local168 * local273 + local326 * local173) / local200 + 96; - local146[local209][local202] = local349 - (int) ((float) local322 * 1.7F); - } - } - } - for (local168 = 0; local168 < 104; local168++) { - SceneGraph.anIntArray376[local168] = 0; - SceneGraph.anIntArray325[local168] = 0; - SceneGraph.anIntArray568[local168] = 0; - SceneGraph.anIntArray479[local168] = 0; - SceneGraph.anIntArray293[local168] = 0; - } - for (local168 = -5; local168 < 104; local168++) { - for (local173 = 0; local173 < 104; local173++) { - local178 = local168 + 5; - @Pc(729) int local729; - if (local178 < 104) { - local194 = SceneGraph.tileUnderlays[local152][local178][local173] & 0xFF; - if (local194 > 0) { - @Pc(693) FluType local693 = FluTypeList.get(local194 - 1); - SceneGraph.anIntArray376[local173] += local693.weightedHue; - SceneGraph.anIntArray325[local173] += local693.saturation; - SceneGraph.anIntArray568[local173] += local693.lightness; - SceneGraph.anIntArray479[local173] += local693.chroma; - local729 = SceneGraph.anIntArray293[local173]++; - } - } - local194 = local168 - 5; - if (local194 >= 0) { - local200 = SceneGraph.tileUnderlays[local152][local194][local173] & 0xFF; - if (local200 > 0) { - @Pc(758) FluType local758 = FluTypeList.get(local200 - 1); - SceneGraph.anIntArray376[local173] -= local758.weightedHue; - SceneGraph.anIntArray325[local173] -= local758.saturation; - SceneGraph.anIntArray568[local173] -= local758.lightness; - SceneGraph.anIntArray479[local173] -= local758.chroma; - local729 = SceneGraph.anIntArray293[local173]--; - } - } - } - if (local168 >= 0) { - local173 = 0; - local194 = 0; - local178 = 0; - local200 = 0; - local202 = 0; - for (local209 = -5; local209 < 104; local209++) { - local349 = local209 + 5; - if (local349 < 104) { - local178 += SceneGraph.anIntArray325[local349]; - local202 += SceneGraph.anIntArray293[local349]; - local173 += SceneGraph.anIntArray376[local349]; - local200 += SceneGraph.anIntArray479[local349]; - local194 += SceneGraph.anIntArray568[local349]; - } - local234 = local209 - 5; - if (local234 >= 0) { - local178 -= SceneGraph.anIntArray325[local234]; - local200 -= SceneGraph.anIntArray479[local234]; - local173 -= SceneGraph.anIntArray376[local234]; - local202 -= SceneGraph.anIntArray293[local234]; - local194 -= SceneGraph.anIntArray568[local234]; - } - if (local209 >= 0 && local202 > 0) { - local142[local168][local209] = Static54.method1309(local194 / local202, local178 / local202, local173 * 256 / local200); - } - } - } - } - for (local168 = 1; local168 < 103; local168++) { - label771: for (local173 = 1; local173 < 103; local173++) { - if (underwater || SceneGraph.allLevelsAreVisible() || (SceneGraph.tileFlags[0][local168][local173] & 0x2) != 0 || (SceneGraph.tileFlags[local152][local168][local173] & 0x10) == 0 && Static4.method22(local173, local168, local152) == LoginManager.centralPlane) { - if (SceneGraph.firstVisibleLevel > local152) { - SceneGraph.firstVisibleLevel = local152; - } - local178 = SceneGraph.tileUnderlays[local152][local168][local173] & 0xFF; - local194 = SceneGraph.tileOverlays[local152][local168][local173] & 0xFF; - if (local178 > 0 || local194 > 0) { - local202 = SceneGraph.tileHeights[local152][local168 + 1][local173]; - local200 = SceneGraph.tileHeights[local152][local168][local173]; - local349 = SceneGraph.tileHeights[local152][local168][local173 + 1]; - local209 = SceneGraph.tileHeights[local152][local168 + 1][local173 + 1]; - if (local152 > 0) { - @Pc(1067) boolean local1067 = true; - if (local178 == 0 && SceneGraph.tileShapes[local152][local168][local173] != 0) { - local1067 = false; - } - if (local194 > 0 && !FloTypeList.method4395(local194 - 1).aBoolean312) { - local1067 = false; - } - if (local1067 && local200 == local202 && local200 == local209 && local349 == local200) { - SceneGraph.anIntArrayArrayArray6[local152][local168][local173] |= 0x4; - } - } - if (local178 <= 0) { - local234 = -1; - local254 = 0; - } else { - local234 = local142[local168][local173]; - local267 = (local234 & 0x7F) + x; - if (local267 < 0) { - local267 = 0; - } else if (local267 > 127) { - local267 = 127; - } - local273 = (local234 & 0x380) + (local234 + level & 0xFC00) + local267; - local254 = Rasteriser.palette[Static87.method1814(96, local273)]; - } - local267 = local146[local168][local173]; - local332 = local146[local168][local173 + 1]; - local273 = local146[local168 + 1][local173]; - local326 = local146[local168 + 1][local173 + 1]; - if (local194 == 0) { - Static176.method3305(local152, local168, local173, 0, 0, -1, local200, local202, local209, local349, Static87.method1814(local267, local234), Static87.method1814(local273, local234), Static87.method1814(local326, local234), Static87.method1814(local332, local234), 0, 0, 0, 0, local254, 0); - if (GlRenderer.enabled && local152 > 0 && local234 != -1 && FluTypeList.get(local178 - 1).aBoolean198) { - Static242.method4197(0, 0, true, false, local168, local173, local200 - SceneGraph.tileHeights[0][local168][local173], -SceneGraph.tileHeights[0][local168 + 1][local173] + local202, local209 - SceneGraph.tileHeights[0][local168 + 1][local173 + 1], local349 - SceneGraph.tileHeights[0][local168][local173 + 1]); - } - if (GlRenderer.enabled && !underwater && SceneGraph.anIntArrayArray11 != null && local152 == 0) { - for (local322 = local168 - 1; local322 <= local168 + 1; local322++) { - for (@Pc(1794) int local1794 = local173 - 1; local1794 <= local173 + 1; local1794++) { - if ((local322 != local168 || local173 != local1794) && local322 >= 0 && local322 < 104 && local1794 >= 0 && local1794 < 104) { - @Pc(1834) int local1834 = SceneGraph.tileOverlays[local152][local322][local1794] & 0xFF; - if (local1834 != 0) { - @Pc(1842) FloType local1842 = FloTypeList.method4395(local1834 - 1); - if (local1842.texture != -1 && Rasteriser.textureProvider.getMaterialType(local1842.texture) == MaterialManager.WATER) { - SceneGraph.anIntArrayArray11[local168][local173] = local1842.anInt5889 + (local1842.anInt5898 << 24); - continue label771; - } - } - } - } - } - } - } else { - local322 = SceneGraph.tileShapes[local152][local168][local173] + 1; - @Pc(1242) byte local1242 = SceneGraph.tileAngles[local152][local168][local173]; - @Pc(1248) FloType local1248 = FloTypeList.method4395(local194 - 1); - @Pc(1301) int local1301; - @Pc(1353) int local1353; - @Pc(1288) int local1288; - if (GlRenderer.enabled && !underwater && SceneGraph.anIntArrayArray11 != null && local152 == 0) { - if (local1248.texture != -1 && Rasteriser.textureProvider.getMaterialType(local1248.texture) == MaterialManager.WATER) { - SceneGraph.anIntArrayArray11[local168][local173] = (local1248.anInt5898 << 24) + local1248.anInt5889; - } else { - label737: for (local1288 = local168 - 1; local1288 <= local168 + 1; local1288++) { - for (local1301 = local173 - 1; local1301 <= local173 + 1; local1301++) { - if ((local168 != local1288 || local1301 != local173) && local1288 >= 0 && local1288 < 104 && local1301 >= 0 && local1301 < 104) { - local1353 = SceneGraph.tileOverlays[local152][local1288][local1301] & 0xFF; - if (local1353 != 0) { - @Pc(1366) FloType local1366 = FloTypeList.method4395(local1353 - 1); - if (local1366.texture != -1 && Rasteriser.textureProvider.getMaterialType(local1366.texture) == MaterialManager.WATER) { - SceneGraph.anIntArrayArray11[local168][local173] = local1366.anInt5889 + (local1366.anInt5898 << 24); - break label737; - } - } - } - } - } - } - } - local1288 = local1248.texture; - if (local1288 >= 0 && !Rasteriser.textureProvider.method3236(local1288)) { - local1288 = -1; - } - @Pc(1458) int local1458; - @Pc(1429) int local1429; - if (local1288 >= 0) { - local1301 = -1; - local1353 = Rasteriser.palette[Static230.method3949(Rasteriser.textureProvider.getAverageColor(local1288), 96)]; - } else if (local1248.anInt5899 == -1) { - local1301 = -2; - local1353 = 0; - } else { - local1301 = local1248.anInt5899; - local1429 = x + (local1301 & 0x7F); - if (local1429 < 0) { - local1429 = 0; - } else if (local1429 > 127) { - local1429 = 127; - } - local1458 = (local1301 & 0x380) + ((local1301 + level & 0xFC00) + local1429); - local1353 = Rasteriser.palette[Static230.method3949(local1458, 96)]; - } - if (local1248.anInt5894 >= 0) { - local1429 = local1248.anInt5894; - local1458 = x + (local1429 & 0x7F); - if (local1458 < 0) { - local1458 = 0; - } else if (local1458 > 127) { - local1458 = 127; - } - @Pc(1529) int local1529 = (local1429 & 0x380) + ((local1429 + level & 0xFC00) + local1458); - local1353 = Rasteriser.palette[Static230.method3949(local1529, 96)]; - } - Static176.method3305(local152, local168, local173, local322, local1242, local1288, local200, local202, local209, local349, Static87.method1814(local267, local234), Static87.method1814(local273, local234), Static87.method1814(local326, local234), Static87.method1814(local332, local234), Static230.method3949(local1301, local267), Static230.method3949(local1301, local273), Static230.method3949(local1301, local326), Static230.method3949(local1301, local332), local254, local1353); - if (GlRenderer.enabled && local152 > 0) { - Static242.method4197(local322, local1242, local1301 == -2 || !local1248.aBoolean311, local234 == -1 || !FluTypeList.get(local178 - 1).aBoolean198, local168, local173, local200 - SceneGraph.tileHeights[0][local168][local173], local202 - SceneGraph.tileHeights[0][local168 + 1][local173], local209 - SceneGraph.tileHeights[0][local168 + 1][local173 + 1], -SceneGraph.tileHeights[0][local168][local173 + 1] + local349); - } - } - } - } - } - } - if (GlRenderer.enabled) { - @Pc(1888) float[][] local1888 = new float[105][105]; - @Pc(1892) int[][] local1892 = SceneGraph.tileHeights[local152]; - @Pc(1896) float[][] local1896 = new float[105][105]; - @Pc(1900) float[][] local1900 = new float[105][105]; - local200 = 1; - while (true) { - if (local200 > 103) { - @Pc(2025) GlTile[] local2025; - if (underwater) { - local2025 = Static193.method3501(SceneGraph.tileFlags, SceneGraph.tileShapes[local152], SceneGraph.tileUnderlays[local152], local146, local1896, SceneGraph.anIntArrayArray11, SceneGraph.tileOverlays[local152], SceneGraph.tileAngles[local152], local1888, local152, local1900, local142, SceneGraph.tileHeights[local152], SceneGraph.surfaceTileHeights[0]); - method2280(local152, local2025); - break; - } - local2025 = Static193.method3501(SceneGraph.tileFlags, SceneGraph.tileShapes[local152], SceneGraph.tileUnderlays[local152], local146, local1896, null, SceneGraph.tileOverlays[local152], SceneGraph.tileAngles[local152], local1888, local152, local1900, local142, SceneGraph.tileHeights[local152], null); - @Pc(2049) GlTile[] local2049 = Static1.method2(local1896, local1888, SceneGraph.tileHeights[local152], local152, local1900, SceneGraph.tileAngles[local152], local146, SceneGraph.tileShapes[local152], SceneGraph.tileUnderlays[local152], SceneGraph.tileOverlays[local152], SceneGraph.tileFlags); - @Pc(2057) GlTile[] local2057 = new GlTile[local2025.length + local2049.length]; - for (local349 = 0; local349 < local2025.length; local349++) { - local2057[local349] = local2025[local349]; - } - for (local349 = 0; local349 < local2049.length; local349++) { - local2057[local2025.length + local349] = local2049[local349]; - } - method2280(local152, local2057); - Static221.method3393(local1900, SceneGraph.tileUnderlays[local152], SceneGraph.tileAngles[local152], LightingManager.lights, local152, LightingManager.lightCount, local1896, SceneGraph.tileShapes[local152], SceneGraph.tileOverlays[local152], SceneGraph.tileHeights[local152], local1888); - break; - } - for (local202 = 1; local202 <= 103; local202++) { - local349 = local1892[local202][local200 + 1] - local1892[local202][local200 - 1]; - local209 = local1892[local202 + 1][local200] - local1892[local202 - 1][local200]; - @Pc(1962) float local1962 = (float) Math.sqrt((double) (local209 * local209 + local349 * local349 + 65536)); - local1888[local202][local200] = (float) local209 / local1962; - local1896[local202][local200] = -256.0F / local1962; - local1900[local202][local200] = (float) local349 / local1962; - } - local200++; - } - } - SceneGraph.tileUnderlays[local152] = null; - SceneGraph.tileOverlays[local152] = null; - SceneGraph.tileShapes[local152] = null; - SceneGraph.tileAngles[local152] = null; - SceneGraph.aByteArrayArrayArray9[local152] = null; - } - Static220.method3801(); - if (underwater) { - return; - } - @Pc(2204) int local2204; - for (local152 = 0; local152 < 104; local152++) { - for (local2204 = 0; local2204 < 104; local2204++) { - if ((SceneGraph.tileFlags[1][local152][local2204] & 0x2) == 2) { - Static224.method3884(local152, local2204); - } - } - } - for (local152 = 0; local152 < 4; local152++) { - for (local2204 = 0; local2204 <= 104; local2204++) { - for (local168 = 0; local168 <= 104; local168++) { - if ((SceneGraph.anIntArrayArrayArray6[local152][local168][local2204] & 0x1) != 0) { - local200 = local152; - for (local173 = local2204; local173 > 0 && (SceneGraph.anIntArrayArrayArray6[local152][local168][local173 - 1] & 0x1) != 0; local173--) { - } - local194 = local152; - for (local178 = local2204; local178 < 104 && (SceneGraph.anIntArrayArrayArray6[local152][local168][local178 + 1] & 0x1) != 0; local178++) { - } - label454: while (local194 > 0) { - for (local202 = local173; local202 <= local178; local202++) { - if ((SceneGraph.anIntArrayArrayArray6[local194 - 1][local168][local202] & 0x1) == 0) { - break label454; - } - } - local194--; - } - label443: while (local200 < 3) { - for (local202 = local173; local202 <= local178; local202++) { - if ((SceneGraph.anIntArrayArrayArray6[local200 + 1][local168][local202] & 0x1) == 0) { - break label443; - } - } - local200++; - } - local202 = (local200 + 1 - local194) * (-local173 + (local178 - -1)); - if (local202 >= 8) { - local349 = SceneGraph.tileHeights[local200][local168][local173] - 240; - local234 = SceneGraph.tileHeights[local194][local168][local173]; - method4647(1, local168 * 128, local168 * 128, local173 * 128, local178 * 128 + 128, local349, local234); - for (local254 = local194; local254 <= local200; local254++) { - for (local267 = local173; local267 <= local178; local267++) { - SceneGraph.anIntArrayArrayArray6[local254][local168][local267] &= 0xFFFFFFFE; - } - } - } - } - if ((SceneGraph.anIntArrayArrayArray6[local152][local168][local2204] & 0x2) != 0) { - for (local173 = local168; local173 > 0 && (SceneGraph.anIntArrayArrayArray6[local152][local173 - 1][local2204] & 0x2) != 0; local173--) { - } - local200 = local152; - local194 = local152; - for (local178 = local168; local178 < 104 && (SceneGraph.anIntArrayArrayArray6[local152][local178 + 1][local2204] & 0x2) != 0; local178++) { - } - label508: while (local194 > 0) { - for (local202 = local173; local202 <= local178; local202++) { - if ((SceneGraph.anIntArrayArrayArray6[local194 - 1][local202][local2204] & 0x2) == 0) { - break label508; - } - } - local194--; - } - label497: while (local200 < 3) { - for (local202 = local173; local202 <= local178; local202++) { - if ((SceneGraph.anIntArrayArrayArray6[local200 + 1][local202][local2204] & 0x2) == 0) { - break label497; - } - } - local200++; - } - local202 = (local178 + 1 - local173) * (-local194 + local200 - -1); - if (local202 >= 8) { - local349 = SceneGraph.tileHeights[local200][local173][local2204] - 240; - local234 = SceneGraph.tileHeights[local194][local173][local2204]; - method4647(2, local173 * 128, local178 * 128 + 128, local2204 * 128, local2204 * 128, local349, local234); - for (local254 = local194; local254 <= local200; local254++) { - for (local267 = local173; local267 <= local178; local267++) { - SceneGraph.anIntArrayArrayArray6[local254][local267][local2204] &= 0xFFFFFFFD; - } - } - } - } - if ((SceneGraph.anIntArrayArrayArray6[local152][local168][local2204] & 0x4) != 0) { - local173 = local168; - local178 = local168; - for (local194 = local2204; local194 > 0 && (SceneGraph.anIntArrayArrayArray6[local152][local168][local194 - 1] & 0x4) != 0; local194--) { - } - for (local200 = local2204; local200 < 104 && (SceneGraph.anIntArrayArrayArray6[local152][local168][local200 + 1] & 0x4) != 0; local200++) { - } - label562: while (local173 > 0) { - for (local202 = local194; local202 <= local200; local202++) { - if ((SceneGraph.anIntArrayArrayArray6[local152][local173 - 1][local202] & 0x4) == 0) { - break label562; - } - } - local173--; - } - label551: while (local178 < 104) { - for (local202 = local194; local202 <= local200; local202++) { - if ((SceneGraph.anIntArrayArrayArray6[local152][local178 + 1][local202] & 0x4) == 0) { - break label551; - } - } - local178++; - } - if ((local178 + 1 - local173) * (local200 - (local194 - 1)) >= 4) { - local202 = SceneGraph.tileHeights[local152][local173][local194]; - method4647(4, local173 * 128, local178 * 128 + 128, local194 * 128, local200 * 128 + 128, local202, local202); - for (local209 = local173; local209 <= local178; local209++) { - for (local349 = local194; local349 <= local200; local349++) { - SceneGraph.anIntArrayArrayArray6[local152][local209][local349] &= 0xFFFFFFFB; - } - } - } - } - } - } - } - } - - @OriginalMember(owner = "client!wj", name = "a", descriptor = "(IIIIIII)V") - public static void method4647(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) int arg4, @OriginalArg(5) int arg5, @OriginalArg(6) int arg6) { - @Pc(3) Class120 local3 = new Class120(); - local3.anInt4452 = arg1 / 128; - local3.anInt4446 = arg2 / 128; - local3.anInt4461 = arg3 / 128; - local3.anInt4464 = arg4 / 128; - local3.anInt4453 = arg0; - local3.anInt4460 = arg1; - local3.anInt4445 = arg2; - local3.anInt4458 = arg3; - local3.anInt4449 = arg4; - local3.anInt4444 = arg5; - local3.anInt4447 = arg6; - SceneGraph.aClass120Array1[SceneGraph.anInt917++] = local3; - } - - @OriginalMember(owner = "client!ih", name = "a", descriptor = "(I[Lclient!hg;)V") - public static void method2280(@OriginalArg(0) int arg0, @OriginalArg(1) GlTile[] arg1) { - SceneGraph.underwaterHdTiles[arg0] = arg1; - } -} diff --git a/client/src/main/java/rt4/Static47.java b/client/src/main/java/rt4/Static47.java deleted file mode 100644 index cd540fe..0000000 --- a/client/src/main/java/rt4/Static47.java +++ /dev/null @@ -1,25 +0,0 @@ -package rt4; - -import org.openrs2.deob.annotation.OriginalArg; -import org.openrs2.deob.annotation.OriginalMember; -import org.openrs2.deob.annotation.Pc; - -public final class Static47 { - - @OriginalMember(owner = "client!dk", name = "a", descriptor = "(III)Lclient!ec;") - public static Scenery method3996(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2) { - @Pc(7) Tile local7 = SceneGraph.tiles[arg0][arg1][arg2]; - if (local7 == null) { - return null; - } - for (@Pc(13) int local13 = 0; local13 < local7.sceneryLen; local13++) { - @Pc(22) Scenery local22 = local7.scenery[local13]; - if ((local22.key >> 29 & 0x3L) == 2L && local22.anInt1701 == arg1 && local22.anInt1696 == arg2) { - Static266.method4193(local22); - return local22; - } - } - return null; - } - -} diff --git a/client/src/main/java/rt4/Static69.java b/client/src/main/java/rt4/Static69.java index 170ba53..39f5c3e 100644 --- a/client/src/main/java/rt4/Static69.java +++ b/client/src/main/java/rt4/Static69.java @@ -40,7 +40,7 @@ public final class Static69 { for (@Pc(46) int local46 = 0; local46 < local42.sceneryLen; local46++) { @Pc(55) Scenery local55 = local42.scenery[local46]; if ((local55.key & 0x400000L) == 4194304L) { - @Pc(66) int local66 = local55.primary.getMinY(); + @Pc(66) int local66 = local55.entity.getMinY(); if (local66 != -32768 && local66 < local34) { local34 = local66; } @@ -62,7 +62,7 @@ public final class Static69 { @Pc(11) int local11 = arg3 - 1; @Pc(15) int local15 = arg3 + arg5; for (@Pc(17) int local17 = arg1; local17 <= arg1 + 1; local17++) { - if (local17 != SceneGraph.anInt3114) { + if (local17 != SceneGraph.levels) { for (@Pc(28) int local28 = local3; local28 <= local7; local28++) { if (local28 >= 0 && local28 < SceneGraph.width) { for (@Pc(39) int local39 = local11; local39 <= local15; local39++) { @@ -75,16 +75,16 @@ public final class Static69 { if (local161.primary.method4543()) { arg0.method4544(local161.primary, (local28 - arg2) * 128 + (1 - arg4) * 64, local158, (local39 - arg3) * 128 + (1 - arg5) * 64, local1); } - if (local161.aClass8_6 != null && local161.aClass8_6.method4543()) { - arg0.method4544(local161.aClass8_6, (local28 - arg2) * 128 + (1 - arg4) * 64, local158, (local39 - arg3) * 128 + (1 - arg5) * 64, local1); + if (local161.secondary != null && local161.secondary.method4543()) { + arg0.method4544(local161.secondary, (local28 - arg2) * 128 + (1 - arg4) * 64, local158, (local39 - arg3) * 128 + (1 - arg5) * 64, local1); } } for (@Pc(232) int local232 = 0; local232 < local71.sceneryLen; local232++) { @Pc(241) Scenery local241 = local71.scenery[local232]; - if (local241 != null && local241.primary.method4543() && (local28 == local241.anInt1701 || local28 == local3) && (local39 == local241.anInt1696 || local39 == local11)) { - @Pc(270) int local270 = local241.anInt1713 + 1 - local241.anInt1701; - @Pc(278) int local278 = local241.anInt1698 + 1 - local241.anInt1696; - arg0.method4544(local241.primary, (local241.anInt1701 - arg2) * 128 + (local270 - arg4) * 64, local158, (local241.anInt1696 - arg3) * 128 + (local278 - arg5) * 64, local1); + if (local241 != null && local241.entity.method4543() && (local28 == local241.xMin || local28 == local3) && (local39 == local241.zMin || local39 == local11)) { + @Pc(270) int local270 = local241.xMax + 1 - local241.xMin; + @Pc(278) int local278 = local241.zMax + 1 - local241.zMin; + arg0.method4544(local241.entity, (local241.xMin - arg2) * 128 + (local270 - arg4) * 64, local158, (local241.zMin - arg3) * 128 + (local278 - arg5) * 64, local1); } } } diff --git a/client/src/main/java/rt4/Static70.java b/client/src/main/java/rt4/Static70.java index 671103d..02562dd 100644 --- a/client/src/main/java/rt4/Static70.java +++ b/client/src/main/java/rt4/Static70.java @@ -56,9 +56,9 @@ public final class Static70 { local72 = 127; } local95 = (local66 & 0x380) + (arg1 + local66 & 0xFC00) + local72; - local53 = Rasteriser.palette[Static230.method3949(local95, 96)]; + local53 = Rasteriser.palette[ColorUtils.multiplyLightnessGrayscale(local95, 96)]; } else if (local24 >= 0) { - local53 = Rasteriser.palette[Static230.method3949(Rasteriser.textureProvider.getAverageColor(local24), 96)]; + local53 = Rasteriser.palette[ColorUtils.multiplyLightnessGrayscale(Rasteriser.textureProvider.getAverageColor(local24), 96)]; } else if (local18.anInt5899 == -1) { local53 = -1; } else { @@ -70,7 +70,7 @@ public final class Static70 { local72 = 127; } local95 = local72 + (local66 & 0x380) + (local66 + arg1 & 0xFC00); - local53 = Rasteriser.palette[Static230.method3949(local95, 96)]; + local53 = Rasteriser.palette[ColorUtils.multiplyLightnessGrayscale(local95, 96)]; } WorldMap.overlayColors[local11 + 1] = local53; } diff --git a/client/src/main/java/rt4/Static75.java b/client/src/main/java/rt4/Static75.java index 637bb5d..f73d475 100644 --- a/client/src/main/java/rt4/Static75.java +++ b/client/src/main/java/rt4/Static75.java @@ -1,6 +1,5 @@ package rt4; -import org.openrs2.deob.annotation.OriginalArg; import org.openrs2.deob.annotation.OriginalMember; import org.openrs2.deob.annotation.Pc; @@ -16,16 +15,4 @@ public final class Static75 { } } - @OriginalMember(owner = "client!g", name = "a", descriptor = "(III)Lclient!df;") - public static WallDecor method1633(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2) { - @Pc(7) Tile local7 = SceneGraph.tiles[arg0][arg1][arg2]; - if (local7 == null) { - return null; - } else { - @Pc(14) WallDecor local14 = local7.wallDecor; - local7.wallDecor = null; - return local14; - } - } - } diff --git a/client/src/main/java/rt4/Static87.java b/client/src/main/java/rt4/Static87.java index 41a8f06..a8b2a1c 100644 --- a/client/src/main/java/rt4/Static87.java +++ b/client/src/main/java/rt4/Static87.java @@ -901,20 +901,6 @@ public final class Static87 { } } - @OriginalMember(owner = "client!gn", name = "a", descriptor = "(IZI)I") - public static int method1814(@OriginalArg(0) int arg0, @OriginalArg(2) int arg1) { - if (arg1 == -1) { - return 12345678; - } - arg0 = arg0 * (arg1 & 0x7F) >> 7; - if (arg0 < 2) { - arg0 = 2; - } else if (arg0 > 126) { - arg0 = 126; - } - return arg0 + (arg1 & 0xFF80); - } - @OriginalMember(owner = "client!fn", name = "a", descriptor = "(BIIIII)V") public static void method1624(@OriginalArg(1) int arg0, @OriginalArg(2) int arg1, @OriginalArg(3) int arg2, @OriginalArg(4) int arg3, @OriginalArg(5) int arg4) { Sprites.scrollbars[0].renderTransparent(arg2, arg3); diff --git a/client/src/main/java/rt4/Static91.java b/client/src/main/java/rt4/Static91.java index 0734151..8682d72 100644 --- a/client/src/main/java/rt4/Static91.java +++ b/client/src/main/java/rt4/Static91.java @@ -20,7 +20,7 @@ public final class Static91 { local6.anInt1393 = arg2 * 128 + 64; local6.anInt1391 = arg3; local6.primary = arg4; - local6.aClass8_2 = arg5; + local6.secondary = arg5; local6.anInt1395 = arg6; local6.anInt1388 = arg7; local6.anInt1394 = arg8; diff --git a/client/src/main/java/rt4/Tile.java b/client/src/main/java/rt4/Tile.java index 193dc41..0850569 100644 --- a/client/src/main/java/rt4/Tile.java +++ b/client/src/main/java/rt4/Tile.java @@ -53,13 +53,13 @@ public final class Tile extends Node { public ObjStackEntity aClass79_1; @OriginalMember(owner = "client!bj", name = "D", descriptor = "I") - public int anInt664 = 0; + public int allInteriorFlags = 0; @OriginalMember(owner = "client!bj", name = "w", descriptor = "[Lclient!ec;") public final Scenery[] scenery = new Scenery[5]; @OriginalMember(owner = "client!bj", name = "P", descriptor = "[I") - public final int[] anIntArray59 = new int[5]; + public final int[] interiorFlags = new int[5]; @OriginalMember(owner = "client!bj", name = "H", descriptor = "I") public final int anInt666; diff --git a/client/src/main/java/rt4/Wall.java b/client/src/main/java/rt4/Wall.java index 39373e0..22456d9 100644 --- a/client/src/main/java/rt4/Wall.java +++ b/client/src/main/java/rt4/Wall.java @@ -7,16 +7,16 @@ import org.openrs2.deob.annotation.OriginalMember; public final class Wall { @OriginalMember(owner = "client!jh", name = "a", descriptor = "I") - public int anInt3044; + public int zFine; @OriginalMember(owner = "client!jh", name = "e", descriptor = "Lclient!th;") public Entity primary; @OriginalMember(owner = "client!jh", name = "h", descriptor = "Lclient!th;") - public Entity aClass8_6; + public Entity secondary; @OriginalMember(owner = "client!jh", name = "k", descriptor = "I") - public int anInt3048; + public int xFine; @OriginalMember(owner = "client!jh", name = "l", descriptor = "I") public int anInt3049; diff --git a/client/src/main/java/rt4/WallDecor.java b/client/src/main/java/rt4/WallDecor.java index 04f6293..5a1ff73 100644 --- a/client/src/main/java/rt4/WallDecor.java +++ b/client/src/main/java/rt4/WallDecor.java @@ -10,7 +10,7 @@ public final class WallDecor { public int anInt1388; @OriginalMember(owner = "client!df", name = "d", descriptor = "Lclient!th;") - public Entity aClass8_2; + public Entity secondary; @OriginalMember(owner = "client!df", name = "e", descriptor = "I") public int anInt1390; diff --git a/client/src/main/java/rt4/WorldMap.java b/client/src/main/java/rt4/WorldMap.java index d9615ee..0c89677 100644 --- a/client/src/main/java/rt4/WorldMap.java +++ b/client/src/main/java/rt4/WorldMap.java @@ -156,13 +156,13 @@ public class WorldMap { @Pc(235) int length = WorldMap.length >> 6; @Pc(239) int width = WorldMap.width >> 6; aByteArrayArrayArray8 = new byte[width][length][]; - @Pc(249) int local249 = Static45.anInt2293 >> 2 << 10; + @Pc(249) int local249 = SceneGraph.anInt2293 >> 2 << 10; aByteArrayArrayArray7 = new byte[width][length][]; underlayColors = new int[width][length][]; aByteArrayArrayArray3 = new byte[width][length][]; anIntArrayArrayArray17 = new int[width][length][]; aByteArrayArrayArray12 = new byte[width][length][]; - @Pc(273) int local273 = Static183.anInt4272 >> 1; + @Pc(273) int local273 = SceneGraph.anInt4272 >> 1; aByteArrayArrayArray10 = new byte[width][length][]; scenery = new int[width][length][]; Static70.loadOverlayColors(local273, local249); @@ -375,7 +375,7 @@ public class WorldMap { local519 = 127; } @Pc(541) int local541 = local519 + (local480 & 0x380) + (local480 + local19 & 0xFC00); - local462[((local367 & 0x3F) << 6) + (local102 & 0x3F)] = Rasteriser.palette[Static87.method1814(96, local541)]; + local462[((local367 & 0x3F) << 6) + (local102 & 0x3F)] = Rasteriser.palette[ColorUtils.multiplyLightnessSafe(96, local541)]; } else if (local462 != null) { local462[((local367 & 0x3F) << 6) + (local102 & 0x3F)] = 0; }