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