Use Disguise instead of entity id in watcher

This commit is contained in:
Andrew 2013-07-21 15:14:40 +12:00
parent dcb8bc427e
commit ff8542c80a
29 changed files with 108 additions and 59 deletions

View File

@ -1,9 +1,11 @@
package me.libraryaddict.disguise.DisguiseTypes.Watchers;
import me.libraryaddict.disguise.DisguiseTypes.Disguise;
public abstract class AgeableWatcher extends LivingWatcher {
public AgeableWatcher(int entityId) {
super(entityId);
public AgeableWatcher(Disguise disguise) {
super(disguise);
}
public boolean isAdult() {

View File

@ -1,11 +1,12 @@
package me.libraryaddict.disguise.DisguiseTypes.Watchers;
import me.libraryaddict.disguise.DisguiseTypes.Disguise;
import me.libraryaddict.disguise.DisguiseTypes.FlagWatcher;
public class ArrowWatcher extends FlagWatcher {
public ArrowWatcher(int entityId) {
super(entityId);
public ArrowWatcher(Disguise disguise) {
super(disguise);
setValue(16, (byte) 0);
}

View File

@ -1,9 +1,11 @@
package me.libraryaddict.disguise.DisguiseTypes.Watchers;
import me.libraryaddict.disguise.DisguiseTypes.Disguise;
public class BatWatcher extends LivingWatcher {
public BatWatcher(int entityId) {
super(entityId);
public BatWatcher(Disguise disguise) {
super(disguise);
}
public boolean isFlying() {

View File

@ -1,9 +1,11 @@
package me.libraryaddict.disguise.DisguiseTypes.Watchers;
import me.libraryaddict.disguise.DisguiseTypes.Disguise;
public class BlazeWatcher extends LivingWatcher {
public BlazeWatcher(int entityId) {
super(entityId);
public BlazeWatcher(Disguise disguise) {
super(disguise);
}
public boolean isBlazing() {

View File

@ -1,11 +1,12 @@
package me.libraryaddict.disguise.DisguiseTypes.Watchers;
import me.libraryaddict.disguise.DisguiseTypes.Disguise;
import me.libraryaddict.disguise.DisguiseTypes.FlagWatcher;
public class BoatWatcher extends FlagWatcher {
public BoatWatcher(int entityId) {
super(entityId);
public BoatWatcher(Disguise disguise) {
super(disguise);
}
public int getDamage() {

View File

@ -1,9 +1,11 @@
package me.libraryaddict.disguise.DisguiseTypes.Watchers;
import me.libraryaddict.disguise.DisguiseTypes.Disguise;
public class ChickenWatcher extends AgeableWatcher {
public ChickenWatcher(int entityId) {
super(entityId);
public ChickenWatcher(Disguise disguise) {
super(disguise);
}
}

View File

@ -1,9 +1,11 @@
package me.libraryaddict.disguise.DisguiseTypes.Watchers;
import me.libraryaddict.disguise.DisguiseTypes.Disguise;
public class CowWatcher extends AgeableWatcher {
public CowWatcher(int entityId) {
super(entityId);
public CowWatcher(Disguise disguise) {
super(disguise);
}
}

View File

@ -1,9 +1,11 @@
package me.libraryaddict.disguise.DisguiseTypes.Watchers;
import me.libraryaddict.disguise.DisguiseTypes.Disguise;
public class CreeperWatcher extends LivingWatcher {
public CreeperWatcher(int entityId) {
super(entityId);
public CreeperWatcher(Disguise disguise) {
super(disguise);
}
public boolean isFused() {

View File

@ -3,12 +3,13 @@ package me.libraryaddict.disguise.DisguiseTypes.Watchers;
import org.bukkit.craftbukkit.v1_6_R2.inventory.CraftItemStack;
import org.bukkit.inventory.ItemStack;
import me.libraryaddict.disguise.DisguiseTypes.Disguise;
import me.libraryaddict.disguise.DisguiseTypes.FlagWatcher;
public class DroppedItemWatcher extends FlagWatcher {
public DroppedItemWatcher(int entityId) {
super(entityId);
public DroppedItemWatcher(Disguise disguise) {
super(disguise);
}
public ItemStack getItemStack() {

View File

@ -1,9 +1,11 @@
package me.libraryaddict.disguise.DisguiseTypes.Watchers;
import me.libraryaddict.disguise.DisguiseTypes.Disguise;
public class EnderDragonWatcher extends LivingWatcher {
public EnderDragonWatcher(int entityId) {
super(entityId);
public EnderDragonWatcher(Disguise disguise) {
super(disguise);
}
}

View File

@ -1,9 +1,11 @@
package me.libraryaddict.disguise.DisguiseTypes.Watchers;
import me.libraryaddict.disguise.DisguiseTypes.Disguise;
public class EndermanWatcher extends LivingWatcher {
public EndermanWatcher(int entityId) {
super(entityId);
public EndermanWatcher(Disguise disguise) {
super(disguise);
}
public int getCarriedData() {

View File

@ -1,9 +1,11 @@
package me.libraryaddict.disguise.DisguiseTypes.Watchers;
import me.libraryaddict.disguise.DisguiseTypes.Disguise;
public class GhastWatcher extends LivingWatcher {
public GhastWatcher(int entityId) {
super(entityId);
public GhastWatcher(Disguise disguise) {
super(disguise);
}
public boolean isAgressive() {

View File

@ -2,13 +2,15 @@ package me.libraryaddict.disguise.DisguiseTypes.Watchers;
import java.util.Random;
import me.libraryaddict.disguise.DisguiseTypes.Disguise;
import org.bukkit.entity.Horse.Color;
import org.bukkit.entity.Horse.Style;
public class HorseWatcher extends AgeableWatcher {
public HorseWatcher(int entityId) {
super(entityId);
public HorseWatcher(Disguise disguise) {
super(disguise);
setValue(20, new Random().nextInt(7));
}

View File

@ -3,12 +3,13 @@ package me.libraryaddict.disguise.DisguiseTypes.Watchers;
import org.bukkit.craftbukkit.v1_6_R2.inventory.CraftItemStack;
import org.bukkit.inventory.ItemStack;
import me.libraryaddict.disguise.DisguiseTypes.Disguise;
import me.libraryaddict.disguise.DisguiseTypes.FlagWatcher;
public class ItemFrameWatcher extends FlagWatcher {
public ItemFrameWatcher(int entityId) {
super(entityId);
public ItemFrameWatcher(Disguise disguise) {
super(disguise);
}
public ItemStack getItemStack() {

View File

@ -8,14 +8,14 @@ import net.minecraft.server.v1_6_R2.PotionBrewer;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import me.libraryaddict.disguise.DisguiseTypes.Disguise;
import me.libraryaddict.disguise.DisguiseTypes.FlagWatcher;
public class LivingWatcher extends FlagWatcher {
private HashSet<MobEffect> potionEffects = new HashSet<MobEffect>();
public LivingWatcher(int entityId) {
super(entityId);
public LivingWatcher(Disguise disguise) {
super(disguise);
}
public void addPotionEffect(PotionEffect potionEffect) {

View File

@ -1,8 +1,10 @@
package me.libraryaddict.disguise.DisguiseTypes.Watchers;
import me.libraryaddict.disguise.DisguiseTypes.Disguise;
public class MagmaCubeWatcher extends SlimeWatcher {
public MagmaCubeWatcher(int entityId) {
super(entityId);
public MagmaCubeWatcher(Disguise disguise) {
super(disguise);
}
}

View File

@ -1,11 +1,12 @@
package me.libraryaddict.disguise.DisguiseTypes.Watchers;
import me.libraryaddict.disguise.DisguiseTypes.Disguise;
import me.libraryaddict.disguise.DisguiseTypes.FlagWatcher;
public class MinecartWatcher extends FlagWatcher {
public MinecartWatcher(int entityId) {
super(entityId);
public MinecartWatcher(Disguise disguise) {
super(disguise);
}
public float getDamage() {

View File

@ -1,9 +1,11 @@
package me.libraryaddict.disguise.DisguiseTypes.Watchers;
import me.libraryaddict.disguise.DisguiseTypes.Disguise;
public class MushroomCowWatcher extends AgeableWatcher {
public MushroomCowWatcher(int entityId) {
super(entityId);
public MushroomCowWatcher(Disguise disguise) {
super(disguise);
}
}

View File

@ -1,12 +1,14 @@
package me.libraryaddict.disguise.DisguiseTypes.Watchers;
import me.libraryaddict.disguise.DisguiseTypes.Disguise;
import org.bukkit.entity.Ocelot;
import org.bukkit.entity.Ocelot.Type;
public class OcelotWatcher extends AgeableWatcher {
public OcelotWatcher(int entityId) {
super(entityId);
public OcelotWatcher(Disguise disguise) {
super(disguise);
}
public String getOwner() {

View File

@ -1,9 +1,11 @@
package me.libraryaddict.disguise.DisguiseTypes.Watchers;
import me.libraryaddict.disguise.DisguiseTypes.Disguise;
public class PigWatcher extends AgeableWatcher {
public PigWatcher(int entityId) {
super(entityId);
public PigWatcher(Disguise disguise) {
super(disguise);
}
public boolean isSaddled() {

View File

@ -1,9 +1,11 @@
package me.libraryaddict.disguise.DisguiseTypes.Watchers;
import me.libraryaddict.disguise.DisguiseTypes.Disguise;
public class PigZombieWatcher extends ZombieWatcher {
public PigZombieWatcher(int entityId) {
super(entityId);
public PigZombieWatcher(Disguise disguise) {
super(disguise);
}
}

View File

@ -1,9 +1,11 @@
package me.libraryaddict.disguise.DisguiseTypes.Watchers;
import me.libraryaddict.disguise.DisguiseTypes.Disguise;
public class PlayerWatcher extends LivingWatcher {
public PlayerWatcher(int entityId) {
super(entityId);
public PlayerWatcher(Disguise disguise) {
super(disguise);
}
public int getArrowsSticking() {

View File

@ -1,11 +1,12 @@
package me.libraryaddict.disguise.DisguiseTypes.Watchers;
import me.libraryaddict.disguise.DisguiseTypes.AnimalColor;
import me.libraryaddict.disguise.DisguiseTypes.Disguise;
public class SheepWatcher extends AgeableWatcher {
public SheepWatcher(int entityId) {
super(entityId);
public SheepWatcher(Disguise disguise) {
super(disguise);
setValue(16, (byte) 0);
}

View File

@ -1,9 +1,11 @@
package me.libraryaddict.disguise.DisguiseTypes.Watchers;
import me.libraryaddict.disguise.DisguiseTypes.Disguise;
public class SkeletonWatcher extends LivingWatcher {
public SkeletonWatcher(int entityId) {
super(entityId);
public SkeletonWatcher(Disguise disguise) {
super(disguise);
}
}

View File

@ -2,10 +2,12 @@ package me.libraryaddict.disguise.DisguiseTypes.Watchers;
import java.util.Random;
import me.libraryaddict.disguise.DisguiseTypes.Disguise;
public class SlimeWatcher extends LivingWatcher {
public SlimeWatcher(int entityId) {
super(entityId);
public SlimeWatcher(Disguise disguise) {
super(disguise);
setValue(16, (byte) (new Random().nextInt(4) + 1));
}

View File

@ -2,12 +2,14 @@ package me.libraryaddict.disguise.DisguiseTypes.Watchers;
import java.util.Random;
import me.libraryaddict.disguise.DisguiseTypes.Disguise;
import org.bukkit.entity.Villager.Profession;
public class VillagerWatcher extends AgeableWatcher {
public VillagerWatcher(int entityId) {
super(entityId);
public VillagerWatcher(Disguise disguise) {
super(disguise);
setValue(16, Profession.values()[new Random().nextInt(Profession.values().length)].getId());
}

View File

@ -1,8 +1,10 @@
package me.libraryaddict.disguise.DisguiseTypes.Watchers;
import me.libraryaddict.disguise.DisguiseTypes.Disguise;
public class WitherWatcher extends EnderDragonWatcher {
public WitherWatcher(int entityId) {
super(entityId);
public WitherWatcher(Disguise disguise) {
super(disguise);
}
}

View File

@ -1,11 +1,12 @@
package me.libraryaddict.disguise.DisguiseTypes.Watchers;
import me.libraryaddict.disguise.DisguiseTypes.AnimalColor;
import me.libraryaddict.disguise.DisguiseTypes.Disguise;
public class WolfWatcher extends AgeableWatcher {
public WolfWatcher(int entityId) {
super(entityId);
public WolfWatcher(Disguise disguise) {
super(disguise);
}
public AnimalColor getCollarColor() {

View File

@ -1,9 +1,11 @@
package me.libraryaddict.disguise.DisguiseTypes.Watchers;
import me.libraryaddict.disguise.DisguiseTypes.Disguise;
public class ZombieWatcher extends LivingWatcher {
public ZombieWatcher(int entityId) {
super(entityId);
public ZombieWatcher(Disguise disguise) {
super(disguise);
}
public boolean isAdult() {