Allow class pets to teleport to their owners.

This closes #497.
This commit is contained in:
Andreas Troelsen
2018-12-31 14:20:27 +01:00
parent 624b87f4d3
commit 5e7cb2a82b
2 changed files with 4 additions and 0 deletions
+1
View File
@@ -14,6 +14,7 @@ These changes will (most likely) be included in the next version.
- Like the other user commands, the permission for `/ma ready` now defaults to true.
- Unbreakable weapons and armor now use the unbreakable item flag instead of item durability and on-hit repairs. This means that MobArena's unbreakable items are now compatible with plugins that depend on special durability values, such as QualityArmory.
- Spectators can no longer take damage when the arena isn't running.
- Pets can now teleport back to their owners if they get too far away.
## [0.103] - 2018-08-28
- It is now possible to add a fixed delay (in seconds) between waves with the new per-arena setting `next-wave-delay`.
@@ -885,6 +885,9 @@ public class ArenaListener
}
public void onEntityTeleport(EntityTeleportEvent event) {
if (monsters.hasPet(event.getEntity()) && region.contains(event.getTo())) {
return;
}
if (region.contains(event.getFrom()) || region.contains(event.getTo())) {
event.setCancelled(true);
}