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:35:15 +01:00
parent d4dcc8dc90
commit d3e5d44cb2
2 changed files with 3 additions and 0 deletions

View File

@ -38,6 +38,7 @@ These changes will (most likely) be included in the next version.
- Players no longer take fall damage when they leave (or get removed from) an arena while falling.
- Players no longer take damage from projectiles shot by pets of other players.
- MobArena no longer nags players with the `mobarena.admin.teleport` permission when they engage in a teleport that would have otherwise been blocked.
- MobArena now correctly sets the source property on auto-ignited TNT.
## [0.106] - 2021-05-09
### Added

View File

@ -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 {