public class WauzCitizenSpawner
extends java.lang.Object
WauzCitizen
Modifier and Type | Field and Description |
---|---|
private static java.util.Map<WauzCitizen,net.jitse.npclib.api.NPC> |
citizenNpcMap
A map of npcs, indexed by citizen.
|
private static net.jitse.npclib.NPCLib |
NPC_LIB
Access to the NPCLib API.
|
private static java.util.Map<net.jitse.npclib.api.NPC,WauzCitizen> |
npcCitizenMap
A map of citizens, indexed by npc.
|
private static int |
RENDER_RADIUS
The radius in chunks, in which citizens should be rendered.
|
Constructor and Description |
---|
WauzCitizenSpawner() |
Modifier and Type | Method and Description |
---|---|
static void |
createNpc(WauzCitizen citizen)
Creates a citizen npc using the npc lib.
|
static void |
destroyNpc(net.jitse.npclib.api.NPC npc)
Destroys the given npc, i.e. remove it from the registry.
|
static WauzCitizen |
getCitizen(net.jitse.npclib.api.NPC npc)
Retrieves a registered citizen from the npc map.
|
static net.jitse.npclib.NPCLib |
getNpclib() |
static void |
hideNpc(net.jitse.npclib.api.NPC npc,
org.bukkit.entity.Player player)
Hides the npc from the given player.
|
static void |
registerNpc(WauzCitizen citizen,
net.jitse.npclib.api.NPC npc)
Registers the given citizen npc, to retrieve it when needed.
|
static void |
showNpc(net.jitse.npclib.api.NPC npc,
org.bukkit.entity.Player player)
Show the npc to the given player.
|
static void |
showNpcsNearPlayer(org.bukkit.entity.Player player)
Shows all npcs near the given player to them.
|
static void |
unregisterNpc(WauzCitizen citizen)
Unregisters the given citizen and destroy its npc object.
|
private static final net.jitse.npclib.NPCLib NPC_LIB
private static final int RENDER_RADIUS
private static java.util.Map<WauzCitizen,net.jitse.npclib.api.NPC> citizenNpcMap
private static java.util.Map<net.jitse.npclib.api.NPC,WauzCitizen> npcCitizenMap
public static void createNpc(WauzCitizen citizen)
citizen
- The citizen, that should be created.registerNpc(WauzCitizen, NPC)
public static void registerNpc(WauzCitizen citizen, net.jitse.npclib.api.NPC npc)
citizen
- The citizen to register.npc
- The npc object bound to the citzen.getCitizen(NPC)
public static void unregisterNpc(WauzCitizen citizen)
citizen
- The citizen to unregister.public static WauzCitizen getCitizen(net.jitse.npclib.api.NPC npc)
npc
- The npc object bound to the citzen.registerNpc(WauzCitizen, NPC)
public static void showNpcsNearPlayer(org.bukkit.entity.Player player)
player
- The player to show the npcs to.public static void destroyNpc(net.jitse.npclib.api.NPC npc)
npc
- The npc to destroy.public static void showNpc(net.jitse.npclib.api.NPC npc, org.bukkit.entity.Player player)
npc
- The npc to show.player
- The player to show the npc to.public static void hideNpc(net.jitse.npclib.api.NPC npc, org.bukkit.entity.Player player)
npc
- The npc to hide.player
- The player to hide the npc from.public static net.jitse.npclib.NPCLib getNpclib()