diff options
author | okamosy <okamosy@gmail.com> | 2013-07-17 18:29:46 +0100 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2013-07-17 23:32:25 +0100 |
commit | 7935d2838167fde7efc128fffd6a6299b44a4e46 (patch) | |
tree | 94df32eb0751b4f1ea8067ffdb12b4b8b7cef050 | |
parent | 307e933052d73bbd58e74db5e4b0faa66d56340f (diff) | |
download | Essentials-7935d2838167fde7efc128fffd6a6299b44a4e46.tar Essentials-7935d2838167fde7efc128fffd6a6299b44a4e46.tar.gz Essentials-7935d2838167fde7efc128fffd6a6299b44a4e46.tar.lz Essentials-7935d2838167fde7efc128fffd6a6299b44a4e46.tar.xz Essentials-7935d2838167fde7efc128fffd6a6299b44a4e46.zip |
Added horse armor /spawnmob horse:armor<iron|gold|diamond>
-rw-r--r-- | Essentials/src/com/earth2me/essentials/Essentials.java | 2 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/Settings.java | 2 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/SpawnMob.java | 18 |
3 files changed, 20 insertions, 2 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 64e17e196..96ee6fed1 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -400,7 +400,7 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials } } - //Print version even if admin command is not available + //Print version even if admin command is not available #easteregg if (commandLabel.equalsIgnoreCase("essversion")) { sender.sendMessage("This server is running Essentials " + getDescription().getVersion()); diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index a10477e43..f958c10ab 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -1106,7 +1106,7 @@ public class Settings implements net.ess3.api.ISettings return config.getInt("max-nick-length", 30); } - + // #easteregg public int getMaxUserCacheCount() { long count = Runtime.getRuntime().maxMemory() / 1024 / 96; diff --git a/Essentials/src/com/earth2me/essentials/SpawnMob.java b/Essentials/src/com/earth2me/essentials/SpawnMob.java index 63686f40e..2c40f448f 100644 --- a/Essentials/src/com/earth2me/essentials/SpawnMob.java +++ b/Essentials/src/com/earth2me/essentials/SpawnMob.java @@ -21,6 +21,7 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.*; import org.bukkit.entity.Skeleton.SkeletonType; import org.bukkit.inventory.EntityEquipment; +import org.bukkit.inventory.HorseInventory; import org.bukkit.inventory.ItemStack; import org.bukkit.material.Colorable; @@ -477,6 +478,23 @@ public class SpawnMob ((Horse)spawned).setTamed(true); ((Horse)spawned).getInventory().setSaddle(new ItemStack(Material.SADDLE, 1)); } + + if (data.contains("armor")) + { + ((Horse)spawned).setTamed(true); + HorseInventory invent = ((Horse)spawned).getInventory(); + if (data.contains("gold")) { + invent.setArmor(new ItemStack(Material.GOLD_BARDING, 1)); + } + else if (data.contains("diamond")) + { + invent.setArmor(new ItemStack(Material.DIAMOND_BARDING, 1)); + } + else + { + invent.setArmor(new ItemStack(Material.IRON_BARDING, 1)); + } + } } if (type == EntityType.PIG) |