Remove class pets on player death.
When a player with pets dies in the arena, we want their pets to be removed. One could probably argue that the pets _should_ be able to stick around, but the original intent was for them to be removed alongside their owner. Fixes #721
This commit is contained in:
@@ -39,6 +39,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 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.
|
- Players no longer take damage from projectiles shot by pets of other players.
|
||||||
- Normal shulker boxes are now properly removed from inventories of players using the My Items class.
|
- Normal shulker boxes are now properly removed from inventories of players using the My Items class.
|
||||||
|
- Class pets are now correctly removed from the arena when their owner dies, rather than when they leave.
|
||||||
- MobArena no longer nags players with the `mobarena.admin.teleport` permission when they engage in a teleport that would have otherwise been blocked.
|
- 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.
|
- MobArena now correctly sets the source property on auto-ignited TNT.
|
||||||
|
|
||||||
|
|||||||
@@ -810,6 +810,9 @@ public class ArenaImpl implements Arena
|
|||||||
}
|
}
|
||||||
leavingPlayers.add(p);
|
leavingPlayers.add(p);
|
||||||
|
|
||||||
|
// Remove pets.
|
||||||
|
monsterManager.removePets(p);
|
||||||
|
|
||||||
// Clear inventory if player is an arena player, and unmount
|
// Clear inventory if player is an arena player, and unmount
|
||||||
if (arenaPlayers.contains(p)) {
|
if (arenaPlayers.contains(p)) {
|
||||||
unmount(p);
|
unmount(p);
|
||||||
@@ -866,6 +869,9 @@ public class ArenaImpl implements Arena
|
|||||||
ArenaPlayerDeathEvent event = new ArenaPlayerDeathEvent(p, this, last);
|
ArenaPlayerDeathEvent event = new ArenaPlayerDeathEvent(p, this, last);
|
||||||
plugin.getServer().getPluginManager().callEvent(event);
|
plugin.getServer().getPluginManager().callEvent(event);
|
||||||
|
|
||||||
|
// Remove pets.
|
||||||
|
monsterManager.removePets(p);
|
||||||
|
|
||||||
// Clear the player's inventory, and unmount
|
// Clear the player's inventory, and unmount
|
||||||
if (arenaPlayers.remove(p)) {
|
if (arenaPlayers.remove(p)) {
|
||||||
unmount(p);
|
unmount(p);
|
||||||
@@ -1131,9 +1137,6 @@ public class ArenaImpl implements Arena
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Remove pets.
|
|
||||||
monsterManager.removePets(p);
|
|
||||||
|
|
||||||
// readyPlayers before lobbyPlayers because of startArena sanity-checks
|
// readyPlayers before lobbyPlayers because of startArena sanity-checks
|
||||||
readyPlayers.remove(p);
|
readyPlayers.remove(p);
|
||||||
specPlayers.remove(p);
|
specPlayers.remove(p);
|
||||||
|
|||||||
Reference in New Issue
Block a user