diff options
-rw-r--r-- | Essentials/src/com/earth2me/essentials/Essentials.java | 4 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/Mob.java | 4 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/Util.java | 4 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandkittycannon.java | 44 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandnuke.java | 2 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java | 55 | ||||
-rw-r--r-- | Essentials/src/items.csv | 10 | ||||
-rw-r--r-- | Essentials/src/plugin.yml | 3 | ||||
-rw-r--r-- | lib/bukkit.jar | bin | 4686877 -> 4690989 bytes | |||
-rw-r--r-- | lib/craftbukkit.jar | bin | 10921072 -> 11039537 bytes |
10 files changed, 95 insertions, 31 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index d7f749eb7..ccc90cb01 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -66,7 +66,7 @@ import org.yaml.snakeyaml.error.YAMLException; public class Essentials extends JavaPlugin implements IEssentials { - public static final int BUKKIT_VERSION = 1988; + public static final int BUKKIT_VERSION = 2015; private static final Logger LOGGER = Logger.getLogger("Minecraft"); private transient ISettings settings; private final transient TNTExplodeListener tntListener = new TNTExplodeListener(this); @@ -129,7 +129,7 @@ public class Essentials extends JavaPlugin implements IEssentials LOGGER.log(Level.WARNING, _("versionMismatch", plugin.getDescription().getName())); } } - final Matcher versionMatch = Pattern.compile("git-Bukkit-(?:(?:[0-9]+)\\.)+[0-9]+-R[0-9]+-(?:[0-9]+-g[0-9a-f]+-)?b([0-9]+)jnks.*").matcher(getServer().getVersion()); + final Matcher versionMatch = Pattern.compile("git-Bukkit-(?:(?:[0-9]+)\\.)+[0-9]+-R[\\.0-9]+-(?:[0-9]+-g[0-9a-f]+-)?b([0-9]+)jnks.*").matcher(getServer().getVersion()); if (versionMatch.matches()) { final int versionNumber = Integer.parseInt(versionMatch.group(1)); diff --git a/Essentials/src/com/earth2me/essentials/Mob.java b/Essentials/src/com/earth2me/essentials/Mob.java index 8523a1a87..38c11a81a 100644 --- a/Essentials/src/com/earth2me/essentials/Mob.java +++ b/Essentials/src/com/earth2me/essentials/Mob.java @@ -39,7 +39,9 @@ public enum Mob BLAZE("Blaze", Enemies.ENEMY, EntityType.BLAZE), MUSHROOMCOW("MushroomCow", Enemies.FRIENDLY, EntityType.MUSHROOM_COW), MAGMACUBE("MagmaCube", Enemies.ENEMY, EntityType.MAGMA_CUBE), - SNOWMAN("Snowman", Enemies.FRIENDLY, "", EntityType.SNOWMAN); + SNOWMAN("Snowman", Enemies.FRIENDLY, "", EntityType.SNOWMAN), + OCELOT("Ocelot", Enemies.NEUTRAL, EntityType.OCELOT), + IRONGOLEM("IronGolem", Enemies.NEUTRAL, EntityType.IRON_GOLEM); public static final Logger logger = Logger.getLogger("Minecraft"); diff --git a/Essentials/src/com/earth2me/essentials/Util.java b/Essentials/src/com/earth2me/essentials/Util.java index 51e80fc5b..fbb8deb08 100644 --- a/Essentials/src/com/earth2me/essentials/Util.java +++ b/Essentials/src/com/earth2me/essentials/Util.java @@ -293,7 +293,7 @@ public class Util while (isBlockUnsafe(world, x, y, z)) { y += 1; - if (y >= 127) + if (y >= world.getHighestBlockYAt(x, z)) { x += 1; break; @@ -304,8 +304,8 @@ public class Util y -= 1; if (y <= 1) { - y = 127; x += 1; + y = world.getHighestBlockYAt(x, z); if (x - 32 > loc.getBlockX()) { throw new Exception(_("holeInFloor")); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkittycannon.java b/Essentials/src/com/earth2me/essentials/commands/Commandkittycannon.java new file mode 100644 index 000000000..9db608235 --- /dev/null +++ b/Essentials/src/com/earth2me/essentials/commands/Commandkittycannon.java @@ -0,0 +1,44 @@ +package com.earth2me.essentials.commands; + +import com.earth2me.essentials.Mob; +import com.earth2me.essentials.User; +import java.util.Random; +import org.bukkit.Location; +import org.bukkit.Server; +import org.bukkit.entity.Ocelot; + + +public class Commandkittycannon extends EssentialsCommand +{ + private static Random random = new Random(); + + public Commandkittycannon() + { + super("kittycannon"); + } + + @Override + protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception + { + final Mob cat = Mob.OCELOT; + final Ocelot ocelot = (Ocelot)cat.spawn(user, server, user.getEyeLocation()); + if (ocelot == null) + { + return; + } + final int i = random.nextInt(Ocelot.Type.values().length); + ocelot.setCatType(Ocelot.Type.values()[i]); + ocelot.setTamed(true); + ocelot.setVelocity(user.getEyeLocation().getDirection().multiply(2)); + ess.scheduleSyncDelayedTask(new Runnable() + { + @Override + public void run() + { + final Location loc = ocelot.getLocation(); + ocelot.remove(); + loc.getWorld().createExplosion(loc, 0F); + } + }, 20); + } +} diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java b/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java index ac92110cd..19695233e 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java @@ -51,7 +51,7 @@ public class Commandnuke extends EssentialsCommand { for (int z = -10; z <= 10; z += 5) { - final Location tntloc = new Location(world, loc.getBlockX() + x, 127, loc.getBlockZ() + z); + final Location tntloc = new Location(world, loc.getBlockX() + x, world.getMaxHeight(), loc.getBlockZ() + z); final TNTPrimed tnt = world.spawn(tntloc, TNTPrimed.class); } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java index c8478f923..8d716106f 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java @@ -196,8 +196,9 @@ public class Commandspawnmob extends EssentialsCommand } } - private void changeMobData(final EntityType type, final Entity spawned, final String data, final User user) throws Exception + private void changeMobData(final EntityType type, final Entity spawned, String data, final User user) throws Exception { + data = data.toLowerCase(Locale.ENGLISH); if (type == EntityType.SLIME || type == EntityType.MAGMA_CUBE) { try @@ -214,23 +215,20 @@ public class Commandspawnmob extends EssentialsCommand || type == EntityType.MUSHROOM_COW || type == EntityType.CHICKEN || type == EntityType.PIG + || type == EntityType.VILLAGER + || type == EntityType.OCELOT || type == EntityType.WOLF) - && data.equalsIgnoreCase("baby")) + && data.contains("baby")) { - ((Animals)spawned).setAge(-24000); + ((Animals)spawned).setBaby(); return; } if (type == EntityType.SHEEP) { - if (data.toLowerCase(Locale.ENGLISH).contains("baby")) - { - ((Sheep)spawned).setAge(-24000); - } final String color = data.toUpperCase(Locale.ENGLISH).replace("BABY", ""); try { - - if (color.equalsIgnoreCase("random")) + if (color.equals("RANDOM")) { Random rand = new Random(); ((Sheep)spawned).setColor(DyeColor.values()[rand.nextInt(DyeColor.values().length)]); @@ -245,30 +243,37 @@ public class Commandspawnmob extends EssentialsCommand throw new Exception(_("sheepMalformedColor"), e); } } - if (type == EntityType.WOLF - && data.toLowerCase(Locale.ENGLISH).startsWith("tamed")) + if ((type == EntityType.WOLF + || type == EntityType.OCELOT) + && data.contains("tamed")) { - final Wolf wolf = ((Wolf)spawned); - wolf.setTamed(true); - wolf.setOwner(user); - wolf.setSitting(true); - if (data.equalsIgnoreCase("tamedbaby")) - { - ((Animals)spawned).setAge(-24000); - } + final Tameable tameable = ((Tameable)spawned); + tameable.setTamed(true); + tameable.setOwner(user.getBase()); } if (type == EntityType.WOLF - && data.toLowerCase(Locale.ENGLISH).startsWith("angry")) + && data.contains("angry")) { ((Wolf)spawned).setAngry(true); - if (data.equalsIgnoreCase("angrybaby")) - { - ((Animals)spawned).setAge(-24000); - } } - if (type == EntityType.CREEPER && data.equalsIgnoreCase("powered")) + if (type == EntityType.CREEPER && data.contains("powered")) { ((Creeper)spawned).setPowered(true); } + if (type == EntityType.OCELOT) + { + if (data.contains("siamese")) + { + ((Ocelot)spawned).setCatType(Ocelot.Type.SIAMESE_CAT); + } + if (data.contains("red")) + { + ((Ocelot)spawned).setCatType(Ocelot.Type.RED_CAT); + } + if (data.contains("black")) + { + ((Ocelot)spawned).setCatType(Ocelot.Type.BLACK_CAT); + } + } } } diff --git a/Essentials/src/items.csv b/Essentials/src/items.csv index 98c25c327..acec277cc 100644 --- a/Essentials/src/items.csv +++ b/Essentials/src/items.csv @@ -1461,6 +1461,9 @@ dragonegg,122,0 degg,122,0 bossegg,122,0 begg,122,0 +redstonelamp,123,0 +redlamp,123,0 +rslamp,123,0 ironshovel,256,0 ironspade,256,0 ishovel,256,0 @@ -2452,7 +2455,14 @@ squidegg,383,94 wolfegg,383,95 mooshroomegg,383,96 mushroomcowegg,383,96 +snowgolemegg,383,97 +ocelotegg,383,98 +irongolemegg,383,99 villageregg,383,120 +bottleofenchanting,384,0 +enchantingbottle,384,0 +expbottle,384,0 +xpbottle,384,0 goldmusicrecord,2256,0 goldmusicdisk,2256,0 goldmusiccd,2256,0 diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index dcc8743b2..714abde4b 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -186,6 +186,9 @@ commands: description: Kill all mobs in a world. usage: /<command> [mobType] [radius] aliases: [ekillall,butcher,ebutcher] + kittycannon: + description: Throw an exploding kitten at your opponent + usage: /<command> list: description: List all online players. usage: /<command> diff --git a/lib/bukkit.jar b/lib/bukkit.jar Binary files differindex 8d0f64e0e..0b13c3119 100644 --- a/lib/bukkit.jar +++ b/lib/bukkit.jar diff --git a/lib/craftbukkit.jar b/lib/craftbukkit.jar Binary files differindex 7c14fe740..8b32a634a 100644 --- a/lib/craftbukkit.jar +++ b/lib/craftbukkit.jar |