From bf301855340f33bf1f2f0d8d55ba4a3f5bfa5c59 Mon Sep 17 00:00:00 2001 From: garbagemule Date: Mon, 7 Oct 2013 11:55:50 +0200 Subject: [PATCH] Add horse variants as monster types. --- resources/plugin.yml | 2 +- .../MobArena/waves/MACreature.java | 42 +++++++++++++------ 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/resources/plugin.yml b/resources/plugin.yml index d260b57..6ac3b75 100644 --- a/resources/plugin.yml +++ b/resources/plugin.yml @@ -1,7 +1,7 @@ name: MobArena author: garbagemule main: com.garbagemule.MobArena.MobArena -version: 0.95.5.36 +version: 0.95.5.37 softdepend: [Multiverse-Core,Towny,Heroes,MagicSpells,Vault] commands: ma: diff --git a/src/com/garbagemule/MobArena/waves/MACreature.java b/src/com/garbagemule/MobArena/waves/MACreature.java index 06cbc86..8bfcad9 100644 --- a/src/com/garbagemule/MobArena/waves/MACreature.java +++ b/src/com/garbagemule/MobArena/waves/MACreature.java @@ -7,17 +7,8 @@ import org.bukkit.DyeColor; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.World; -import org.bukkit.entity.Creature; -import org.bukkit.entity.EntityType; -import org.bukkit.entity.Creeper; -import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.PigZombie; -import org.bukkit.entity.Sheep; -import org.bukkit.entity.Skeleton; +import org.bukkit.entity.*; import org.bukkit.entity.Skeleton.SkeletonType; -import org.bukkit.entity.Slime; -import org.bukkit.entity.Wolf; -import org.bukkit.entity.Zombie; import org.bukkit.inventory.ItemStack; import com.garbagemule.MobArena.MobArena; @@ -86,8 +77,15 @@ public enum MACreature BABYZOMBIE(EntityType.ZOMBIE), BABYZOMBIES(EntityType.ZOMBIE), BABYPIGMAN(EntityType.PIG_ZOMBIE), BABYPIGMEN(EntityType.PIG_ZOMBIE), ZOMBIEVILLAGER(EntityType.ZOMBIE), ZOMBIEVILLAGERS(EntityType.ZOMBIE), - BABYZOMBIEVILLAGER(EntityType.ZOMBIE),BABYZOMBIEVILLAGERS(EntityType.ZOMBIE); - + BABYZOMBIEVILLAGER(EntityType.ZOMBIE),BABYZOMBIEVILLAGERS(EntityType.ZOMBIE), + + // 1.6 creatures + HORSE(EntityType.HORSE), HORSES(EntityType.HORSE), + DONKEY(EntityType.HORSE), DONKEYS(EntityType.HORSE), + MULE(EntityType.HORSE), MULES(EntityType.HORSE), + SKELETONHORSE(EntityType.HORSE), SKELETONHORSES(EntityType.HORSE), + UNDEADHORSE(EntityType.HORSE), UNDEADHORSES(EntityType.HORSE); + private List colors = Arrays.asList(DyeColor.values()); private EntityType type; @@ -176,6 +174,26 @@ public enum MACreature ((Skeleton) e).getEquipment().setItemInHand(new ItemStack(Material.STONE_SWORD, 1)); ((Skeleton) e).setSkeletonType(SkeletonType.WITHER); break; + case HORSE: + case HORSES: + ((Horse) e).setVariant(Horse.Variant.HORSE); + break; + case DONKEY: + case DONKEYS: + ((Horse) e).setVariant(Horse.Variant.DONKEY); + break; + case MULE: + case MULES: + ((Horse) e).setVariant(Horse.Variant.MULE); + break; + case SKELETONHORSE: + case SKELETONHORSES: + ((Horse) e).setVariant(Horse.Variant.SKELETON_HORSE); + break; + case UNDEADHORSE: + case UNDEADHORSES: + ((Horse) e).setVariant(Horse.Variant.UNDEAD_HORSE); + break; default: break; }