summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2011-11-28 22:06:59 +0100
committersnowleo <schneeleo@gmail.com>2011-11-28 22:06:59 +0100
commit8c06b13a77891fecf7f178a8e00c8fdd9960d67f (patch)
tree71831b90bc2b7e3b32af0df57052ebb1514cabbc
parent7db7fd4136a525bd6c2b6b180c34b6e9d1fb77cb (diff)
downloadEssentials-8c06b13a77891fecf7f178a8e00c8fdd9960d67f.tar
Essentials-8c06b13a77891fecf7f178a8e00c8fdd9960d67f.tar.gz
Essentials-8c06b13a77891fecf7f178a8e00c8fdd9960d67f.tar.lz
Essentials-8c06b13a77891fecf7f178a8e00c8fdd9960d67f.tar.xz
Essentials-8c06b13a77891fecf7f178a8e00c8fdd9960d67f.zip
Allow to set size of MagmaCubes in /spawnmob
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java30
1 files changed, 15 insertions, 15 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java
index 863821973..c9970c068 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java
@@ -116,11 +116,11 @@ public class Commandspawnmob extends EssentialsCommand
}
if (mobData != null)
{
- changeMobData(mob.name, spawnedMob, mobData, user);
+ changeMobData(mob.getType(), spawnedMob, mobData, user);
}
if (spawnedMount != null && mountData != null)
{
- changeMobData(mobMount.name, spawnedMount, mountData, user);
+ changeMobData(mobMount.getType(), spawnedMount, mountData, user);
}
if (args.length == 2)
{
@@ -151,11 +151,11 @@ public class Commandspawnmob extends EssentialsCommand
}
if (mobData != null)
{
- changeMobData(mob.name, spawnedMob, mobData, user);
+ changeMobData(mob.getType(), spawnedMob, mobData, user);
}
if (spawnedMount != null && mountData != null)
{
- changeMobData(mobMount.name, spawnedMount, mountData, user);
+ changeMobData(mobMount.getType(), spawnedMount, mountData, user);
}
}
user.sendMessage(args[1] + " " + mob.name.toLowerCase(Locale.ENGLISH) + mob.suffix + " " + _("spawned"));
@@ -179,9 +179,9 @@ public class Commandspawnmob extends EssentialsCommand
}
}
- private void changeMobData(String type, Entity spawned, String data, User user) throws Exception
+ private void changeMobData(CreatureType type, Entity spawned, String data, User user) throws Exception
{
- if ("Slime".equalsIgnoreCase(type))
+ if (type == CreatureType.SLIME || type == CreatureType.MAGMA_CUBE)
{
try
{
@@ -192,17 +192,17 @@ public class Commandspawnmob extends EssentialsCommand
throw new Exception(_("slimeMalformedSize"), e);
}
}
- if (("Sheep".equalsIgnoreCase(type)
- || "Cow".equalsIgnoreCase(type)
- || "Chicken".equalsIgnoreCase(type)
- || "Pig".equalsIgnoreCase(type)
- || "Wolf".equalsIgnoreCase(type))
+ if ((type == CreatureType.SHEEP
+ || type == CreatureType.COW
+ || type == CreatureType.CHICKEN
+ || type == CreatureType.PIG
+ || type == CreatureType.WOLF)
&& data.equalsIgnoreCase("baby"))
{
((Animals)spawned).setAge(-24000);
return;
}
- if ("Sheep".equalsIgnoreCase(type))
+ if (type == CreatureType.SHEEP)
{
try
{
@@ -221,7 +221,7 @@ public class Commandspawnmob extends EssentialsCommand
throw new Exception(_("sheepMalformedColor"), e);
}
}
- if ("Wolf".equalsIgnoreCase(type)
+ if (type == CreatureType.WOLF
&& data.toLowerCase(Locale.ENGLISH).startsWith("tamed"))
{
final Wolf wolf = ((Wolf)spawned);
@@ -233,7 +233,7 @@ public class Commandspawnmob extends EssentialsCommand
((Animals)spawned).setAge(-24000);
}
}
- if ("Wolf".equalsIgnoreCase(type)
+ if (type == CreatureType.WOLF
&& data.toLowerCase(Locale.ENGLISH).startsWith("angry"))
{
((Wolf)spawned).setAngry(true);
@@ -242,7 +242,7 @@ public class Commandspawnmob extends EssentialsCommand
((Animals)spawned).setAge(-24000);
}
}
- if ("Creeper".equalsIgnoreCase(type) && data.equalsIgnoreCase("powered"))
+ if (type == CreatureType.CREEPER && data.equalsIgnoreCase("powered"))
{
((Creeper)spawned).setPowered(true);
}