From 8679ddf4b62c2a1246b63004999cdf55a91c9320 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sun, 24 Nov 2013 08:26:33 +1300 Subject: [PATCH] Add splash potion watcher --- .../watchers/SplashPotionWatcher.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/me/libraryaddict/disguise/disguisetypes/watchers/SplashPotionWatcher.java diff --git a/src/me/libraryaddict/disguise/disguisetypes/watchers/SplashPotionWatcher.java b/src/me/libraryaddict/disguise/disguisetypes/watchers/SplashPotionWatcher.java new file mode 100644 index 00000000..7ef268a0 --- /dev/null +++ b/src/me/libraryaddict/disguise/disguisetypes/watchers/SplashPotionWatcher.java @@ -0,0 +1,32 @@ +package me.libraryaddict.disguise.disguisetypes.watchers; + +import me.libraryaddict.disguise.disguisetypes.Disguise; +import me.libraryaddict.disguise.disguisetypes.FlagWatcher; +import me.libraryaddict.disguise.utilities.DisguiseUtilities; + +public class SplashPotionWatcher extends FlagWatcher { + private int potionId; + + public SplashPotionWatcher(Disguise disguise) { + super(disguise); + } + + public int getPotionId() { + return potionId; + } + + @Override + public SplashPotionWatcher clone(Disguise disguise) { + SplashPotionWatcher watcher = (SplashPotionWatcher) super.clone(disguise); + watcher.setPotionId(getPotionId()); + return watcher; + } + + public void setPotionId(int newPotionId) { + this.potionId = newPotionId; + if (getDisguise().getEntity() != null && getDisguise().getWatcher() == this) { + DisguiseUtilities.refreshTrackers(getDisguise().getEntity()); + } + } + +}