A RuneTek3 client (377) that is deobfuscated, converted to Kotlin, and includes QoL improvements.
0

Configure Feed

Select the types of activity you want to include in your feed.

!checkIfIndexExists = checkIfIndexDoesNotExist

+9 -9
+9 -9
src/main/java/com/jagex/runescape/world/GroundArray.java
··· 14 14 this.groundArray = new Object[MAX_HEIGHT][MAX_TILES][MAX_TILES]; 15 15 } 16 16 17 - private boolean checkIfIndexExists(int plane, int x, int y) { 17 + private boolean checkIfIndexDoesNotExist(int plane, int x, int y) { 18 18 if (plane < 0 || plane > this.groundArray.length - 1) { 19 19 String error = String.format("Plane must be between 0 and %d, requested plane was: %d.\n", 20 20 this.groundArray.length - 1, plane); 21 21 new ArrayIndexOutOfBoundsException(error).printStackTrace(); 22 - return false; 22 + return true; 23 23 } 24 24 if (x < 0 || x > MAX_TILES - 1) { 25 25 String error = String.format("X must be between 0 and %d, requested x was: %d.\n", MAX_TILES - 1, x); 26 26 new ArrayIndexOutOfBoundsException(error).printStackTrace(); 27 - return false; 27 + return true; 28 28 } 29 29 if (y < 0 || y > MAX_TILES - 1) { 30 30 String error = String.format("Y must be between 0 and %d, requested y was: %d.\n", MAX_TILES - 1, y); 31 31 new ArrayIndexOutOfBoundsException(error).printStackTrace(); 32 - return false; 32 + return true; 33 33 } 34 - return true; 34 + return false; 35 35 } 36 36 37 37 public boolean isTileEmpty(int plane, int x, int y) { 38 - if (!checkIfIndexExists(plane, x, y)) { 38 + if (checkIfIndexDoesNotExist(plane, x, y)) { 39 39 return false; 40 40 } 41 41 return groundArray[plane][x][y] == null; 42 42 } 43 43 44 44 public void clearTile(int plane, int x, int y) { 45 - if (!checkIfIndexExists(plane, x, y)) { 45 + if (checkIfIndexDoesNotExist(plane, x, y)) { 46 46 return; 47 47 } 48 48 groundArray[plane][x][y] = null; 49 49 } 50 50 51 51 public T getTile(int plane, int x, int y) { 52 - if (!checkIfIndexExists(plane, x, y)) { 52 + if (checkIfIndexDoesNotExist(plane, x, y)) { 53 53 return null; 54 54 } 55 55 return (T) groundArray[plane][x][y]; 56 56 } 57 57 58 58 public T setTile(int plane, int x, int y, T tile) { 59 - if (!checkIfIndexExists(plane, x, y)) { 59 + if (checkIfIndexDoesNotExist(plane, x, y)) { 60 60 return null; 61 61 } 62 62 groundArray[plane][x][y] = tile;