public class MappingDataLoader extends Object
Constructor and Description |
---|
MappingDataLoader() |
Modifier and Type | Method and Description |
---|---|
static it.unimi.dsi.fastutil.objects.Object2IntMap<String> |
arrayToMap(com.google.gson.JsonArray array) |
static void |
enableMappingsCache() |
static Map<String,com.google.gson.JsonObject> |
getMappingsCache()
Returns the cached mappings.
|
static @Nullable InputStream |
getResource(String name) |
static it.unimi.dsi.fastutil.objects.Object2IntMap<String> |
indexedObjectToMap(com.google.gson.JsonObject object) |
static boolean |
isCacheJsonMappings()
Returns true if a selected number of mappings should be cached.
|
static @Nullable com.google.gson.JsonObject |
loadData(String name)
Loads the file from the bundled resources.
|
static @Nullable com.google.gson.JsonObject |
loadData(String name,
boolean cacheIfEnabled)
Loads the file from the bundled resources.
|
static @Nullable com.google.gson.JsonObject |
loadFromDataDir(String name)
Loads the file from the plugin folder if present, else from the bundled resources.
|
static void |
mapIdentifiers(Int2IntBiMap output,
com.google.gson.JsonObject oldIdentifiers,
com.google.gson.JsonObject newIdentifiers,
@Nullable com.google.gson.JsonObject diffIdentifiers) |
static void |
mapIdentifiers(short[] output,
com.google.gson.JsonArray oldIdentifiers,
com.google.gson.JsonArray newIdentifiers,
boolean warnOnMissing) |
static void |
mapIdentifiers(short[] output,
com.google.gson.JsonArray oldIdentifiers,
com.google.gson.JsonArray newIdentifiers,
@Nullable com.google.gson.JsonObject diffIdentifiers,
boolean warnOnMissing) |
static void |
mapIdentifiers(short[] output,
com.google.gson.JsonObject oldIdentifiers,
com.google.gson.JsonObject newIdentifiers) |
static void |
mapIdentifiers(short[] output,
com.google.gson.JsonObject oldIdentifiers,
com.google.gson.JsonObject newIdentifiers,
@Nullable com.google.gson.JsonObject diffIdentifiers) |
public static boolean isCacheJsonMappings()
public static void enableMappingsCache()
public static Map<String,com.google.gson.JsonObject> getMappingsCache()
isCacheJsonMappings()
@Nullable public static @Nullable com.google.gson.JsonObject loadFromDataDir(String name)
@Nullable public static @Nullable com.google.gson.JsonObject loadData(String name)
@Nullable public static @Nullable com.google.gson.JsonObject loadData(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 @Nullable com.google.gson.JsonObject diffIdentifiers)
public static void mapIdentifiers(short[] output, com.google.gson.JsonObject oldIdentifiers, com.google.gson.JsonObject newIdentifiers)
public static void mapIdentifiers(short[] output, com.google.gson.JsonObject oldIdentifiers, com.google.gson.JsonObject newIdentifiers, @Nullable @Nullable com.google.gson.JsonObject diffIdentifiers)
public static void mapIdentifiers(short[] output, com.google.gson.JsonArray oldIdentifiers, com.google.gson.JsonArray newIdentifiers, boolean warnOnMissing)
public static void mapIdentifiers(short[] output, com.google.gson.JsonArray oldIdentifiers, com.google.gson.JsonArray newIdentifiers, @Nullable @Nullable com.google.gson.JsonObject diffIdentifiers, boolean warnOnMissing)
public static it.unimi.dsi.fastutil.objects.Object2IntMap<String> indexedObjectToMap(com.google.gson.JsonObject object)
object
- json objectpublic static it.unimi.dsi.fastutil.objects.Object2IntMap<String> arrayToMap(com.google.gson.JsonArray array)
array
- json array@Nullable public static @Nullable InputStream getResource(String name)
Copyright © 2016–2021. All rights reserved.