public static SharedStorage load(WorldDataBase<?> worldStorage,NBTTagCompound nbt,boolean packet){
  try {
    ResourceLocation type=new ResourceLocation(nbt.getString("type"));
    UUID uuid=nbt.getUniqueId("uuid");
    Class<? extends SharedStorage> storageClass=SharedStorage.getStorageType(type);
    if (storageClass == null)     throw new Exception("Shared storage type not mapped");
    Constructor<? extends SharedStorage> ctor=storageClass.getConstructor(WorldDataBase.class,UUID.class);
    SharedStorage storage=ctor.newInstance(worldStorage,uuid);
    if (packet) {
      storage.readFromPacketNBT(nbt.getCompoundTag("data"));
    }
 else {
      storage.readFromNBT(nbt.getCompoundTag("data"));
    }
    return storage;
  }
 catch (  Exception ex) {
    throw new RuntimeException(ex);
  }
}

public static SharedStorage load ( WorldDataBase < ? > worldStorage , NBTTagCompound nbt , boolean packet ) { try { ResourceLocation type = new ResourceLocation ( nbt . getString ( "type" ) ) ; UUID uuid = nbt . getUniqueId ( "uuid" ) ; Class < ? extends SharedStorage > storageClass = SharedStorage . getStorageType ( type ) ; if ( storageClass == null ) throw new Exception ( "Shared storage type not mapped" ) ; Constructor < ? extends SharedStorage > ctor = storageClass . getConstructor ( WorldDataBase . class , UUID . class ) ; SharedStorage storage = ctor . newInstance ( worldStorage , uuid ) ; if ( packet ) { storage . readFromPacketNBT ( nbt . getCompoundTag ( "data" ) ) ; } else { storage . readFromNBT ( nbt . getCompoundTag ( "data" ) ) ; } return storage ; } catch ( Exception ex ) { throw new RuntimeException ( ex ) ; } }
loads a shared storage from nbt
