diff --git a/src/net/citizensnpcs/Settings.java b/src/net/citizensnpcs/Settings.java index f0355b1d2..ff84cfe98 100644 --- a/src/net/citizensnpcs/Settings.java +++ b/src/net/citizensnpcs/Settings.java @@ -30,11 +30,12 @@ public class Settings { } public enum Setting { + CHAT_PREFIX("npc.chat.prefix", "[]: "), DEBUG_MODE("general.debug-mode", false), - USE_DATABASE("use-database", false), + QUICK_SELECT("npc.selection.quick-select", false), SELECTION_ITEM("npc.selection.item", 280), SELECTION_MESSAGE("npc.selection.message", "You selected !"), - QUICK_SELECT("npc.selection.quick-select", false); + USE_DATABASE("use-database", false); private String path; private Object value; diff --git a/src/net/citizensnpcs/npc/CitizensNPC.java b/src/net/citizensnpcs/npc/CitizensNPC.java index f473ced6f..57ceb8fc4 100644 --- a/src/net/citizensnpcs/npc/CitizensNPC.java +++ b/src/net/citizensnpcs/npc/CitizensNPC.java @@ -1,5 +1,6 @@ package net.citizensnpcs.npc; +import net.citizensnpcs.Settings.Setting; import net.citizensnpcs.api.event.NPCDespawnEvent; import net.citizensnpcs.api.event.NPCSpawnEvent; import net.citizensnpcs.api.npc.AbstractNPC; @@ -28,6 +29,12 @@ public abstract class CitizensNPC extends AbstractNPC { inventory = new NPCInventory(this); } + @Override + public void chat(String message) { + for (Player player : Bukkit.getOnlinePlayers()) + Messaging.sendWithNPC(player, Setting.CHAT_PREFIX.asString() + message, this); + } + protected abstract EntityLiving createHandle(Location loc); @Override