Add painting watcher

This commit is contained in:
libraryaddict 2013-11-24 08:26:40 +13:00
parent 8679ddf4b6
commit 15eab31347

View File

@ -0,0 +1,33 @@
package me.libraryaddict.disguise.disguisetypes.watchers;
import org.bukkit.Art;
import me.libraryaddict.disguise.disguisetypes.Disguise;
import me.libraryaddict.disguise.disguisetypes.FlagWatcher;
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
public class PaintingWatcher extends FlagWatcher {
private Art painting;
public PaintingWatcher(Disguise disguise) {
super(disguise);
}
public Art getPainting() {
return painting;
}
@Override
public PaintingWatcher clone(Disguise disguise) {
PaintingWatcher watcher = (PaintingWatcher) super.clone(disguise);
watcher.setPainting(getPainting());
return watcher;
}
public void setPainting(Art newPainting) {
this.painting = newPainting;
if (getDisguise().getEntity() != null && getDisguise().getWatcher() == this) {
DisguiseUtilities.refreshTrackers(getDisguise().getEntity());
}
}
}