summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2013-01-09 00:40:52 +0000
committerKHobbits <rob@khobbits.co.uk>2013-01-09 00:41:24 +0000
commit6c48e02c14518cc323a44d557504cc5e60f5ef3d (patch)
tree239b266b9a32a5e31b89eaaccf7380f1c48d5b89
parentc54d68a6603c42949e71e9ad3506bdd2926b3f4c (diff)
downloadEssentials-6c48e02c14518cc323a44d557504cc5e60f5ef3d.tar
Essentials-6c48e02c14518cc323a44d557504cc5e60f5ef3d.tar.gz
Essentials-6c48e02c14518cc323a44d557504cc5e60f5ef3d.tar.lz
Essentials-6c48e02c14518cc323a44d557504cc5e60f5ef3d.tar.xz
Essentials-6c48e02c14518cc323a44d557504cc5e60f5ef3d.zip
Add a couple of extra entities to spawnmob
-rw-r--r--Essentials/src/com/earth2me/essentials/Mob.java19
-rw-r--r--Essentials/src/com/earth2me/essentials/SpawnMob.java8
-rw-r--r--Essentials/src/plugin.yml2
3 files changed, 21 insertions, 8 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Mob.java b/Essentials/src/com/earth2me/essentials/Mob.java
index fccef1b24..1586b041d 100644
--- a/Essentials/src/com/earth2me/essentials/Mob.java
+++ b/Essentials/src/com/earth2me/essentials/Mob.java
@@ -7,6 +7,7 @@ import java.util.logging.Logger;
import org.bukkit.Location;
import org.bukkit.Server;
import org.bukkit.World;
+import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
@@ -43,8 +44,11 @@ public enum Mob
IRONGOLEM("IronGolem", Enemies.NEUTRAL, EntityType.IRON_GOLEM),
WITHER("Wither", Enemies.ENEMY, EntityType.WITHER),
BAT("Bat", Enemies.FRIENDLY, EntityType.BAT),
- WITCH("Witch", Enemies.ENEMY, EntityType.WITCH);
-
+ WITCH("Witch", Enemies.ENEMY, EntityType.WITCH),
+ BOAT("Boat", Enemies.NEUTRAL, EntityType.BOAT),
+ MINECART("Minecart", Enemies.NEUTRAL, EntityType.MINECART),
+ ENDERCRYSTAL("EnderCrystal", Enemies.NEUTRAL, EntityType.ENDER_CRYSTAL),
+ EXPERIENCEORB("ExperienceOrb", Enemies.NEUTRAL, EntityType.EXPERIENCE_ORB);
public static final Logger logger = Logger.getLogger("Minecraft");
private Mob(String n, Enemies en, String s, EntityType type)
@@ -75,18 +79,19 @@ public enum Mob
}
}
- public static Set<String> getMobList() {
+ public static Set<String> getMobList()
+ {
return Collections.unmodifiableSet(hashMap.keySet());
}
- public LivingEntity spawn(final Player player, final Server server, final Location loc) throws MobException
+ public Entity spawn(final Player player, final Server server, final Location loc) throws MobException
{
return spawn(player.getWorld(), server, loc);
}
-
- public LivingEntity spawn(final World world, final Server server, final Location loc) throws MobException
+
+ public Entity spawn(final World world, final Server server, final Location loc) throws MobException
{
- final LivingEntity entity = world.spawn(loc, (Class<? extends LivingEntity>)this.bukkitType.getEntityClass());
+ final Entity entity = world.spawn(loc, (Class<? extends Entity>)this.bukkitType.getEntityClass());
if (entity == null)
{
logger.log(Level.WARNING, _("unableToSpawnMob"));
diff --git a/Essentials/src/com/earth2me/essentials/SpawnMob.java b/Essentials/src/com/earth2me/essentials/SpawnMob.java
index 7eb59974c..cdb00cb3d 100644
--- a/Essentials/src/com/earth2me/essentials/SpawnMob.java
+++ b/Essentials/src/com/earth2me/essentials/SpawnMob.java
@@ -283,5 +283,13 @@ public class SpawnMob
}
}
+ if (type == EntityType.EXPERIENCE_ORB)
+ {
+ if (Util.isInt(data))
+ {
+ ((ExperienceOrb)spawned).setExperience(Integer.parseInt(data));
+
+ }
+ }
}
}
diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml
index 37ec60147..4e8d68461 100644
--- a/Essentials/src/plugin.yml
+++ b/Essentials/src/plugin.yml
@@ -329,7 +329,7 @@ commands:
spawnmob:
description: Spawns a mob.
usage: /<command> <mob>[:data][,<mount>[:data]] [amount] [player]
- aliases: [espawnmob,mob,emob]
+ aliases: [espawnmob,spawnentity,espawnentity,mob,emob]
speed:
description: Change your speed limits
usage: /<command> <speed> [player]