Fix clone trying to access null watcher
This commit is contained in:
		| @@ -212,7 +212,7 @@ public abstract class Disguise { | ||||
|         disguise.multiName = Arrays.copyOf(multiName, multiName.length); | ||||
|         disguise.setDynamicName(isDynamicName()); | ||||
|  | ||||
|         if (getWatcher() != null) { | ||||
|         if (getWatcher() != null && disguise.getWatcher() == null) { | ||||
|             disguise.setWatcher(getWatcher().clone(disguise)); | ||||
|         } | ||||
|  | ||||
|   | ||||
| @@ -4,8 +4,6 @@ import com.comphenix.protocol.ProtocolLibrary; | ||||
| import com.comphenix.protocol.events.PacketContainer; | ||||
| import com.comphenix.protocol.wrappers.EnumWrappers.PlayerInfoAction; | ||||
| import com.comphenix.protocol.wrappers.WrappedGameProfile; | ||||
| import lombok.Getter; | ||||
| import lombok.Setter; | ||||
| import me.libraryaddict.disguise.DisguiseConfig; | ||||
| import me.libraryaddict.disguise.LibsDisguises; | ||||
| import me.libraryaddict.disguise.disguisetypes.watchers.PlayerWatcher; | ||||
| @@ -210,6 +208,10 @@ public class PlayerDisguise extends TargetedDisguise { | ||||
|     public PlayerDisguise clone() { | ||||
|         PlayerDisguise disguise = new PlayerDisguise(); | ||||
|  | ||||
|         if (getWatcher() != null) { | ||||
|             disguise.setWatcher(getWatcher().clone(disguise)); | ||||
|         } | ||||
|  | ||||
|         if (currentLookup == null && gameProfile != null) { | ||||
|             disguise.skinToUse = getSkin(); | ||||
|             disguise.gameProfile = ReflectionManager | ||||
|   | ||||
		Reference in New Issue
	
	Block a user