Rewrite EntityTargetEvent handling.

This commit is a complete rewrite of the target event handling logic in
the ArenaListener class.

Instead of the complex, inconsistent code structure with too many line
breaks between control flow branches, we just have a thin logic wrapper
that delegates the event handling to smaller, more focused functions
that handle arena pets, arena monsters, and foreign entities on their
own.

A couple of auxiliary methods are introduced to try to limit the amount
of warnings produced by checking set membership with `contains()` when
the entity/target is an Entity and the collection is a sub type.

Fixes #572
This commit is contained in:
Andreas Troelsen
2019-12-29 17:34:56 +01:00
parent 7b99c8cbae
commit 9890c13391
2 changed files with 64 additions and 25 deletions
+1
View File
@@ -12,6 +12,7 @@ These changes will (most likely) be included in the next version.
## [Unreleased]
- It is no longer necessary to have recurrent waves for an arena to work. MobArena automatically creates a "catch all" recurrent wave in case the arena session reaches a wave number that isn't covered by any other wave definitions.
- Entities outside of the arena can no longer target players, pets, or monsters inside of the arena.
## [0.104] - 2019-08-08
- Extended and upgraded potions are now supported in the item syntax by prepending `long_` or `strong_` to the data portion of a potion item (e.g. `potion:strong_instant_heal:1` will yield a Potion of Healing II). Check the wiki for details.