From a72777d0432518c16a1e34f67a05f47f09b8f12b Mon Sep 17 00:00:00 2001 From: GunfighterJ Date: Sun, 14 Apr 2013 15:01:25 -0500 Subject: [PATCH] Allow permission control of stacked mobs Adds essentials.spawnmob.stack to allow stacking of more than one mob using the /spawnmob command Adds https://www.assembla.com/spaces/essentials/tickets/4050 --- Essentials/src/com/earth2me/essentials/SpawnMob.java | 4 ++++ Essentials/src/messages.properties | 5 +++-- Essentials/src/messages_cs.properties | 1 + Essentials/src/messages_da.properties | 1 + Essentials/src/messages_de.properties | 1 + Essentials/src/messages_en.properties | 1 + Essentials/src/messages_es.properties | 1 + Essentials/src/messages_fi.properties | 1 + Essentials/src/messages_fr.properties | 1 + Essentials/src/messages_it.properties | 1 + Essentials/src/messages_nl.properties | 1 + Essentials/src/messages_pl.properties | 1 + Essentials/src/messages_pt.properties | 1 + Essentials/src/messages_ro.properties | 5 +++-- Essentials/src/messages_se.properties | 1 + 15 files changed, 22 insertions(+), 4 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/SpawnMob.java b/Essentials/src/com/earth2me/essentials/SpawnMob.java index 7fbf8201d..81be125ba 100644 --- a/Essentials/src/com/earth2me/essentials/SpawnMob.java +++ b/Essentials/src/com/earth2me/essentials/SpawnMob.java @@ -82,6 +82,10 @@ public class SpawnMob { throw new Exception(_("unableToSpawnMob")); } + if (parts.size() > 1 && !user.isAuthorized("essentials.spawnmob.stack")) + { + throw new Exception(_("cannotStackMob")); + } spawnmob(ess, server, user, user, block.getLocation(), parts, data, mobCount); } diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index a423453c1..3a86e73b2 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -219,7 +219,7 @@ kitGive=\u00a76Giving kit\u00a7c {0}\u00a76. kitGiveTo=\u00a76Giving kit\u00a7c {0}\u00a76 to {1}\u00a7. kitInvFull=\u00a74Your inventory was full, placing kit on the floor. kitOnce=\u00a74You can't use that kit again. -kitReceive=\u00a76Received kit\u00a7c {0}\u00a76. +kitReceive=\u00a76Received kit\u00a7c {0}\u00a76. kitTimed=\u00a74You can''t use that kit again for another\u00a7c {0}\u00a74. kits=\u00a76Kits:\u00a7r {0} leatherSyntax=\u00a76Leather Color Syntax: color:,, eg: color:255,0,0. @@ -228,7 +228,7 @@ lightningUse=\u00a76Smiting\u00a7c {0} listAfkTag= \u00a77[AFK]\u00a7r listAmount= \u00a76There are \u00a7c{0}\u00a76 out of maximum \u00a7c{1}\u00a76 players online. listAmountHidden= \u00a76There are \u00a7c{0}\u00a76/{1}\u00a76 out of maximum \u00a7c{2}\u00a76 players online. -listGroupTag={0}\u00a7r: +listGroupTag={0}\u00a7r: listHiddenTag= \u00a77[HIDDEN]\u00a7r loadWarpError=\u00a74Failed to load warp {0}. localFormat=[L]<{0}> {1} @@ -531,3 +531,4 @@ pWeatherPlayers=\u00a76These players have their own weather:\u00a7r pWeatherReset=\u00a76Player weather has been reset for: \u00a7c{0} pWeatherSet=\u00a76Player weather is set to \u00a7c{0}\u00a76 for: \u00a7c{1}. pWeatherInvalidAlias=\u00a74Invalid weather type +cannotStackMob=\u00a74You do not have permission to stack multiple mobs diff --git a/Essentials/src/messages_cs.properties b/Essentials/src/messages_cs.properties index 003c04861..eb3cff221 100644 --- a/Essentials/src/messages_cs.properties +++ b/Essentials/src/messages_cs.properties @@ -534,3 +534,4 @@ pWeatherPlayers=\u00a76These players have their own weather:\u00a7r pWeatherReset=\u00a76Player weather has been reset for: \u00a7c{0} pWeatherSet=\u00a76Player weather is set to \u00a7c{0}\u00a76 for: \u00a7c{1}. pWeatherInvalidAlias=\u00a74Invalid weather type +cannotStackMob=\u00a74You do not have permission to stack multiple mobs diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index 9da29ddf5..ba0365694 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -531,3 +531,4 @@ pWeatherPlayers=\u00a76These players have their own weather:\u00a7r pWeatherReset=\u00a76Player weather has been reset for: \u00a7c{0} pWeatherSet=\u00a76Player weather is set to \u00a7c{0}\u00a76 for: \u00a7c{1}. pWeatherInvalidAlias=\u00a74Invalid weather type +cannotStackMob=\u00a74You do not have permission to stack multiple mobs diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index 8e74faa1c..7124e1e35 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -531,3 +531,4 @@ pWeatherPlayers=\u00a76These players have their own weather:\u00a7r pWeatherReset=\u00a76Player weather has been reset for: \u00a7c{0} pWeatherSet=\u00a76Player weather is set to \u00a7c{0}\u00a76 for: \u00a7c{1}. pWeatherInvalidAlias=\u00a74Invalid weather type +cannotStackMob=\u00a74You do not have permission to stack multiple mobs diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index 097b4c010..3a86e73b2 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -531,3 +531,4 @@ pWeatherPlayers=\u00a76These players have their own weather:\u00a7r pWeatherReset=\u00a76Player weather has been reset for: \u00a7c{0} pWeatherSet=\u00a76Player weather is set to \u00a7c{0}\u00a76 for: \u00a7c{1}. pWeatherInvalidAlias=\u00a74Invalid weather type +cannotStackMob=\u00a74You do not have permission to stack multiple mobs diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index 700d3e7b2..2060dbb6f 100644 --- a/Essentials/src/messages_es.properties +++ b/Essentials/src/messages_es.properties @@ -531,3 +531,4 @@ pWeatherPlayers=\u00a76These players have their own weather:\u00a7r pWeatherReset=\u00a76Player weather has been reset for: \u00a7c{0} pWeatherSet=\u00a76Player weather is set to \u00a7c{0}\u00a76 for: \u00a7c{1}. pWeatherInvalidAlias=\u00a74Invalid weather type +cannotStackMob=\u00a74You do not have permission to stack multiple mobs diff --git a/Essentials/src/messages_fi.properties b/Essentials/src/messages_fi.properties index cc01af8f3..f406804c6 100644 --- a/Essentials/src/messages_fi.properties +++ b/Essentials/src/messages_fi.properties @@ -531,3 +531,4 @@ pWeatherPlayers=\u00a76These players have their own weather:\u00a7r pWeatherReset=\u00a76Player weather has been reset for: \u00a7c{0} pWeatherSet=\u00a76Player weather is set to \u00a7c{0}\u00a76 for: \u00a7c{1}. pWeatherInvalidAlias=\u00a74Invalid weather type +cannotStackMob=\u00a74You do not have permission to stack multiple mobs diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index 805376a59..7a045f89c 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -531,3 +531,4 @@ pWeatherPlayers=\u00a76These players have their own weather:\u00a7r pWeatherReset=\u00a76Player weather has been reset for: \u00a7c{0} pWeatherSet=\u00a76Player weather is set to \u00a7c{0}\u00a76 for: \u00a7c{1}. pWeatherInvalidAlias=\u00a74Invalid weather type +cannotStackMob=\u00a74You do not have permission to stack multiple mobs diff --git a/Essentials/src/messages_it.properties b/Essentials/src/messages_it.properties index 4de25001b..9326bceac 100644 --- a/Essentials/src/messages_it.properties +++ b/Essentials/src/messages_it.properties @@ -531,3 +531,4 @@ pWeatherPlayers=\u00a76These players have their own weather:\u00a7r pWeatherReset=\u00a76Player weather has been reset for: \u00a7c{0} pWeatherSet=\u00a76Player weather is set to \u00a7c{0}\u00a76 for: \u00a7c{1}. pWeatherInvalidAlias=\u00a74Invalid weather type +cannotStackMob=\u00a74You do not have permission to stack multiple mobs diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index a8d2fd995..31ad9338c 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -531,3 +531,4 @@ pWeatherPlayers=\u00a76These players have their own weather:\u00a7r pWeatherReset=\u00a76Player weather has been reset for: \u00a7c{0} pWeatherSet=\u00a76Player weather is set to \u00a7c{0}\u00a76 for: \u00a7c{1}. pWeatherInvalidAlias=\u00a74Invalid weather type +cannotStackMob=\u00a74You do not have permission to stack multiple mobs diff --git a/Essentials/src/messages_pl.properties b/Essentials/src/messages_pl.properties index 2126fc8e0..47535ad29 100644 --- a/Essentials/src/messages_pl.properties +++ b/Essentials/src/messages_pl.properties @@ -531,3 +531,4 @@ pWeatherPlayers=\u00a76These players have their own weather:\u00a7r pWeatherReset=\u00a76Player weather has been reset for: \u00a7c{0} pWeatherSet=\u00a76Player weather is set to \u00a7c{0}\u00a76 for: \u00a7c{1}. pWeatherInvalidAlias=\u00a74Invalid weather type +cannotStackMob=\u00a74You do not have permission to stack multiple mobs diff --git a/Essentials/src/messages_pt.properties b/Essentials/src/messages_pt.properties index 9d7ffe2db..8ee78e7c0 100644 --- a/Essentials/src/messages_pt.properties +++ b/Essentials/src/messages_pt.properties @@ -531,3 +531,4 @@ pWeatherPlayers=\u00a76These players have their own weather:\u00a7r pWeatherReset=\u00a76Player weather has been reset for: \u00a7c{0} pWeatherSet=\u00a76Player weather is set to \u00a7c{0}\u00a76 for: \u00a7c{1}. pWeatherInvalidAlias=\u00a74Invalid weather type +cannotStackMob=\u00a74You do not have permission to stack multiple mobs diff --git a/Essentials/src/messages_ro.properties b/Essentials/src/messages_ro.properties index 6cd1b2dce..607578a07 100644 --- a/Essentials/src/messages_ro.properties +++ b/Essentials/src/messages_ro.properties @@ -219,7 +219,7 @@ kitGive=\u00a76Kitul\u00a7c {0}\u00a76. kitGiveTo=\u00a76Ai dat kitul\u00a7c {0}\u00a76 lui {1}\u00a7. kitInvFull=\u00a74Inventarul tau este plin, kitul este aruncat jos. kitOnce=\u00a74Nu poti folosi acest kit din nou. -kitReceive=\u00a76Ai primit kitul\u00a7c {0}\u00a76. +kitReceive=\u00a76Ai primit kitul\u00a7c {0}\u00a76. kitTimed=\u00a74Nu poti folosit acest kit inca\u00a7c {0}\u00a74. kits=\u00a76Kituri:\u00a7r {0} leatherSyntax=\u00a76Sintaxa culorilor la piele: color:,, ex: color:255,0,0. @@ -228,7 +228,7 @@ lightningUse=\u00a76L-ai fulgerat pe\u00a7c {0} listAfkTag= \u00a77[AFK]\u00a7r listAmount= \u00a76Sunt \u00a7c{0}\u00a76 din maxim \u00a7c{1}\u00a76 jucatori online. listAmountHidden= \u00a76Sunt \u00a7c{0}\u00a76/{1}\u00a76 din maxim \u00a7c{2}\u00a76 jucatori online. -listGroupTag={0}\u00a7r: +listGroupTag={0}\u00a7r: listHiddenTag= \u00a77[Ascuns]\u00a7r loadWarpError=\u00a74Incarcarea teleportarii a esuat {0}. localFormat=[L]<{0}> {1} @@ -531,3 +531,4 @@ pWeatherPlayers=\u00a76These players have their own weather:\u00a7r pWeatherReset=\u00a76Player weather has been reset for: \u00a7c{0} pWeatherSet=\u00a76Player weather is set to \u00a7c{0}\u00a76 for: \u00a7c{1}. pWeatherInvalidAlias=\u00a74Invalid weather type +cannotStackMob=\u00a74You do not have permission to stack multiple mobs diff --git a/Essentials/src/messages_se.properties b/Essentials/src/messages_se.properties index 4bd76218e..789e7ed37 100644 --- a/Essentials/src/messages_se.properties +++ b/Essentials/src/messages_se.properties @@ -531,3 +531,4 @@ pWeatherPlayers=\u00a76These players have their own weather:\u00a7r pWeatherReset=\u00a76Player weather has been reset for: \u00a7c{0} pWeatherSet=\u00a76Player weather is set to \u00a7c{0}\u00a76 for: \u00a7c{1}. pWeatherInvalidAlias=\u00a74Invalid weather type +cannotStackMob=\u00a74You do not have permission to stack multiple mobs