Also cancel push event if not collidable

This commit is contained in:
fullwall 2020-07-06 21:48:57 +08:00
parent c68ba08f9d
commit 002b2b61ff

View File

@ -46,7 +46,8 @@ public class Util {
public static NPCPushEvent callPushEvent(NPC npc, Vector vector) {
NPCPushEvent event = new NPCPushEvent(npc, vector);
event.setCancelled(npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true));
event.setCancelled(
npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true) || !npc.data().get(NPC.COLLIDABLE_METADATA, true));
Bukkit.getPluginManager().callEvent(event);
return event;
}