public class ServerNPCRegistry
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.util.HashMap<java.lang.String,NPCRegistryData> |
data
Map from lang codes to NPC data.
|
static java.lang.String |
en_us
The lang code for English language files.
|
static com.google.gson.Gson |
GSON |
static NPCRegistryShopkeepers |
shopkeepers
Data for shopkeepers.
|
static NPCRegistryTrainers |
trainers
Data for NPC Trainers.
|
static NPCRegistryVillagers |
villagers
Data for chatting NPCs.
|
Constructor and Description |
---|
ServerNPCRegistry() |
Modifier and Type | Method and Description |
---|---|
static void |
clear() |
static void |
decode(net.minecraft.network.PacketBuffer buffer) |
static void |
decodeNPCs(net.minecraft.network.PacketBuffer buffer) |
static void |
encode(net.minecraft.network.PacketBuffer buffer) |
static void |
encodeNPCs(net.minecraft.network.PacketBuffer buffer,
int current,
int totalPackets) |
static void |
extractFile(java.lang.String resourceName,
java.io.File npcsDir,
java.lang.String filename)
Extracts a file to another location.
|
static NPCRegistryData |
getData(java.lang.String locale) |
static java.util.ArrayList<GeneralNPCData> |
getEnglishNPCs()
Gets the English data for all chatting NPCs.
|
static java.util.ArrayList<ShopkeeperData> |
getEnglishShopkeepers()
Gets the English data for all shopkeepers.
|
static GymNPCData |
getGymMember(java.lang.String id)
Gets data for a Gym member by unique name id.
|
static java.lang.String |
getRandomName()
Gets a random name from a random NPC Trainer type.
|
static ITrainerData |
getTranslatedData(java.lang.String langCode,
BaseTrainer baseTrainer,
java.lang.String id)
Retrieves a specific NPC Trainer type's data (from both gym npcs and normal trainer data).
|
static java.lang.String[] |
getTranslatedGymMemberChat(java.lang.String langCode,
java.lang.String id,
int index)
Gets a specific translated set of dialogue for a specific type of Gym NPC.
|
static GymNPCData |
getTranslatedGymMemberData(java.lang.String langCode,
java.lang.String id)
Retrieves Gym NPC data for a specific Gym NPC type.
|
static java.lang.String |
getTranslatedGymMemberName(java.lang.String langCode,
java.lang.String id,
int index)
Gets a specific translated name for a specific type of Gym NPC.
|
static void |
readTrainerTypes(com.google.gson.JsonElement element) |
static void |
register(com.google.gson.Gson gson,
net.minecraft.util.ResourceLocation rl,
com.google.gson.JsonElement json) |
public static final com.google.gson.Gson GSON
public static java.lang.String en_us
public static java.util.HashMap<java.lang.String,NPCRegistryData> data
public static NPCRegistryTrainers trainers
public static NPCRegistryVillagers villagers
public static NPCRegistryShopkeepers shopkeepers
public static void clear()
public static void register(com.google.gson.Gson gson, net.minecraft.util.ResourceLocation rl, com.google.gson.JsonElement json)
public static void encode(net.minecraft.network.PacketBuffer buffer)
public static void encodeNPCs(net.minecraft.network.PacketBuffer buffer, int current, int totalPackets)
public static void decode(net.minecraft.network.PacketBuffer buffer)
public static void decodeNPCs(net.minecraft.network.PacketBuffer buffer)
public static NPCRegistryData getData(java.lang.String locale)
public static void readTrainerTypes(com.google.gson.JsonElement element)
public static GymNPCData getGymMember(java.lang.String id)
id
- The unique id of the gym member.public static java.lang.String getRandomName()
public static GymNPCData getTranslatedGymMemberData(java.lang.String langCode, java.lang.String id)
langCode
- The lang code to translate strings with.id
- The type of Gym NPC to get data for.public static java.lang.String getTranslatedGymMemberName(java.lang.String langCode, java.lang.String id, int index)
langCode
- The lang code to translate the name with.id
- The type of Gym NPC to get a name for.index
- The index of the name to get.public static java.lang.String[] getTranslatedGymMemberChat(java.lang.String langCode, java.lang.String id, int index)
langCode
- The lang code to translate the dialogue with.id
- The type of Gym NPC to get dialogue for.index
- The index of the set of dialogue to get.public static void extractFile(java.lang.String resourceName, java.io.File npcsDir, java.lang.String filename)
resourceName
- The name of the resource to extract from.npcsDir
- The folder to extract to.filename
- The name of the file put the extracted data in.public static ITrainerData getTranslatedData(java.lang.String langCode, BaseTrainer baseTrainer, java.lang.String id)
langCode
- The lang code to translate strings with.baseTrainer
- The Trainer type to get data from.id
- The ID of the Trainer type.public static java.util.ArrayList<GeneralNPCData> getEnglishNPCs()
public static java.util.ArrayList<ShopkeeperData> getEnglishShopkeepers()