mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-02-10 01:11:22 +01:00
more formatting
This commit is contained in:
parent
f1bc5dba8f
commit
d996722643
@ -101,9 +101,9 @@ public class Citizens extends JavaPlugin {
|
|||||||
NPC npc = npcManager.createNPC(key.getString("name"), character);
|
NPC npc = npcManager.createNPC(key.getString("name"), character);
|
||||||
|
|
||||||
// Load the character if it exists, otherwise remove the character
|
// Load the character if it exists, otherwise remove the character
|
||||||
if (character != null) {
|
if (character != null)
|
||||||
character.load(key.getRelative(character.getName()));
|
character.load(key.getRelative(character.getName()));
|
||||||
} else {
|
else {
|
||||||
if (key.keyExists("character")) {
|
if (key.keyExists("character")) {
|
||||||
Messaging.debug("Character '" + key.getString("character")
|
Messaging.debug("Character '" + key.getString("character")
|
||||||
+ "' does not exist. Removing character from the NPC with ID '" + npc.getId() + "'.");
|
+ "' does not exist. Removing character from the NPC with ID '" + npc.getId() + "'.");
|
||||||
|
@ -39,9 +39,8 @@ public class EventListen implements Listener {
|
|||||||
EntityDamageByEntityEvent e = (EntityDamageByEntityEvent) event;
|
EntityDamageByEntityEvent e = (EntityDamageByEntityEvent) event;
|
||||||
if (e.getDamager() instanceof Player) {
|
if (e.getDamager() instanceof Player) {
|
||||||
NPC npc = manager.getNPC(event.getEntity());
|
NPC npc = manager.getNPC(event.getEntity());
|
||||||
if (npc.getCharacter() != null) {
|
if (npc.getCharacter() != null)
|
||||||
npc.getCharacter().onLeftClick(npc, (Player) e.getDamager());
|
npc.getCharacter().onLeftClick(npc, (Player) e.getDamager());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user