mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-26 20:55:44 +01:00
small changes
This commit is contained in:
parent
b43ab6d28c
commit
caf17734de
@ -262,8 +262,8 @@ public class Citizens extends JavaPlugin {
|
||||
if (!key.keyExists("name"))
|
||||
throw new NPCLoadException("Could not find a name for the NPC with ID '" + id + "'.");
|
||||
|
||||
String type = key.getString("traits.type").toUpperCase();
|
||||
NPC npc = npcManager.createNPC(EntityType.valueOf(type), id, key.getString("name"), null);
|
||||
NPC npc = npcManager.createNPC(EntityType.valueOf(key.getString("traits.type").toUpperCase()), id, key
|
||||
.getString("name"), null);
|
||||
try {
|
||||
npc.load(key);
|
||||
} catch (NPCException ex) {
|
||||
|
@ -43,7 +43,7 @@ public class EventListen implements Listener {
|
||||
}
|
||||
|
||||
/*
|
||||
* World events
|
||||
* Chunk events
|
||||
*/
|
||||
@EventHandler
|
||||
public void onChunkLoad(ChunkLoadEvent event) {
|
||||
@ -122,6 +122,9 @@ public class EventListen implements Listener {
|
||||
npc.getCharacter().onRightClick(npc, player);
|
||||
}
|
||||
|
||||
/*
|
||||
* Player events
|
||||
*/
|
||||
@EventHandler
|
||||
public void onPlayerChangedWorld(PlayerChangedWorldEvent event) {
|
||||
if (!(((CraftPlayer) event.getPlayer()).getHandle() instanceof EntityHumanNPC))
|
||||
@ -139,14 +142,14 @@ public class EventListen implements Listener {
|
||||
new EntityTargetEvent(event.getRightClicked(), event.getPlayer(), TargetReason.CUSTOM));
|
||||
}
|
||||
|
||||
/*
|
||||
* Player events
|
||||
*/
|
||||
@EventHandler
|
||||
public void onPlayerQuit(PlayerQuitEvent event) {
|
||||
Editor.leave(event.getPlayer());
|
||||
}
|
||||
|
||||
/*
|
||||
* World events
|
||||
*/
|
||||
@EventHandler
|
||||
public void onWorldLoad(WorldLoadEvent event) {
|
||||
for (Pair<Integer, Integer> chunk : toRespawn.keySet()) {
|
||||
|
Loading…
Reference in New Issue
Block a user