Add falling block watcher
This commit is contained in:
parent
15eab31347
commit
a19b3a7833
@ -0,0 +1,33 @@
|
||||
package me.libraryaddict.disguise.disguisetypes.watchers;
|
||||
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import me.libraryaddict.disguise.disguisetypes.Disguise;
|
||||
import me.libraryaddict.disguise.disguisetypes.FlagWatcher;
|
||||
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
|
||||
|
||||
public class FallingBlockWatcher extends FlagWatcher {
|
||||
private ItemStack block;
|
||||
|
||||
public FallingBlockWatcher(Disguise disguise) {
|
||||
super(disguise);
|
||||
}
|
||||
|
||||
public void setBlock(ItemStack block) {
|
||||
this.block = block;
|
||||
if (getDisguise().getEntity() != null && getDisguise().getWatcher() == this) {
|
||||
DisguiseUtilities.refreshTrackers(getDisguise().getEntity());
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack getBlock() {
|
||||
return block;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FallingBlockWatcher clone(Disguise disguise) {
|
||||
FallingBlockWatcher watcher = (FallingBlockWatcher) super.clone(disguise);
|
||||
watcher.setBlock(getBlock());
|
||||
return watcher;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user