public class NPCRegistry extends Object implements Iterable<NPCAbstract<?,?>>
Constructor and Description |
---|
NPCRegistry(org.bukkit.plugin.Plugin plugin) |
Modifier and Type | Method and Description |
---|---|
protected <T extends NPCEntity> |
createEntity(org.bukkit.Location location,
NPCInfo npcInfo) |
protected EntityPlayer |
createPlayerEntity(org.bukkit.Location location,
NPCInfo npcInfo,
org.inventivetalent.mcwrapper.auth.GameProfileWrapper gameProfile) |
void |
destroy() |
void |
destroy(boolean removeNpcs) |
Collection<NPCAbstract<?,?>> |
getNpcs() |
static NPCRegistry |
getRegistry(org.bukkit.plugin.Plugin plugin) |
static void |
injectClasses(Class<?>... classes)
Injects the specified NPC classes, so the entities can be loaded properly by the server
|
Iterator<NPCAbstract<?,?>> |
iterator() |
void |
registerNpc(NPCAbstract<?,?> npc) |
<T extends NPCAbstract<?,?>> |
removeNpc(T npc) |
NPCAbstract<?,?> |
removeNpc(UUID uuid) |
<T extends NPCAbstract<?,?>> |
spawnNPC(org.bukkit.Location location,
Class<T> npcClass)
Creates and spawns the specified NPC Entity
|
NPCAbstract<?,?> |
spawnNPC(org.bukkit.Location location,
NPCType npcType)
Creates and spawns the specified NPC Type
|
<T extends NPCHumanAbstract<?,?>> |
spawnPlayerNPC(org.bukkit.Location location,
Class<T> npcClass,
org.inventivetalent.mcwrapper.auth.GameProfileWrapper gameProfile)
Creates and spawns a player NPC entity
|
<T extends NPCHumanAbstract<?,?>> |
spawnPlayerNPC(org.bukkit.Location location,
Class<T> npcClass,
UUID uuid,
String name)
Creates and spawns a player NPC entity
|
protected <T extends NPCAbstract<?,?>> |
wrapAndInitEntity(NPCEntity entity,
org.bukkit.Location location,
NPCInfo npcInfo,
Class<T> npcClass) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public void destroy(boolean removeNpcs)
public void destroy()
public static NPCRegistry getRegistry(org.bukkit.plugin.Plugin plugin)
public static void injectClasses(Class<?>... classes)
classes
- classes to injectpublic <T extends NPCAbstract<?,?>> T spawnNPC(org.bukkit.Location location, Class<T> npcClass)
T
- a NPC class extending NPCAbstract
location
- Location
to spawn the entity atnpcClass
- NPC-Class to spawnpublic NPCAbstract<?,?> spawnNPC(org.bukkit.Location location, NPCType npcType)
location
- Location
to spawn the entity atnpcType
- type of the NPCpublic <T extends NPCHumanAbstract<?,?>> T spawnPlayerNPC(org.bukkit.Location location, Class<T> npcClass, org.inventivetalent.mcwrapper.auth.GameProfileWrapper gameProfile)
T
- a NPC class extending NPCHumanAbstract
location
- Location
to spawn the entity atnpcClass
- NPC-Class to spawngameProfile
- GameProfileWrapper
to use for the playerpublic <T extends NPCHumanAbstract<?,?>> T spawnPlayerNPC(org.bukkit.Location location, Class<T> npcClass, UUID uuid, String name)
T
- a NPC class extending NPCHumanAbstract
location
- Location
to spawn the entity atnpcClass
- NPC-Class to spawnuuid
- UUID
of the playername
- Name of the playerpublic void registerNpc(NPCAbstract<?,?> npc)
public <T extends NPCAbstract<?,?>> T removeNpc(T npc)
public NPCAbstract<?,?> removeNpc(UUID uuid)
public Collection<NPCAbstract<?,?>> getNpcs()
protected <T extends NPCEntity> T createEntity(org.bukkit.Location location, NPCInfo npcInfo)
protected EntityPlayer createPlayerEntity(org.bukkit.Location location, NPCInfo npcInfo, org.inventivetalent.mcwrapper.auth.GameProfileWrapper gameProfile)
protected <T extends NPCAbstract<?,?>> T wrapAndInitEntity(NPCEntity entity, org.bukkit.Location location, NPCInfo npcInfo, Class<T> npcClass) throws Exception
Exception
public Iterator<NPCAbstract<?,?>> iterator()
iterator
in interface Iterable<NPCAbstract<?,?>>
Copyright © 2018. All rights reserved.