When using blink, players are teleported away from other players
within a one block radius of them. However, if a player happens
to have the exact same position(only can occur when a player is
spectating them), division by 0 occurs, resulting in the player
being teleported to NaN, as any operation with NaN is also NaN.
To fix this, Blink now ignores players in Spectator mode. This
change could also address the hypothetical scenario where a
spectator is within the one block radius and results in a blinking
player getting teleported in a weird direction.
This adds a system whereby plugins can associate metadata with individual
damage events and then retrieve that metadata later from the CombatLog.
One example use case for this is Minestrike. Players are rewarded according
to the weapon that they used to kill another player, however the weapons
are frequently renamed. Minestrike can now associate a "gunType" key
to the name of the weapon used to kill the player, regardless of the skin
that the gun currently has applied to it.
This commit introduces a Component system focused around Games, which is completely
backwards compatible, as well as designed to be flexible enough for later improvements
such as dependency injection. Each GameState is associated with a phase of the
PhasedLifetime that each Game has. Components can be registered with a specific phased
or the entirety of the Lifetime. Refer to the javadocs for Lifetime and PhasedLifetime
for more details. Currently the main two Component types are ICommand and
ListenerComponent.
This commit includes the first refactoring into using this system, which is replacing
the Wizards minigame's usage of Miniplugin with a Lifetimed Component, allowing for
the shop to be appropriately registered and unregistered. This change allows for
Wizards to be run more than once on the same server instance. Previously, attempting
to register the Miniplugin twice would result in the minigame failing to start after
the initial registration.
This commit additionally includes slight refactoring within GameCreationManager as
required for the Lifetime system to function correctly. These changes ensure that
Games are only disabled once, whereas before they could be repeatedly disabled.
The previous implementation of disable(), along with the classes that override it,
functioned correctly despite being called several times.
Finally, this commit adds in changes to the pom to allow for unit testing.