public static ChunkStorage load(World world,ChunkDataBase chunkData,NBTTagCompound nbt,boolean packet){
  try {
    ResourceLocation type=new ResourceLocation(nbt.getString("type"));
    Class<? extends ChunkStorage> storageClass=ChunkStorage.getStorageType(type);
    if (storageClass == null)     throw new Exception("Chunk storage type not mapped");
    Constructor<? extends ChunkStorage> ctor=storageClass.getConstructor(World.class,ChunkDataBase.class);
    ChunkStorage storage=ctor.newInstance(world,chunkData);
    if (packet) {
      storage.readFromPacketNBT(nbt.getCompoundTag("storage"));
    }
 else {
      storage.readFromNBT(nbt.getCompoundTag("storage"));
    }
    return storage;
  }
 catch (  Exception ex) {
    throw new RuntimeException(ex);
  }
}

public static ChunkStorage load ( World world , ChunkDataBase chunkData , NBTTagCompound nbt , boolean packet ) { try { ResourceLocation type = new ResourceLocation ( nbt . getString ( "type" ) ) ; Class < ? extends ChunkStorage > storageClass = ChunkStorage . getStorageType ( type ) ; if ( storageClass == null ) throw new Exception ( "Chunk storage type not mapped" ) ; Constructor < ? extends ChunkStorage > ctor = storageClass . getConstructor ( World . class , ChunkDataBase . class ) ; ChunkStorage storage = ctor . newInstance ( world , chunkData ) ; if ( packet ) { storage . readFromPacketNBT ( nbt . getCompoundTag ( "storage" ) ) ; } else { storage . readFromNBT ( nbt . getCompoundTag ( "storage" ) ) ; } return storage ; } catch ( Exception ex ) { throw new RuntimeException ( ex ) ; } }
loads a chunk storage from nbt
