mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2024-12-22 04:37:42 +01:00
Actually fix an error when NPCS would kill a mob closes #127
This commit is contained in:
parent
9855be1928
commit
bc7bfb066f
@ -81,9 +81,11 @@ public class DropTableManager implements Listener {
|
||||
@EventHandler
|
||||
public void blockDrops(EntityDeathEvent event) {
|
||||
LivingEntity entity = event.getEntity();
|
||||
Player killer = entity.getKiller();
|
||||
if (killer != null && killer.hasMetadata("NPC"))
|
||||
return;
|
||||
if (monsters.containsKey(entity.getType()))
|
||||
event.getDrops()
|
||||
.addAll(monsters.get(entity.getType()).read(entity.getKiller() != null && !entity.hasMetadata("NPC") ? PlayerData.get(entity.getKiller()) : null, false));
|
||||
event.getDrops().addAll(monsters.get(entity.getType()).read(killer != null ? PlayerData.get(killer) : null, false));
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||
|
Loading…
Reference in New Issue
Block a user