mirror of
https://gitlab.com/phoenix-dvpmt/mmocore.git
synced 2024-11-27 00:45:40 +01:00
NPC safechecks
This commit is contained in:
parent
6452b84dbd
commit
30c3d08273
@ -56,6 +56,7 @@ public class PlayerListener implements Listener {
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void d(EntityDamageByEntityEvent event) {
|
||||
if(event.getEntity().hasMetadata("NPC")) return;
|
||||
if (event.getEntity() instanceof Player)
|
||||
PlayerData.get((Player) event.getEntity()).updateCombat();
|
||||
|
||||
|
@ -47,7 +47,7 @@ public class PlayerAttackEventListener implements Listener {
|
||||
* check damage systems from other MMOCore plugins + from MMOCore, and
|
||||
* register an attack damage for easier plugin calculations
|
||||
*/
|
||||
if (damager instanceof Player)
|
||||
if (damager instanceof Player && !damager.hasMetadata("NPC"))
|
||||
Bukkit.getPluginManager().callEvent(new PlayerAttackEvent(PlayerData.get((Player) damager), event, MMOCore.plugin.damage.findInfo(event.getEntity()).merge(info)));
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user