Check the current disguise is also the current flagwatcher
This commit is contained in:
		@@ -235,7 +235,7 @@ public class FlagWatcher {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected void sendData(int... dataValues) {
 | 
			
		||||
        if (!DisguiseAPI.isDisguiseInUse(getDisguise()))
 | 
			
		||||
        if (!DisguiseAPI.isDisguiseInUse(getDisguise()) || getDisguise().getWatcher() != this)
 | 
			
		||||
            return;
 | 
			
		||||
        List<WrappedWatchableObject> list = new ArrayList<WrappedWatchableObject>();
 | 
			
		||||
        for (int data : dataValues) {
 | 
			
		||||
@@ -322,7 +322,7 @@ public class FlagWatcher {
 | 
			
		||||
            itemToSend = ReflectionManager.getNmsItem(itemStack);
 | 
			
		||||
        }
 | 
			
		||||
        items[slot] = itemStack;
 | 
			
		||||
        if (DisguiseAPI.isDisguiseInUse(getDisguise())) {
 | 
			
		||||
        if (DisguiseAPI.isDisguiseInUse(getDisguise()) && getDisguise().getWatcher() == this) {
 | 
			
		||||
            slot++;
 | 
			
		||||
            if (slot > 4)
 | 
			
		||||
                slot = 0;
 | 
			
		||||
 
 | 
			
		||||
@@ -3,6 +3,7 @@ package me.libraryaddict.disguise.disguisetypes.watchers;
 | 
			
		||||
import org.bukkit.Material;
 | 
			
		||||
import org.bukkit.inventory.ItemStack;
 | 
			
		||||
 | 
			
		||||
import me.libraryaddict.disguise.DisguiseAPI;
 | 
			
		||||
import me.libraryaddict.disguise.disguisetypes.Disguise;
 | 
			
		||||
import me.libraryaddict.disguise.disguisetypes.FlagWatcher;
 | 
			
		||||
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
 | 
			
		||||
@@ -30,7 +31,7 @@ public class FallingBlockWatcher extends FlagWatcher {
 | 
			
		||||
        if (block.getType() == null || block.getType() == Material.AIR) {
 | 
			
		||||
            block.setType(Material.STONE);
 | 
			
		||||
        }
 | 
			
		||||
        if (getDisguise().getEntity() != null && getDisguise().getWatcher() == this) {
 | 
			
		||||
        if (DisguiseAPI.isDisguiseInUse(getDisguise()) && getDisguise().getWatcher() == this) {
 | 
			
		||||
            DisguiseUtilities.refreshTrackers(getDisguise());
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -168,7 +168,7 @@ public class LivingWatcher extends FlagWatcher {
 | 
			
		||||
    public void setMaxHealth(double newHealth) {
 | 
			
		||||
        this.maxHealth = newHealth;
 | 
			
		||||
        this.maxHealthSet = true;
 | 
			
		||||
        if (DisguiseAPI.isDisguiseInUse(getDisguise())) {
 | 
			
		||||
        if (DisguiseAPI.isDisguiseInUse(getDisguise()) && getDisguise().getWatcher() == this) {
 | 
			
		||||
            PacketContainer packet = new PacketContainer(PacketType.Play.Server.UPDATE_ATTRIBUTES);
 | 
			
		||||
            List<WrappedAttribute> attributes = new ArrayList<WrappedAttribute>();
 | 
			
		||||
            Builder builder;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user