Add splash potion watcher
This commit is contained in:
parent
6dfeb5f10a
commit
8679ddf4b6
@ -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());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user