summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-02-13 17:16:27 +0000
committerKHobbits <rob@khobbits.co.uk>2012-02-13 17:16:27 +0000
commit57a2ef08d4b1f80f8794c1fafe0e7f22c88177a6 (patch)
tree267bcea8aadc7050adc66731e71754828dee0756
parent2699e02f96e7ab989bf518685eac3408ecfcde8c (diff)
downloadEssentials-57a2ef08d4b1f80f8794c1fafe0e7f22c88177a6.tar
Essentials-57a2ef08d4b1f80f8794c1fafe0e7f22c88177a6.tar.gz
Essentials-57a2ef08d4b1f80f8794c1fafe0e7f22c88177a6.tar.lz
Essentials-57a2ef08d4b1f80f8794c1fafe0e7f22c88177a6.tar.xz
Essentials-57a2ef08d4b1f80f8794c1fafe0e7f22c88177a6.zip
Allow charges for different mob types in /spawner
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandspawner.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java
index 73c86eba4..d52315241 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawner.java
@@ -2,6 +2,7 @@ package com.earth2me.essentials.commands;
import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.Mob;
+import com.earth2me.essentials.Trade;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import java.util.Locale;
@@ -47,11 +48,14 @@ public class Commandspawner extends EssentialsCommand
{
throw new Exception(_("unableToSpawnMob"));
}
- if (!user.isAuthorized("essentials.spawner." + mob.name.toLowerCase()))
+ if (!user.isAuthorized("essentials.spawner." + mob.name.toLowerCase(Locale.ENGLISH)))
{
throw new Exception(_("unableToSpawnMob"));
}
+ final Trade charge = new Trade("spawner-" + mob.name.toLowerCase(Locale.ENGLISH), ess);
+ charge.isAffordableFor(user);
((CreatureSpawner)target.getBlock().getState()).setCreatureType(mob.getType());
+ charge.charge(user);
user.sendMessage(_("setSpawner", mob.name));
}
catch (Throwable ex)