ClickRedirectTrait should also check for PlayerFilter on init

This commit is contained in:
fullwall 2023-06-26 00:39:33 +08:00
parent 952c18efde
commit eb1af71429

View File

@ -26,6 +26,9 @@ public class ClickRedirectTrait extends Trait {
public ClickRedirectTrait(NPC npc) {
this();
this.redirectNPC = npc;
if (redirectNPC != null && redirectNPC.hasTrait(PlayerFilter.class)) {
redirectNPC.getOrAddTrait(PlayerFilter.class).addChildNPC(npc);
}
}
public NPC getRedirectNPC() {