Skip to content

Commit ab0da76

Browse files
committed
refactor: rename IdentityKit caches
1 parent de76642 commit ab0da76

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

src/main/java/org/runejs/client/cache/def/IdentityKit.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
import org.runejs.client.node.NodeCache;
88

99
public class IdentityKit extends CachedNode {
10-
public static CacheArchive identityKitCache;
11-
public static NodeCache identityKitNodeCache = new NodeCache(64);
12-
public static int identityKitLength;
13-
public static CacheArchive aCacheArchive_654;
10+
private static CacheArchive identityKitArchive;
11+
private static NodeCache identityKitCache = new NodeCache(64);
12+
public static int count;
13+
private static CacheArchive modelArchive;
1414
public int[] recolorToFind = new int[6];
1515
public int[] recolorToReplace;
1616
public int bodyPartId = -1;
@@ -24,27 +24,27 @@ public IdentityKit() {
2424

2525
// ???
2626
public static IdentityKit cache(int arg1) {
27-
IdentityKit identityKit = (IdentityKit) identityKitNodeCache.get(arg1);
27+
IdentityKit identityKit = (IdentityKit) identityKitCache.get(arg1);
2828
if(identityKit != null) {
2929
return identityKit;
3030
}
31-
byte[] is = identityKitCache.getFile(3, arg1);
31+
byte[] is = identityKitArchive.getFile(3, arg1);
3232
identityKit = new IdentityKit();
3333
if(is != null) {
3434
identityKit.readValues(new Buffer(is));
3535
}
36-
identityKitNodeCache.put(arg1, identityKit);
36+
identityKitCache.put(arg1, identityKit);
3737
return identityKit;
3838
}
3939

4040
public static void clearIdentityKitCache() {
41-
identityKitNodeCache.clear();
41+
identityKitCache.clear();
4242
}
4343

4444
public static void initializeIdentityKitDefinitionCache(CacheArchive definitionCache, CacheArchive arg2) {
45-
aCacheArchive_654 = arg2;
46-
identityKitCache = definitionCache;
47-
identityKitLength = identityKitCache.fileLength(3);
45+
modelArchive = arg2;
46+
identityKitArchive = definitionCache;
47+
count = identityKitArchive.fileLength(3);
4848
}
4949

5050
public void readValues(Buffer buffer) {
@@ -63,7 +63,7 @@ public boolean isBodyModelCached() {
6363
}
6464
boolean isCached = true;
6565
for(int i = 0; modelId.length > i; i++) {
66-
if(!aCacheArchive_654.loaded(modelId[i], 0)) {
66+
if(!modelArchive.loaded(modelId[i], 0)) {
6767
isCached = false;
6868
}
6969
}
@@ -74,7 +74,7 @@ public boolean method624() {
7474
boolean bool = true;
7575
int i = 0;
7676
for(/**/; i < 5; i++) {
77-
if(models[i] != -1 && !aCacheArchive_654.loaded(models[i], 0)) {
77+
if(models[i] != -1 && !modelArchive.loaded(models[i], 0)) {
7878
bool = false;
7979
}
8080
}
@@ -106,7 +106,7 @@ public Model method629() {
106106
int i = 0;
107107
for(int i_7_ = 0; i_7_ < 5; i_7_++) {
108108
if(models[i_7_] != -1) {
109-
class40_sub5_sub17_sub5s[i++] = Model.getModel(aCacheArchive_654, models[i_7_]);
109+
class40_sub5_sub17_sub5s[i++] = Model.getModel(modelArchive, models[i_7_]);
110110
}
111111
}
112112
Model class40_sub5_sub17_sub5 = new Model(class40_sub5_sub17_sub5s, i);
@@ -125,7 +125,7 @@ public Model getBodyModel() {
125125
}
126126
Model[] models = new Model[modelId.length];
127127
for(int i = 0; i < modelId.length; i++) {
128-
models[i] = Model.getModel(aCacheArchive_654, modelId[i]);
128+
models[i] = Model.getModel(modelArchive, modelId[i]);
129129
}
130130
Model model;
131131
if(models.length == 1) {

src/main/java/org/runejs/client/media/renderable/actor/PlayerAppearance.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ public void setPlayerAppearance(int[] appearance, boolean gender, int[] appearan
229229
if(appearance == null) {
230230
appearance = new int[12];
231231
for(int appearanceIndex = 0; appearanceIndex < 7; appearanceIndex++) {
232-
for(int identityKitIndex = 0; IdentityKit.identityKitLength > identityKitIndex; identityKitIndex++) {
232+
for(int identityKitIndex = 0; IdentityKit.count > identityKitIndex; identityKitIndex++) {
233233
IdentityKit identityKit = IdentityKit.cache(identityKitIndex);
234234
if(!identityKit.nonSelectable && identityKit.bodyPartId == appearanceIndex + (!gender ? 0 : 7)) {
235235
appearance[APPEARANCE_INDICES[appearanceIndex]] = identityKitIndex + 256;
@@ -256,10 +256,10 @@ public void loadCachedAppearance(int unknown1, boolean unknown2) {
256256
do {
257257
if(unknown2) {
258258
i++;
259-
if(i >= IdentityKit.identityKitLength)
259+
if(i >= IdentityKit.count)
260260
i = 0;
261261
} else if(--i < 0)
262-
i = -1 + IdentityKit.identityKitLength;
262+
i = -1 + IdentityKit.count;
263263
identityKit = IdentityKit.cache(i);
264264
} while(identityKit == null || identityKit.nonSelectable || identityKit.bodyPartId != unknown1 + (!gender ? 0 : 7));
265265
appearance[APPEARANCE_INDICES[unknown1]] = i + 256;

0 commit comments

Comments
 (0)