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