Skip to content

Commit

Permalink
fix armor change event firing for npcs
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Feb 7, 2021
1 parent 2a1ac1c commit 0721868
Showing 1 changed file with 4 additions and 0 deletions.
@@ -1,5 +1,6 @@
package com.denizenscript.denizen.paper.events;

import com.denizenscript.denizen.objects.EntityTag;
import com.denizenscript.denizen.utilities.implementation.BukkitScriptEntryData;
import com.denizenscript.denizen.events.BukkitScriptEvent;
import com.denizenscript.denizen.objects.ItemTag;
Expand Down Expand Up @@ -138,6 +139,9 @@ public String simpleComparisonString(ItemStack stack) {

@EventHandler
public void armorChangeEvent(PlayerArmorChangeEvent event) {
if (EntityTag.isCitizensNPC(event.getPlayer())) {
return;
}
if (simpleComparisonString(event.getOldItem()).equals(simpleComparisonString(event.getNewItem()))) {
return;
}
Expand Down

0 comments on commit 0721868

Please sign in to comment.