Emberveil source

tests/FirePartyhatAssets.java

import java.io.*;
public final class FirePartyhatAssets {
 public static void main(String[]args)throws Exception {
  String root="runtime/ammunition-stage/cache/";
  try(RandomAccessFile dat=new RandomAccessFile(root+"main_file_cache.dat","r");RandomAccessFile i0=new RandomAccessFile(root+"main_file_cache.idx0","r");RandomAccessFile i1=new RandomAccessFile(root+"main_file_cache.idx1","r")){
   Decompressor config=new Decompressor(dat,i0,1),models=new Decompressor(dat,i1,2);
   ItemDef.unpackConfig(new StreamLoader(config.decompress(2)));Model.method459(65000,new OnDemandFetcher());
   Stream versions=new Stream(new StreamLoader(config.decompress(5)).getDataForName("model_version"));
   for(int id=0;id<versions.buffer.length/2;id++)if(versions.readUnsignedWord()!=0)Model.method460(GodWarsAssetCheck.inflate(models.decompress(id)),id);
   ItemDef red=ItemDef.forID(1038);if(!red.name.toLowerCase().contains("red partyhat"))throw new AssertionError("Red hat definition mismatch");
   if(red.method196(0)==null||red.method196(1)==null||red.method194(0)==null||red.method194(1)==null)throw new AssertionError("Hat equipment/head models missing");
   DrawingArea.initDrawingArea(64,64,new int[4096]);Texture.method364();Texture.method372(0.8);
   if(ItemDef.getSprite(1038,1,0)==null)throw new AssertionError("Bank sprite missing");
   System.out.println("PASS red partyhat1038 name, male/female wearable and dialogue models, inventory/bank sprite");
  }
 }
}