public class MappingDataLoader
extends java.lang.Object
Constructor and Description |
---|
MappingDataLoader() |
Modifier and Type | Method and Description |
---|---|
static it.unimi.dsi.fastutil.objects.Object2IntMap<java.lang.String> |
arrayToMap(com.google.gson.JsonArray array)
Returns a map of the array entries hashed by their id value.
|
static void |
enableMappingsCache() |
static java.util.Map<java.lang.String,com.google.gson.JsonObject> |
getMappingsCache()
Returns the cached mappings.
|
static @Nullable java.io.InputStream |
getResource(java.lang.String name) |
static it.unimi.dsi.fastutil.objects.Object2IntMap<java.lang.String> |
indexedObjectToMap(com.google.gson.JsonObject object)
Returns a map of the object entries hashed by their id value.
|
static boolean |
isCacheJsonMappings()
Returns true if a selected number of mappings should be cached.
|
static @Nullable com.google.gson.JsonObject |
loadData(java.lang.String name)
Loads the file from the bundled resources.
|
static @Nullable com.google.gson.JsonObject |
loadData(java.lang.String name,
boolean cacheIfEnabled)
Loads the file from the bundled resources.
|
static @Nullable com.google.gson.JsonObject |
loadFromDataDir(java.lang.String name)
Loads the file from the plugin folder if present, else from the bundled resources.
|
static void |
mapIdentifiers(int[] output,
com.google.gson.JsonArray oldIdentifiers,
com.google.gson.JsonArray newIdentifiers,
boolean warnOnMissing)
Deprecated.
|
static void |
mapIdentifiers(int[] output,
com.google.gson.JsonArray oldIdentifiers,
com.google.gson.JsonArray newIdentifiers,
@Nullable com.google.gson.JsonObject diffIdentifiers,
boolean warnOnMissing) |
static void |
mapIdentifiers(int[] output,
com.google.gson.JsonObject oldIdentifiers,
com.google.gson.JsonObject newIdentifiers)
Deprecated.
|
static void |
mapIdentifiers(int[] output,
com.google.gson.JsonObject oldIdentifiers,
com.google.gson.JsonObject newIdentifiers,
@Nullable com.google.gson.JsonObject diffIdentifiers) |
static void |
mapIdentifiers(int[] output,
com.google.gson.JsonObject oldIdentifiers,
com.google.gson.JsonObject newIdentifiers,
@Nullable com.google.gson.JsonObject diffIdentifiers,
boolean warnOnMissing) |
static void |
mapIdentifiers(Int2IntBiMap output,
com.google.gson.JsonObject oldIdentifiers,
com.google.gson.JsonObject newIdentifiers,
@Nullable com.google.gson.JsonObject diffIdentifiers,
boolean warnOnMissing) |
public static boolean isCacheJsonMappings()
public static void enableMappingsCache()
public static java.util.Map<java.lang.String,com.google.gson.JsonObject> getMappingsCache()
isCacheJsonMappings()
public static @Nullable com.google.gson.JsonObject loadFromDataDir(java.lang.String name)
public static @Nullable com.google.gson.JsonObject loadData(java.lang.String name)
public static @Nullable com.google.gson.JsonObject loadData(java.lang.String name, boolean cacheIfEnabled)
cacheIfEnabled
- whether loaded files should be cachedpublic static void mapIdentifiers(Int2IntBiMap output, com.google.gson.JsonObject oldIdentifiers, com.google.gson.JsonObject newIdentifiers, @Nullable com.google.gson.JsonObject diffIdentifiers, boolean warnOnMissing)
@Deprecated public static void mapIdentifiers(int[] output, com.google.gson.JsonObject oldIdentifiers, com.google.gson.JsonObject newIdentifiers)
public static void mapIdentifiers(int[] output, com.google.gson.JsonObject oldIdentifiers, com.google.gson.JsonObject newIdentifiers, @Nullable com.google.gson.JsonObject diffIdentifiers, boolean warnOnMissing)
public static void mapIdentifiers(int[] output, com.google.gson.JsonObject oldIdentifiers, com.google.gson.JsonObject newIdentifiers, @Nullable com.google.gson.JsonObject diffIdentifiers)
@Deprecated public static void mapIdentifiers(int[] output, com.google.gson.JsonArray oldIdentifiers, com.google.gson.JsonArray newIdentifiers, boolean warnOnMissing)
public static void mapIdentifiers(int[] output, com.google.gson.JsonArray oldIdentifiers, com.google.gson.JsonArray newIdentifiers, @Nullable com.google.gson.JsonObject diffIdentifiers, boolean warnOnMissing)
public static it.unimi.dsi.fastutil.objects.Object2IntMap<java.lang.String> indexedObjectToMap(com.google.gson.JsonObject object)
object
- json objectpublic static it.unimi.dsi.fastutil.objects.Object2IntMap<java.lang.String> arrayToMap(com.google.gson.JsonArray array)
array
- json arraypublic static @Nullable java.io.InputStream getResource(java.lang.String name)