mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-14 14:45:31 +01:00
Implement DMobDeathEvent
This commit is contained in:
parent
6ec3808a25
commit
80ebdeeda3
@ -1,6 +1,7 @@
|
||||
package io.github.dre2n.dungeonsxl.mob;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.dungeon.game.GameWorld;
|
||||
import io.github.dre2n.dungeonsxl.event.dmob.DMobDeathEvent;
|
||||
import io.github.dre2n.dungeonsxl.trigger.MobTrigger;
|
||||
|
||||
import java.util.Random;
|
||||
@ -64,6 +65,12 @@ public class DMob {
|
||||
for (DMob dMob : gameWorld.getDMobs()) {
|
||||
if (dMob.entity == victim) {
|
||||
|
||||
DMobDeathEvent dMobDeathEvent = new DMobDeathEvent(dMob, event);
|
||||
|
||||
if (dMobDeathEvent.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (dMob.type != null) {
|
||||
for (ItemStack itemStack : dMob.type.getDrops().keySet()) {
|
||||
Random randomGenerator = new Random();
|
||||
|
Loading…
Reference in New Issue
Block a user