Set source property on TNTPrimed entities.

This property makes TNT explosions look more "real" to other plugins who
may be consuming events from MobArena's sessions. It also gives way to a
potential rework of the "planter" logic that currently makes use of the
Bukkit Metadata API.

Closes #718
This commit is contained in:
Andreas Troelsen
2022-02-12 22:42:39 +01:00
parent d4dcc8dc90
commit d3e5d44cb2
2 changed files with 3 additions and 0 deletions
@@ -286,6 +286,7 @@ public class ArenaListener
}
stack.setAmount(stack.getAmount() - 1);
TNTPrimed tnt = b.getWorld().spawn(b.getRelative(BlockFace.UP).getLocation(), TNTPrimed.class);
tnt.setSource(event.getPlayer());
setPlanter(tnt, event.getPlayer());
return;
}
@@ -364,6 +365,7 @@ public class ArenaListener
if (planter != null) {
b.setType(Material.AIR);
TNTPrimed tnt = b.getWorld().spawn(b.getLocation(), TNTPrimed.class);
tnt.setSource(planter);
setPlanter(tnt, planter);
}
} else {