NPC safechecks

This commit is contained in:
Aria 2019-09-18 16:40:35 +02:00
parent 6452b84dbd
commit 30c3d08273
2 changed files with 2 additions and 1 deletions

View File

@ -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();

View File

@ -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)));
/*