fix: NPC.isProtected() should be passed to the combust event (#3158)

This commit is contained in:
ZX夏夜之风 2024-10-06 23:27:12 +08:00 committed by GitHub
parent 16b8407ebf
commit f8107a8f8b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -327,8 +327,11 @@ public class EventListen implements Listener {
} else { } else {
npcCombustEvent = new NPCCombustEvent(event, npc); npcCombustEvent = new NPCCombustEvent(event, npc);
} }
if (npc.isProtected()) {
npcCombustEvent.setCancelled(true);
}
Bukkit.getPluginManager().callEvent(npcCombustEvent); Bukkit.getPluginManager().callEvent(npcCombustEvent);
if (npcCombustEvent.isCancelled() || npc.isProtected()) { if (npcCombustEvent.isCancelled()) {
event.setCancelled(true); event.setCancelled(true);
} }
} }