public class WauzCitizen
extends java.lang.Object
WauzCitizenSpawner
Modifier and Type | Field and Description |
---|---|
private org.bukkit.inventory.ItemStack |
bootsItemStack
The equipped boots item.
|
private boolean |
burning
If the citizen is burning.
|
private org.bukkit.inventory.ItemStack |
chestplateItemStack
The equipped chestplate item.
|
private static ChunkKeyMap<java.util.List<WauzCitizen>> |
chunkCitizensMap
A map with lists of citizens, indexed by chunk keys.
|
private static int |
citizenCount
The number of all registred citizens.
|
private java.lang.String |
citizenName
The canonical name of the citizen.
|
private java.lang.String |
displayName
The name of the citizen, as shown in chat.
|
private org.bukkit.inventory.ItemStack |
helmetItemStack
The equipped helmet item.
|
private WauzCitizenInteractions |
interactions
The interaction options of the citizen.
|
private boolean |
invisible
If the citizen is invisible.
|
private long |
lastMessageTime
The time of the last random message sent by the citizen.
|
private org.bukkit.inventory.ItemStack |
leggingsItemStack
The equipped leggings item.
|
private org.bukkit.Location |
location
The location where the npc should be spawned.
|
private org.bukkit.inventory.ItemStack |
mainhandItemStack
The equipped mainhand item.
|
private java.util.List<java.lang.String> |
messages
The random messages of the citizen.
|
private java.util.List<java.lang.String> |
nameLines
The lines of text above the citizen's head.
|
private org.bukkit.inventory.ItemStack |
offhandItemStack
The equipped offhand item.
|
private int |
skinId
The identifier of a skin from mineskin.org
|
private static java.util.Map<java.lang.String,WauzCitizen> |
unassignedCitizenMap
A map of citizens that aren't assigned to a world, indexed by name.
|
Constructor and Description |
---|
WauzCitizen(java.lang.String citizenName)
Constructs a citizen, based on the citizen file name in the /WauzCore/CitizenData folder.
|
WauzCitizen(WauzCitizen citizen)
Constructs a citizen, that is an exact copy of another citizen.
|
Modifier and Type | Method and Description |
---|---|
static void |
addToChunkMap(WauzCitizen citizen,
org.bukkit.Chunk chunk)
Adds a citizen to the chunk map, so they can spawn in that chunk.
|
org.bukkit.inventory.ItemStack |
getBootsItemStack() |
org.bukkit.inventory.ItemStack |
getChestplateItemStack() |
java.lang.String |
getCitizenName() |
static java.util.List<WauzCitizen> |
getCitizensNearPlayer(org.bukkit.entity.Player player,
int radius)
Finds all the citzens, near the given player.
|
java.lang.String |
getDisplayName() |
org.bukkit.inventory.ItemStack |
getHelmetItemStack() |
WauzCitizenInteractions |
getInteractions() |
org.bukkit.inventory.ItemStack |
getLeggingsItemStack() |
org.bukkit.Location |
getLocation() |
org.bukkit.inventory.ItemStack |
getMainhandItemStack() |
(package private) java.util.List<java.lang.String> |
getMessages() |
java.util.List<java.lang.String> |
getNameLines() |
org.bukkit.inventory.ItemStack |
getOffhandItemStack() |
java.lang.String |
getRandomMessage() |
int |
getSkinId() |
static WauzCitizen |
getUnassignedCitizen(java.lang.String citizenName)
Gets a citizen that isn't assigned to a world, with the given name.
|
static void |
init()
Initializes all citizen configs and fills the internal citizen maps.
|
boolean |
isBurning() |
boolean |
isInvisible() |
static void |
removeFromChunkMap(WauzCitizen citizen,
org.bukkit.Chunk chunk)
Removes a citizen from the chunk map, so they can no longer spawn in that chunk.
|
void |
setLocation(org.bukkit.Location location) |
private static ChunkKeyMap<java.util.List<WauzCitizen>> chunkCitizensMap
private static java.util.Map<java.lang.String,WauzCitizen> unassignedCitizenMap
private static int citizenCount
private java.lang.String citizenName
private java.lang.String displayName
private java.util.List<java.lang.String> nameLines
private org.bukkit.Location location
private int skinId
private boolean invisible
private boolean burning
private long lastMessageTime
private java.util.List<java.lang.String> messages
private org.bukkit.inventory.ItemStack mainhandItemStack
private org.bukkit.inventory.ItemStack offhandItemStack
private org.bukkit.inventory.ItemStack helmetItemStack
private org.bukkit.inventory.ItemStack chestplateItemStack
private org.bukkit.inventory.ItemStack leggingsItemStack
private org.bukkit.inventory.ItemStack bootsItemStack
private WauzCitizenInteractions interactions
public WauzCitizen(java.lang.String citizenName)
citizenName
- The canonical name of the citizen.public WauzCitizen(WauzCitizen citizen)
citizen
- The citizen to clone.public static void init()
public static void addToChunkMap(WauzCitizen citizen, org.bukkit.Chunk chunk)
citizen
- The citizen to add.chunk
- The chunk of the citizen.WauzCitizenSpawner.createNpc(WauzCitizen)
public static void removeFromChunkMap(WauzCitizen citizen, org.bukkit.Chunk chunk)
citizen
- The citizen to remove.chunk
- The chunk of the citizen.WauzCitizenSpawner.unregisterNpc(WauzCitizen)
public static WauzCitizen getUnassignedCitizen(java.lang.String citizenName)
citizenName
- The name of the citizen.public static java.util.List<WauzCitizen> getCitizensNearPlayer(org.bukkit.entity.Player player, int radius)
player
- The player to get the citizens for.radius
- The radius in chunks, in which citizens should be found.public java.lang.String getCitizenName()
public java.lang.String getDisplayName()
public java.util.List<java.lang.String> getNameLines()
public org.bukkit.Location getLocation()
public void setLocation(org.bukkit.Location location)
location
- The new location where the npc should be spawned.public int getSkinId()
public boolean isInvisible()
public boolean isBurning()
final java.util.List<java.lang.String> getMessages()
public java.lang.String getRandomMessage()
public org.bukkit.inventory.ItemStack getMainhandItemStack()
public org.bukkit.inventory.ItemStack getOffhandItemStack()
public org.bukkit.inventory.ItemStack getHelmetItemStack()
public org.bukkit.inventory.ItemStack getChestplateItemStack()
public org.bukkit.inventory.ItemStack getLeggingsItemStack()
public org.bukkit.inventory.ItemStack getBootsItemStack()
public WauzCitizenInteractions getInteractions()