diff --git a/src/main/java/net/citizensnpcs/NPCPayListener.java b/src/main/java/net/citizensnpcs/NPCPayListener.java index 89c5fb3ce..2e0dbe411 100644 --- a/src/main/java/net/citizensnpcs/NPCPayListener.java +++ b/src/main/java/net/citizensnpcs/NPCPayListener.java @@ -2,8 +2,11 @@ package net.citizensnpcs; import net.citizensnpcs.Settings.Setting; import net.citizensnpcs.api.event.PlayerCreateNPCEvent; +import net.citizensnpcs.util.Messaging; +import net.citizensnpcs.util.StringHelper; import net.milkbowl.vault.economy.Economy; +import org.bukkit.ChatColor; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; @@ -21,7 +24,7 @@ public class NPCPayListener implements Listener { public void onPlayerCreateNPC(PlayerCreateNPCEvent event) { String name = event.getCreator().getName(); boolean hasAccount = provider.hasAccount(name); - if (!hasAccount) + if (!hasAccount || event.getCreator().hasPermission("citizens.npc.ignore-cost")) return; double cost = Setting.NPC_COST.asDouble(); boolean hasEnough = provider.has(name, cost); @@ -31,5 +34,7 @@ public class NPCPayListener implements Listener { return; } provider.bankWithdraw(name, cost); + Messaging.sendF(event.getCreator(), ChatColor.GREEN + "Withdrew %s for your NPC.", + StringHelper.wrap(provider.format(cost))); } }