13
13
14
14
public class ItemDefinition extends CachedNode implements EntityDefinition {
15
15
public static int count ;
16
- public static CacheArchive itemDefinitionCache ;
17
- public static NodeCache itemDefinitionNodeCache = new NodeCache (64 );
18
- public static NodeCache groundItemModelNodeCache = new NodeCache (50 );
19
- public static NodeCache itemImageCache = new NodeCache (100 );
20
- public static CacheArchive aCacheArchive_284 ;
16
+ public static CacheArchive definitionArchive ;
17
+ public static NodeCache definitionCache = new NodeCache (64 );
18
+ public static NodeCache modelCache = new NodeCache (50 );
19
+ public static NodeCache imageCache = new NodeCache (100 );
20
+ public static CacheArchive modelArchive ;
21
21
22
22
public int stackable ;
23
23
public String name ;
@@ -94,11 +94,11 @@ public ItemDefinition() {
94
94
95
95
96
96
public static ItemDefinition forId (int id , int arg1 ) {
97
- ItemDefinition definition = (ItemDefinition ) itemDefinitionNodeCache .get (id );
97
+ ItemDefinition definition = (ItemDefinition ) definitionCache .get (id );
98
98
if (definition != null ) {
99
99
return definition ;
100
100
}
101
- byte [] is = itemDefinitionCache .getFile (arg1 , id );
101
+ byte [] is = definitionArchive .getFile (arg1 , id );
102
102
definition = new ItemDefinition ();
103
103
definition .id = id ;
104
104
if (is != null ) {
@@ -113,13 +113,13 @@ public static ItemDefinition forId(int id, int arg1) {
113
113
definition .groundOptions = null ;
114
114
definition .name = English .membersObject ;
115
115
}
116
- itemDefinitionNodeCache .put (id , definition );
116
+ definitionCache .put (id , definition );
117
117
return definition ;
118
118
}
119
119
120
120
public static ImageRGB sprite (int stackSize , int id , int backColour ) {
121
121
if (backColour == 0 ) {
122
- ImageRGB sprite = (ImageRGB ) itemImageCache .get ((long ) id );
122
+ ImageRGB sprite = (ImageRGB ) imageCache .get ((long ) id );
123
123
if (sprite != null && sprite .maxHeight != stackSize && sprite .maxHeight != -1 ) {
124
124
sprite .unlink ();
125
125
sprite = null ;
@@ -221,7 +221,7 @@ else if(i_13_ <= 0 || rendered.pixels[i_15_ + (i_13_ + -1) * 32] != 1) {
221
221
notedSprite .maxHeight = i_17_ ;
222
222
}
223
223
if (backColour == 0 )
224
- itemImageCache .put ((long ) id , rendered );
224
+ imageCache .put ((long ) id , rendered );
225
225
Rasterizer .prepare (pixels , i_1_ , i );
226
226
Rasterizer .setBounds (i_2_ , i_5_ , i_4_ , i_6_ );
227
227
Rasterizer3D .setLineOffsets (lineOffsets );
@@ -239,16 +239,20 @@ else if(i_13_ <= 0 || rendered.pixels[i_15_ + (i_13_ + -1) * 32] != 1) {
239
239
}
240
240
241
241
public static void clearItemCache () {
242
- itemDefinitionNodeCache .clear ();
243
- groundItemModelNodeCache .clear ();
244
- itemImageCache .clear ();
242
+ definitionCache .clear ();
243
+ modelCache .clear ();
244
+ imageCache .clear ();
245
245
}
246
246
247
247
public static void initializeItemDefinitionCache (CacheArchive definitionCache , boolean arg1 , CacheArchive arg2 ) {
248
248
MovedStatics .membersServer = arg1 ;
249
- aCacheArchive_284 = arg2 ;
250
- itemDefinitionCache = definitionCache ;
251
- count = itemDefinitionCache .fileLength (10 );
249
+ modelArchive = arg2 ;
250
+ definitionArchive = definitionCache ;
251
+ count = definitionArchive .fileLength (10 );
252
+ }
253
+
254
+ public static void clearImageCache () {
255
+ imageCache .clear ();
252
256
}
253
257
254
258
public boolean headPieceReady (boolean female ) {
@@ -262,10 +266,10 @@ public boolean headPieceReady(boolean female) {
262
266
return true ;
263
267
}
264
268
boolean ready = true ;
265
- if (!aCacheArchive_284 .loaded (primaryId , 0 )) {
269
+ if (!modelArchive .loaded (primaryId , 0 )) {
266
270
ready = false ;
267
271
}
268
- if (secondaryId != -1 && !aCacheArchive_284 .loaded (secondaryId , 0 )) {
272
+ if (secondaryId != -1 && !modelArchive .loaded (secondaryId , 0 )) {
269
273
ready = false ;
270
274
}
271
275
return ready ;
@@ -284,13 +288,13 @@ public boolean equipmentReady(boolean arg0) {
284
288
return true ;
285
289
}
286
290
boolean bool = true ;
287
- if (!aCacheArchive_284 .loaded (i , 0 )) {
291
+ if (!modelArchive .loaded (i , 0 )) {
288
292
bool = false ;
289
293
}
290
- if (i_1_ != -1 && !aCacheArchive_284 .loaded (i_1_ , 0 )) {
294
+ if (i_1_ != -1 && !modelArchive .loaded (i_1_ , 0 )) {
291
295
bool = false ;
292
296
}
293
- if (i_2_ != -1 && !aCacheArchive_284 .loaded (i_2_ , 0 )) {
297
+ if (i_2_ != -1 && !modelArchive .loaded (i_2_ , 0 )) {
294
298
bool = false ;
295
299
}
296
300
return bool ;
@@ -308,14 +312,14 @@ public Model asEquipment(boolean isFemale) {
308
312
if (primaryId == -1 ) {
309
313
return null ;
310
314
}
311
- Model primary = Model .getModel (aCacheArchive_284 , primaryId );
315
+ Model primary = Model .getModel (modelArchive , primaryId );
312
316
if (secondaryId != -1 ) {
313
- Model secondary = Model .getModel (aCacheArchive_284 , secondaryId );
317
+ Model secondary = Model .getModel (modelArchive , secondaryId );
314
318
if (tertiaryId == -1 ) {
315
319
Model [] tertiary = {primary , secondary };
316
320
primary = new Model (tertiary , 2 );
317
321
} else {
318
- Model model3 = Model .getModel (aCacheArchive_284 , tertiaryId );
322
+ Model model3 = Model .getModel (modelArchive , tertiaryId );
319
323
Model [] models = {primary , secondary , model3 };
320
324
primary = new Model (models , 3 );
321
325
}
@@ -362,9 +366,9 @@ public Model asHeadPiece(boolean female) {
362
366
if (primaryId == -1 ) {
363
367
return null ;
364
368
}
365
- Model primary = Model .getModel (aCacheArchive_284 , primaryId );
369
+ Model primary = Model .getModel (modelArchive , primaryId );
366
370
if (secondaryId != -1 ) {
367
- Model secondary = Model .getModel (aCacheArchive_284 , secondaryId );
371
+ Model secondary = Model .getModel (modelArchive , secondaryId );
368
372
Model [] models = {primary , secondary };
369
373
primary = new Model (models , 2 );
370
374
}
@@ -509,11 +513,11 @@ public Model asGroundStack(boolean arg0, int amount) {
509
513
return forId (id , 10 ).asGroundStack (arg0 , 1 );
510
514
}
511
515
}
512
- Model model = (Model ) groundItemModelNodeCache .get (id );
516
+ Model model = (Model ) modelCache .get (id );
513
517
if (model != null ) {
514
518
return model ;
515
519
}
516
- model = Model .getModel (aCacheArchive_284 , inventoryModelId );
520
+ model = Model .getModel (modelArchive , inventoryModelId );
517
521
if (model == null ) {
518
522
return null ;
519
523
}
@@ -528,7 +532,7 @@ public Model asGroundStack(boolean arg0, int amount) {
528
532
if (arg0 ) {
529
533
model .applyLighting (ambient + 64 , 768 + contrast , -50 , -10 , -50 , true );
530
534
model .singleTile = true ;
531
- groundItemModelNodeCache .put (id , model );
535
+ modelCache .put (id , model );
532
536
}
533
537
return model ;
534
538
0 commit comments