From b7e738b4e82bffa00909aad4408b7f0e63987582 Mon Sep 17 00:00:00 2001 From: cnr Date: Thu, 8 Dec 2016 20:41:46 -0700 Subject: [PATCH] Revert commits from #302 This reverts commits from the range 062fdd3^..a0beeab Changes from #302 are on hold until a later date. --- .../mineplex/core/common/util/UtilShapes.java | 4 - Plugins/Mineplex.Core/pom.xml | 5 - .../src/mineplex/core/MiniPlugin.java | 22 +- .../src/mineplex/core/command/ICommand.java | 15 +- .../minestrike/MineStrikeSkin.java | 2 +- .../mineplex/core/lifetimes/Component.java | 21 -- .../src/mineplex/core/lifetimes/Lifetime.java | 29 -- .../mineplex/core/lifetimes/Lifetimed.java | 19 -- .../core/lifetimes/ListenerComponent.java | 54 ---- .../core/lifetimes/PhasedComponent.java | 7 - .../core/lifetimes/PhasedLifetime.java | 289 ------------------ .../core/lifetimes/SimpleLifetime.java | 96 ------ .../src/mineplex/core/shop/ShopBase.java | 68 ++--- .../mineplex/core/shop/page/ShopPageBase.java | 20 +- .../core/lifetimes/LoggingComponent.java | 32 -- .../core/lifetimes/PhasedLifetimeTest.java | 99 ------ .../core/lifetimes/SimpleLifetimeTest.java | 41 --- .../classcombat/Skill/Assassin/Blink.java | 3 +- .../game/core/combat/CombatComponent.java | 5 +- .../game/core/combat/CombatDamage.java | 24 +- .../minecraft/game/core/combat/CombatLog.java | 10 +- .../game/core/combat/CombatManager.java | 11 +- .../game/core/damage/CustomDamageEvent.java | 31 -- .../game/core/damage/DamageManager.java | 4 +- .../game/core/explosion/CustomExplosion.java | 1 + .../src/nautilus/game/arcade/game/Game.java | 22 +- .../game/arcade/game/GameComponent.java | 31 -- .../game/games/gladiators/Gladiators.java | 1 - .../game/games/minestrike/GunModule.java | 2 - .../game/games/minestrike/Minestrike.java | 39 +-- .../game/games/minestrike/items/guns/Gun.java | 6 +- .../game/games/wizards/WizardSpellMenu.java | 13 +- .../arcade/game/games/wizards/Wizards.java | 22 +- .../games/wizards/spells/SpellAnvilDrop.java | 5 +- .../games/wizards/spells/SpellFireball.java | 6 +- .../games/wizards/spells/SpellRumble.java | 4 +- .../wizards/spells/SpellSummonWolves.java | 1 - .../arcade/managers/GameCreationManager.java | 19 +- Plugins/pom.xml | 14 - 39 files changed, 114 insertions(+), 983 deletions(-) delete mode 100644 Plugins/Mineplex.Core/src/mineplex/core/lifetimes/Component.java delete mode 100644 Plugins/Mineplex.Core/src/mineplex/core/lifetimes/Lifetime.java delete mode 100644 Plugins/Mineplex.Core/src/mineplex/core/lifetimes/Lifetimed.java delete mode 100644 Plugins/Mineplex.Core/src/mineplex/core/lifetimes/ListenerComponent.java delete mode 100644 Plugins/Mineplex.Core/src/mineplex/core/lifetimes/PhasedComponent.java delete mode 100644 Plugins/Mineplex.Core/src/mineplex/core/lifetimes/PhasedLifetime.java delete mode 100644 Plugins/Mineplex.Core/src/mineplex/core/lifetimes/SimpleLifetime.java delete mode 100644 Plugins/Mineplex.Core/test/mineplex/core/lifetimes/LoggingComponent.java delete mode 100644 Plugins/Mineplex.Core/test/mineplex/core/lifetimes/PhasedLifetimeTest.java delete mode 100644 Plugins/Mineplex.Core/test/mineplex/core/lifetimes/SimpleLifetimeTest.java delete mode 100644 Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/GameComponent.java diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilShapes.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilShapes.java index 500cbc5e2..a0bda3026 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilShapes.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilShapes.java @@ -97,10 +97,6 @@ public class UtilShapes public static BlockFace getFacing(float yaw) { - while (yaw < 0) - { - yaw += 360; - } return radial[Math.round(yaw / 45f) % 8]; } diff --git a/Plugins/Mineplex.Core/pom.xml b/Plugins/Mineplex.Core/pom.xml index ad05d714a..c4dbb202a 100644 --- a/Plugins/Mineplex.Core/pom.xml +++ b/Plugins/Mineplex.Core/pom.xml @@ -45,11 +45,6 @@ anticheat 1.2 - - junit - junit - test - diff --git a/Plugins/Mineplex.Core/src/mineplex/core/MiniPlugin.java b/Plugins/Mineplex.Core/src/mineplex/core/MiniPlugin.java index 964185a03..02e063daf 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/MiniPlugin.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/MiniPlugin.java @@ -7,9 +7,6 @@ import mineplex.core.common.util.NautHashMap; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime.TimeUnit; -import mineplex.core.lifetimes.Lifetime; -import mineplex.core.lifetimes.Lifetimed; -import mineplex.core.lifetimes.SimpleLifetime; import mineplex.core.thread.ThreadPool; import org.bukkit.Bukkit; import org.bukkit.event.HandlerList; @@ -29,16 +26,12 @@ import org.bukkit.scheduler.BukkitTask; * * This way, we can reflectively create them during {@link #require} when they do not exist, leading to much cleaner code */ -public abstract class MiniPlugin implements Listener, Lifetimed +public abstract class MiniPlugin implements Listener { - // As MiniPlugins can technically be disabled at any time, each - // has its own unique Lifetime. If MiniPlugins are declared - // to never be able to be disabled, then a "Singleton" Lifetime - // could be shared between all of them. - private final SimpleLifetime _lifetime = new SimpleLifetime(); protected String _moduleName = "Default"; protected JavaPlugin _plugin; - + protected NautHashMap _commands; + protected long _initializedTime; public MiniPlugin(String moduleName) @@ -53,7 +46,8 @@ public abstract class MiniPlugin implements Listener, Lifetimed _initializedTime = System.currentTimeMillis(); - _lifetime.start(); + _commands = new NautHashMap<>(); + onEnable(); registerEvents(this); @@ -177,10 +171,4 @@ public abstract class MiniPlugin implements Listener, Lifetimed { return Managers.require(clazz); } - - @Override - public Lifetime getLifetime() - { - return _lifetime; - } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/command/ICommand.java b/Plugins/Mineplex.Core/src/mineplex/core/command/ICommand.java index becbdfee5..463a7631f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/command/ICommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/command/ICommand.java @@ -5,11 +5,10 @@ import java.util.List; import mineplex.core.common.Rank; -import mineplex.core.lifetimes.Component; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; -public interface ICommand extends Component +public interface ICommand { void SetCommandCenter(CommandCenter commandCenter); void Execute(Player caller, String[] args); @@ -22,16 +21,4 @@ public interface ICommand extends Component Rank[] GetSpecificRanks(); List onTabComplete(CommandSender sender, String commandLabel, String[] args); - - @Override - default void activate() - { - CommandCenter.Instance.addCommand(this); - } - - @Override - default void deactivate() - { - CommandCenter.Instance.removeCommand(this); - } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/gamemodifiers/minestrike/MineStrikeSkin.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/gamemodifiers/minestrike/MineStrikeSkin.java index 44f586975..1b118c120 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/gamemodifiers/minestrike/MineStrikeSkin.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/gamemodifiers/minestrike/MineStrikeSkin.java @@ -10,7 +10,7 @@ public enum MineStrikeSkin Desert_Eagle_Blaze( "Desert Eagle", "Desert Eagle Blaze", Material.NETHER_STALK, (byte) 0), Nova_Koi( "Nova", "Nova Koi", Material.INK_SACK, (byte) 14), XM1014_Tranquility( "XM1014", "XM1014 Tranquility", Material.DIAMOND, (byte) 0), - PP_Bizon_Streak( "PP-Bizon", "PP-Bizon Streak", Material.INK_SACK, (byte) 4), + PP_Bizon_Streak( "PP Bizon", "PP-Bizon Streak", Material.INK_SACK, (byte) 4), P90_Asiimov( "P90", "P90 Asiimov", Material.INK_SACK, (byte) 0), SSG_08_Blood_in_the_Water( "SSG 08", "SSG 08 Blood in the Water", Material.INK_SACK, (byte) 12), AWP_Asiimov( "AWP", "AWP Asiimov", Material.SULPHUR, (byte) 0), diff --git a/Plugins/Mineplex.Core/src/mineplex/core/lifetimes/Component.java b/Plugins/Mineplex.Core/src/mineplex/core/lifetimes/Component.java deleted file mode 100644 index cee7da78f..000000000 --- a/Plugins/Mineplex.Core/src/mineplex/core/lifetimes/Component.java +++ /dev/null @@ -1,21 +0,0 @@ -package mineplex.core.lifetimes; - -/** - * A Component defines behavior that can exist within a Lifetime. Components - * should have no impact upon the game while not active. - */ -public interface Component -{ - /** - * Activates the Component, performing any sort of required initialization. - * Components may be activated and deactivated multiple times, however a component - * will not be activated more than once without subsequent calls to deactivate. - */ - void activate(); - - /** - * Deactivates the Component, disabling any sort of functionality it provides - * and performing clean up. A Component may be subsequently reactivated. - */ - void deactivate(); -} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/lifetimes/Lifetime.java b/Plugins/Mineplex.Core/src/mineplex/core/lifetimes/Lifetime.java deleted file mode 100644 index 1cb578bc0..000000000 --- a/Plugins/Mineplex.Core/src/mineplex/core/lifetimes/Lifetime.java +++ /dev/null @@ -1,29 +0,0 @@ -package mineplex.core.lifetimes; - -/** - * A Lifetime represents a duration for which a collection of Components - * will be active. While Lifetime does contain a method for registering - * instantiated Components, individual Lifetimes may have unique - * strategies for creating Components and activating them. Lifetime - * doesn't provide any guarantee of Component activation or deactivation - * order. Implementations of Lifetime, however, may. - *

- * Lifetime doesn't provide mechanisms for beginning or ending a Lifetime. - * This is provided by the various implementations of Lifetime, as it varies - * between the implementations and is functionality that most consumers of - * Lifetimes will not need. - */ -public interface Lifetime -{ - /** - * Registers the provided component with this Lifetime. If the Lifetime - * is currently active, then the Component will be immediately activated. - * @param component the component to register - */ - void register(Component component); - /** - * Gets whether the Lifetime is currently active. - * @return true if the Lifetime is active - */ - boolean isActive(); -} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/lifetimes/Lifetimed.java b/Plugins/Mineplex.Core/src/mineplex/core/lifetimes/Lifetimed.java deleted file mode 100644 index fa08dd533..000000000 --- a/Plugins/Mineplex.Core/src/mineplex/core/lifetimes/Lifetimed.java +++ /dev/null @@ -1,19 +0,0 @@ -package mineplex.core.lifetimes; - -/** - * Represents an object that is associated with a specific lifetime. - * Multiple Lifetimed objects may be associated with the same Lifetime. - * As a roughly generalized explanation, any time functionality should - * be enabled(whether its a command, listener, etc.) it should be registered - * as a Component of a Lifetime. Any object wishing to enable functionality - * that is associated with this Lifetimed object should do so with the Lifetime - * returned by {@link #getLifetime()}. - */ -public interface Lifetimed -{ - /** - * Gets the Lifetime associated with this Lifetimed object. - * @return non-null Lifetime - */ - Lifetime getLifetime(); -} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/lifetimes/ListenerComponent.java b/Plugins/Mineplex.Core/src/mineplex/core/lifetimes/ListenerComponent.java deleted file mode 100644 index d6b664fb4..000000000 --- a/Plugins/Mineplex.Core/src/mineplex/core/lifetimes/ListenerComponent.java +++ /dev/null @@ -1,54 +0,0 @@ -package mineplex.core.lifetimes; - -import mineplex.core.common.util.UtilServer; -import org.apache.commons.lang.Validate; -import org.bukkit.Bukkit; -import org.bukkit.event.HandlerList; -import org.bukkit.event.Listener; - -/** - * A convenience class for Components that are a Listener. ListenerComponent - * can either be used as a wrapper class for a specific Listener, or can be - * extended by another Component to provide event registration. - */ -public class ListenerComponent implements Component, Listener -{ - private final Listener _listener; - - /** - * Creates a ListenerComponent that registers the provided Listener when - * activated and unregisters it when deactivated. The newly created - * ListenerComponent will not be registered as a Listener. When a - * ListenerComponent is created with this constructor, it is effectively - * a wrapper to bind a Listener to a specific lifetime. - * - * @param listener non-null listener to wrap - * @throws IllegalArgumentException if listener is null - */ - public ListenerComponent(Listener listener) throws IllegalArgumentException - { - Validate.notNull(listener); - _listener = listener; - } - - /** - * Creates a ListenerComponent that registers itself when activated and - * unregisters itself when deactivated. - */ - public ListenerComponent() - { - _listener = this; - } - - @Override - public void activate() - { - Bukkit.getPluginManager().registerEvents(_listener, UtilServer.getPlugin()); - } - - @Override - public void deactivate() - { - HandlerList.unregisterAll(_listener); - } -} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/lifetimes/PhasedComponent.java b/Plugins/Mineplex.Core/src/mineplex/core/lifetimes/PhasedComponent.java deleted file mode 100644 index 417bf56b1..000000000 --- a/Plugins/Mineplex.Core/src/mineplex/core/lifetimes/PhasedComponent.java +++ /dev/null @@ -1,7 +0,0 @@ -package mineplex.core.lifetimes; - -public interface PhasedComponent extends Component -{ - - void setPhase(T phase); -} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/lifetimes/PhasedLifetime.java b/Plugins/Mineplex.Core/src/mineplex/core/lifetimes/PhasedLifetime.java deleted file mode 100644 index b9760e761..000000000 --- a/Plugins/Mineplex.Core/src/mineplex/core/lifetimes/PhasedLifetime.java +++ /dev/null @@ -1,289 +0,0 @@ -package mineplex.core.lifetimes; - -import com.google.common.base.Preconditions; -import mineplex.core.common.util.UtilServer; -import org.apache.commons.lang.Validate; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** - * A PhasedLifetime is a lifetime that is composed of several - * smaller lifetimes, referred to as phases. This class is provided - * in order to support a system in which Components may exist within multiple - * Lifetimes. PhasedLifetime is not thread-safe. - *

- * Registering a Component will register it for the entirety of this Lifetime, - * unless registered with {@link #register(Component, Iterable)}. Special behavior - * is provided for instances of {@link PhasedComponent}. See {@link #register(Component, - * Iterable)} for more information. Components registered using {@link - * #register(Component)} are registered for the entire duration of the Lifetime. - */ -public class PhasedLifetime implements Lifetime -{ - private final Map> _phases = new HashMap<>(); - private final List _global = new ArrayList<>(); - private boolean _active = false; - private T _current; - - /** - * Registers the Component for all phases within the provided Iterable, - * and creates a Lifetime that is active during all those phases, and - * therefore identical to when the provided Component is active. If a change - * occurs from a Phase that the Component is active in to another phase that - * the component is active in, it will not be disabled. When this - * Lifetime ends, all Lifetimes created by this Lifetime also end, as all - * phases are considered over. - *

- * If the Component is an instance of PhasedComponent, then any phase change - * in which one of the phases is within the provided Iterable of phases will - * result in an invocation of {@link PhasedComponent#setPhase(Object)}. This - * should not be used as a mechanism to detect when the component is being - * disabled, but rather as a means to provide specific behavior when that - * phase change occurs. If a phase change drastically changes the behavior - * of a Component such that not all functionality is active for some phases - * that a Component is registered for, you should consider refactoring that - * Component into two separate Components. - *

- * As an example, assume that we have a PhasedLifetime with phases A-F, - * and a PhasedComponent is registered for phases A, B, and E. The chain - * of events would be as followed(italic indicates an event call to the - * PhasedComponent, an activation, or deactivation). - *

    - *
  • Lifetime started with a value of A
  • - *
  • Component is activated
  • - *
  • setPhase is called with a value of A
  • - *
  • Phase is set to B
  • - *
  • setPhase is called with a value of B
  • - *
  • Phase is set to C
  • - *
  • setPhase is called with a value of C
  • - *
  • Component is deactivated
  • - *
  • Phase is set to D
  • - *
  • Phase is set to E
  • - *
  • Component is activated
  • - *
  • setPhase is called with a value of E
  • - *
  • Phase is set to F
  • - *
  • setPhase is called with a value of F
  • - *
  • Component is deactivated
  • - *
  • Lifetime ends
  • - *
- *

- * If phases contains no elements, then the Component will not be - * registered. - * @param component non-null Component being registered - * @param phases non-null Iterable of phases to register the Component for - * @return a Lifetime corresponding to when the Component is active - * @throws IllegalArgumentException if component or phases is null - */ - public Lifetime register(Component component, Iterable phases) throws IllegalArgumentException { - Validate.notNull(component, "Component cannot be null"); - Validate.notNull(phases, "Phases cannot be null"); - RegisteredComponent rComponent = new RegisteredComponent(component); - for (T phase : phases) - { - _phases.computeIfAbsent(phase, (p) -> new ArrayList<>()).add(rComponent); - if (Objects.equals(phase, _current)) - { - rComponent.start(); - if (component instanceof PhasedComponent) - { - ((PhasedComponent) component).setPhase(phase); - } - } - } - return rComponent; - } - - /** - * Starts the Lifetime, activating all components that are active for - * the entire lifetime, and then activating all components that are part - * of the provided phase. - * @param phase non-null phase to start - * @throws IllegalArgumentException if phase is null - * @throws IllegalStateException if the Lifetime is currently active - */ - public void start(T phase) throws IllegalArgumentException, IllegalStateException - { - Validate.notNull(phase, "phase cannot be null"); - Preconditions.checkState(!_active, "Lifetime already started"); - _active = true; - _global.forEach(PhasedLifetime::active); - setPhase(phase); - } - - /** - * Ends the Lifetime, deactivating all components in the current phase - * and then deactivating all components that are active for the entire Lifetime. - * A Lifetime may be subsequently reactivated after it has ended. - * @throws IllegalStateException if the lifetime isn't active - */ - public void end() throws IllegalStateException - { - Preconditions.checkState(_active, "Lifetime not active"); - List toDisable = _phases.get(getPhase()); - if (toDisable != null) - { - toDisable.forEach(RegisteredComponent::end); - } - _global.forEach(PhasedLifetime::deactive); - _active = false; - _current = null; - } - - /** - * Sets the current phase to the provided value, activating components - * that are active in the phase and not currently active, and deactiving - * components that were previously active and are not registered for the - * provided phase. - * @param phase non-null - * @throws IllegalStateException if the Lifetime isn't active - * @throws IllegalArgumentException if the phase equals the current phase - * or is null - */ - public void setPhase(T phase) throws IllegalStateException, IllegalArgumentException - { - Preconditions.checkState(_active, "Lifetime not active"); - Validate.isTrue(!Objects.equals(phase, _current), "Can't set the phase to the current phase"); - Validate.notNull(phase, "the phase cannot be null"); - T oldPhase = getPhase(); - _current = phase; - List old = _phases.get(oldPhase); - List nextPhase = _phases.get(phase); - - for (Component c : _global) - { - if (c instanceof PhasedComponent) - { - ((PhasedComponent) c).setPhase(phase); - } - } - // Disable components that were active in the last phase but not in the next phase. - if (old != null) - { - List toDisable = new ArrayList<>(); - toDisable.addAll(old); - // Components that are in the next phase shouldn't be disabled. - if (nextPhase != null) - { - toDisable.removeAll(nextPhase); - } - - // Ensure that all old ones get a setPhase call before disabling them. - for (RegisteredComponent r : toDisable) - { - if (r.getComponent() instanceof PhasedComponent) - { - ((PhasedComponent) r.getComponent()).setPhase(phase); - } - } - toDisable.forEach(RegisteredComponent::end); - } - if (nextPhase != null) - { - // New but not old - List toActivate = new ArrayList<>(); - toActivate.addAll(nextPhase); - // Ensure that all components from last phase don't end up getting activated again. - if (old != null) - { - toActivate.removeAll(old); - } - // Start all the new ones - toActivate.forEach(RegisteredComponent::start); - // Give every remaining component a call to setPhase - for (RegisteredComponent r : nextPhase) - { - if (r.getComponent() instanceof PhasedComponent) - { - ((PhasedComponent) r.getComponent()).setPhase(phase); - } - } - } - } - - private static void active(Component component) - { - try - { - component.activate(); - } catch (Exception e) - { - e.printStackTrace(); - UtilServer.getPlugin().getLogger().severe("Failed to activate component: " + component); - } - } - private static void deactive(Component component) - { - try - { - component.deactivate(); - } catch (Exception e) - { - e.printStackTrace(); - UtilServer.getPlugin().getLogger().severe("Failed to deactivate component: " + component); - } - } - /** - * Gets the current Phase. If this PhasedLifetime isn't active then - * the current phase is null. - * @return the current phase, null if not active - */ - public T getPhase() - { - return _current; - } - - /** - * {@inheritDoc} - * If the Component is an instance of PhasedComponent, it will receive - * notifications of phase changes prior to any components registered - * with specific phases. Global components will also be deactivated last. - * @param component the component to register - */ - @Override - public void register(Component component) - { - _global.add(component); - if (this.isActive()) - { - component.activate(); - } - } - - @Override - public boolean isActive() - { - return _active; - } - - private static class RegisteredComponent extends SimpleLifetime implements Lifetime { - private Component _component; - - public RegisteredComponent(Component component) - { - this._component = component; - } - - public Component getComponent() - { - return _component; - } - - @Override - public void start() throws IllegalStateException - { - PhasedLifetime.active(_component); - super.start(); - } - - @Override - public void end() throws IllegalStateException - { - super.end(); - PhasedLifetime.deactive(_component); - } - } -} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/lifetimes/SimpleLifetime.java b/Plugins/Mineplex.Core/src/mineplex/core/lifetimes/SimpleLifetime.java deleted file mode 100644 index 28dcfe45e..000000000 --- a/Plugins/Mineplex.Core/src/mineplex/core/lifetimes/SimpleLifetime.java +++ /dev/null @@ -1,96 +0,0 @@ -package mineplex.core.lifetimes; - -import mineplex.core.common.util.UtilServer; -import org.apache.commons.lang3.Validate; - -import java.util.ArrayList; -import java.util.List; -import java.util.ListIterator; - -/** - * A Lifetime that is not thread-safe and is essentially a list of Components. - * All components are activated in the order that they are registered. All - * components are deactivated in the reverse order that they are registered. - * Components may not be registered during invocations of start or end. If a - * Component throws an exception during activation it will be logged, however the - * Component will still only be disabled once all other Components are disabled. - */ -public class SimpleLifetime implements Lifetime -{ - protected final List _components = new ArrayList<>(); - protected boolean _active = false; - @Override - public void register(Component component) - { - this._components.add(component); - if (this.isActive()) - { - try - { - component.activate(); - } catch (Exception e) - { - e.printStackTrace(); - UtilServer.getPlugin().getLogger().severe("Failed to active component: " + component); - } - } - } - - @Override - public boolean isActive() - { - return _active; - } - - /** - * Starts the SimpleLifetime, activating all components in the order that - * they were registered. A SimpleLifetime may be started multiple times, - * so long that every invocation of start after the first is preceded by - * an invocation of {@link #end()}. If a Component throws an exception - * during activation the exception will be logged, however no specific - * error-handling mechanism is provided. The Component will still be - * considered active and will be deactivated with all other Components. - * @throws IllegalStateException if currently active - */ - public void start() throws IllegalStateException - { - Validate.isTrue(!_active); - _active = true; - for (Component component : _components) - { - try - { - component.activate(); - } catch (Exception e) - { - e.printStackTrace(); - UtilServer.getPlugin().getLogger().severe("Failed to active component: " + component); - } - } - } - - /** - * Deactivates all components in the reverse order that they were registered. - * Any exception thrown by a Component while being deactivated will be logged, - * however no exception handling mechanism is provided. - * @throws IllegalStateException if not currently active - */ - public void end() throws IllegalStateException - { - Validate.isTrue(_active); - _active = false; - ListIterator reverseIterator = _components.listIterator(_components.size()); - while (reverseIterator.hasPrevious()) - { - Component component = reverseIterator.previous(); - try - { - component.deactivate(); - } catch (Exception e) - { - e.printStackTrace(); - UtilServer.getPlugin().getLogger().severe("Failed to deactivate component: " + component); - } - } - } -} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/shop/ShopBase.java b/Plugins/Mineplex.Core/src/mineplex/core/shop/ShopBase.java index cd3b959f5..a20567c0b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/shop/ShopBase.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/shop/ShopBase.java @@ -1,15 +1,13 @@ package mineplex.core.shop; +import mineplex.core.MiniPlugin; import mineplex.core.account.CoreClientManager; import mineplex.core.common.util.NautHashMap; import mineplex.core.donation.DonationManager; -import mineplex.core.lifetimes.Lifetimed; -import mineplex.core.lifetimes.ListenerComponent; import mineplex.core.npc.event.NpcDamageByEntityEvent; import mineplex.core.npc.event.NpcInteractEntityEvent; import mineplex.core.shop.page.ShopPageBase; import net.minecraft.server.v1_8_R3.EntityPlayer; -import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer; import org.bukkit.craftbukkit.v1_8_R3.event.CraftEventFactory; @@ -18,6 +16,7 @@ import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryCloseEvent; import org.bukkit.event.inventory.InventoryDragEvent; @@ -25,9 +24,8 @@ import org.bukkit.event.inventory.InventoryOpenEvent; import org.bukkit.event.player.PlayerQuitEvent; import java.util.HashSet; -import java.util.Map; -public abstract class ShopBase extends ListenerComponent +public abstract class ShopBase implements Listener { private NautHashMap _errorThrottling; private NautHashMap _purchaseBlock; @@ -51,7 +49,7 @@ public abstract class ShopBase extends ListenerCom _errorThrottling = new NautHashMap(); _purchaseBlock = new NautHashMap(); - _plugin.getLifetime().register(this); + _plugin.registerEvents(this); } @EventHandler(priority = EventPriority.LOWEST) @@ -149,7 +147,14 @@ public abstract class ShopBase extends ListenerCom { if (_playerPageMap.containsKey(event.getPlayer().getName()) && _playerPageMap.get(event.getPlayer().getName()).getTitle() != null && _playerPageMap.get(event.getPlayer().getName()).getTitle().equalsIgnoreCase(event.getInventory().getTitle())) { - removePlayer((Player) event.getPlayer()); + _playerPageMap.get(event.getPlayer().getName()).playerClosed(); + _playerPageMap.get(event.getPlayer().getName()).dispose(); + + _playerPageMap.remove(event.getPlayer().getName()); + + closeShopForPlayer((Player) event.getPlayer()); + + _openedShop.remove(event.getPlayer().getName()); } } @@ -161,39 +166,17 @@ public abstract class ShopBase extends ListenerCom if (_playerPageMap.containsKey(event.getPlayer().getName()) && _playerPageMap.get(event.getPlayer().getName()).getTitle() != null && _playerPageMap.get(event.getPlayer().getName()).getTitle().equalsIgnoreCase(event.getInventory().getTitle())) { - removePlayer((Player) event.getPlayer()); + _playerPageMap.get(event.getPlayer().getName()).playerClosed(); + _playerPageMap.get(event.getPlayer().getName()).dispose(); + + _playerPageMap.remove(event.getPlayer().getName()); + + closeShopForPlayer((Player) event.getPlayer()); + + _openedShop.remove(event.getPlayer().getName()); } } - - protected void removePlayer(Player player) - { - _playerPageMap.get(player.getName()).playerClosed(); - _playerPageMap.get(player.getName()).dispose(); - - _playerPageMap.remove(player.getName()); - - closeShopForPlayer(player); - - _openedShop.remove(player.getName()); - } - - @Override - public void deactivate() - { - super.deactivate(); - _playerPageMap.entrySet().stream().map(Map.Entry::getKey).map(Bukkit::getPlayer).forEach(p -> { - if (_playerPageMap.get(p.getName()).getTitle().equals(p.getOpenInventory().getTitle())) - { - p.closeInventory(); - } - removePlayer(p); - }); - _playerPageMap.clear(); - _openedShop.clear(); - _purchaseBlock.clear(); - _errorThrottling.clear(); - } - + protected boolean canOpenShop(Player player) { return true; @@ -208,8 +191,15 @@ public abstract class ShopBase extends ListenerCom { if (_playerPageMap.containsKey(event.getPlayer().getName())) { - removePlayer(event.getPlayer()); + _playerPageMap.get(event.getPlayer().getName()).playerClosed(); + _playerPageMap.get(event.getPlayer().getName()).dispose(); + event.getPlayer().closeInventory(); + closeShopForPlayer(event.getPlayer()); + + _playerPageMap.remove(event.getPlayer().getName()); + + _openedShop.remove(event.getPlayer().getName()); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/shop/page/ShopPageBase.java b/Plugins/Mineplex.Core/src/mineplex/core/shop/page/ShopPageBase.java index 086506dfd..7f1a8c525 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/shop/page/ShopPageBase.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/shop/page/ShopPageBase.java @@ -1,14 +1,5 @@ package mineplex.core.shop.page; - -import mineplex.core.account.CoreClient; -import mineplex.core.account.CoreClientManager; -import mineplex.core.common.util.NautHashMap; -import mineplex.core.common.util.UtilInv; -import mineplex.core.donation.DonationManager; -import mineplex.core.lifetimes.Lifetimed; -import mineplex.core.shop.ShopBase; -import mineplex.core.shop.item.IButton; import org.bukkit.Sound; import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer; import org.bukkit.craftbukkit.v1_8_R3.inventory.CraftInventoryCustom; @@ -20,7 +11,16 @@ import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; -public abstract class ShopPageBase> extends CraftInventoryCustom implements Listener +import mineplex.core.MiniPlugin; +import mineplex.core.account.CoreClient; +import mineplex.core.account.CoreClientManager; +import mineplex.core.common.util.NautHashMap; +import mineplex.core.common.util.UtilInv; +import mineplex.core.donation.DonationManager; +import mineplex.core.shop.ShopBase; +import mineplex.core.shop.item.IButton; + +public abstract class ShopPageBase> extends CraftInventoryCustom implements Listener { protected PluginType _plugin; protected CoreClientManager _clientManager; diff --git a/Plugins/Mineplex.Core/test/mineplex/core/lifetimes/LoggingComponent.java b/Plugins/Mineplex.Core/test/mineplex/core/lifetimes/LoggingComponent.java deleted file mode 100644 index d2f61d538..000000000 --- a/Plugins/Mineplex.Core/test/mineplex/core/lifetimes/LoggingComponent.java +++ /dev/null @@ -1,32 +0,0 @@ -package mineplex.core.lifetimes; - -import java.util.List; - -public class LoggingComponent implements PhasedComponent { - private final List _events; - private final String _name; - - public LoggingComponent(List events, String name) - { - _events = events; - this._name = name; - } - - @Override - public void activate() - { - _events.add(this._name + " activated"); - } - - @Override - public void deactivate() - { - _events.add(this._name + " deactivated"); - } - - @Override - public void setPhase(Object phase) - { - _events.add(this._name + " setPhase " + phase); - } -} \ No newline at end of file diff --git a/Plugins/Mineplex.Core/test/mineplex/core/lifetimes/PhasedLifetimeTest.java b/Plugins/Mineplex.Core/test/mineplex/core/lifetimes/PhasedLifetimeTest.java deleted file mode 100644 index 3d62001c8..000000000 --- a/Plugins/Mineplex.Core/test/mineplex/core/lifetimes/PhasedLifetimeTest.java +++ /dev/null @@ -1,99 +0,0 @@ -package mineplex.core.lifetimes; - -import org.junit.Assert; -import org.junit.Test; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -public class PhasedLifetimeTest -{ - PhasedLifetime _lifetime = new PhasedLifetime<>(); - List _events = new ArrayList<>(); - @Test - public void testTwoPhaseComponent() - { - Assert.assertFalse(_lifetime.isActive()); - _lifetime.register(new LoggingComponent(_events, "component"), Arrays.asList(Phase.A, Phase.B)); - _lifetime.start(Phase.A); - Assert.assertTrue(_lifetime.isActive()); - Assert.assertEquals(Arrays.asList("component activated", "component setPhase A"), _events); - _lifetime.setPhase(Phase.B); - Assert.assertEquals(Arrays.asList("component activated", "component setPhase A", "component setPhase B"), _events); - _lifetime.setPhase(Phase.C); - Assert.assertEquals(Arrays.asList("component activated", "component setPhase A", "component setPhase B", "component setPhase C", "component deactivated"), _events); - _lifetime.end(); - Assert.assertEquals(Arrays.asList("component activated", "component setPhase A", "component setPhase B", "component setPhase C", "component deactivated"), _events); - Assert.assertFalse(_lifetime.isActive()); - } - @Test - public void testGlobalComponent() - { - _lifetime.register(new LoggingComponent(_events, "component")); - _lifetime.start(Phase.A); - Assert.assertEquals(Arrays.asList("component activated", "component setPhase A"), _events); - _lifetime.setPhase(Phase.B); - Assert.assertEquals(Arrays.asList("component activated", "component setPhase A", "component setPhase B"), _events); - _lifetime.end(); - Assert.assertEquals(Arrays.asList("component activated", "component setPhase A", "component setPhase B", "component deactivated"), _events); - } - - @Test - public void testLateRegistration() - { - _lifetime.start(Phase.A); - _lifetime.register(new LoggingComponent(_events, "component"), Arrays.asList(Phase.A, Phase.B)); - Assert.assertEquals(Arrays.asList("component activated", "component setPhase A"), _events); - _lifetime.setPhase(Phase.B); - Assert.assertEquals(Arrays.asList("component activated", "component setPhase A", "component setPhase B"), _events); - _lifetime.end(); - Assert.assertEquals(Arrays.asList("component activated", "component setPhase A", "component setPhase B", "component deactivated"), _events); - } - @Test - public void testSinglePhase() - { - _lifetime.register(new LoggingComponent(_events, "component"), Collections.singletonList(Phase.B)); - _lifetime.start(Phase.A); - Assert.assertEquals(Collections.emptyList(), _events); - _lifetime.setPhase(Phase.B); - Assert.assertEquals(Arrays.asList("component activated", "component setPhase B"), _events); - _lifetime.setPhase(Phase.C); - Assert.assertEquals(Arrays.asList("component activated", "component setPhase B", "component setPhase C", "component deactivated"), _events); - _lifetime.end(); - Assert.assertEquals(Arrays.asList("component activated", "component setPhase B", "component setPhase C", "component deactivated"), _events); - } - @Test - public void testComponentLifetimes() - { - _lifetime.register(new LoggingComponent(_events, "component"), Collections.singletonList(Phase.B)).register(new LoggingComponent(_events, "child")); - _lifetime.start(Phase.A); - Assert.assertEquals(Collections.emptyList(), _events); - _lifetime.setPhase(Phase.B); - Assert.assertEquals(Arrays.asList("component activated", "child activated", "component setPhase B"), _events); - _lifetime.setPhase(Phase.C); - Assert.assertEquals(Arrays.asList("component activated", "child activated","component setPhase B", "component setPhase C", "child deactivated", "component deactivated"), _events); - _lifetime.end(); - Assert.assertEquals(Arrays.asList("component activated", "child activated", "component setPhase B", "component setPhase C", "child deactivated", "component deactivated"), _events); - } - @Test - public void testEarlyShutdown() - { - _lifetime.register(new LoggingComponent(_events, "component"), Arrays.asList(Phase.B, Phase.C)); - _lifetime.start(Phase.A); - Assert.assertEquals(Collections.emptyList(), _events); - _lifetime.setPhase(Phase.B); - Assert.assertEquals(Arrays.asList("component activated", "component setPhase B"), _events); - _lifetime.end(); - Assert.assertEquals(Arrays.asList("component activated", "component setPhase B", "component deactivated"), _events); - - } - enum Phase - { - A, - B, - C, - ; - } -} diff --git a/Plugins/Mineplex.Core/test/mineplex/core/lifetimes/SimpleLifetimeTest.java b/Plugins/Mineplex.Core/test/mineplex/core/lifetimes/SimpleLifetimeTest.java deleted file mode 100644 index 061a1decc..000000000 --- a/Plugins/Mineplex.Core/test/mineplex/core/lifetimes/SimpleLifetimeTest.java +++ /dev/null @@ -1,41 +0,0 @@ -package mineplex.core.lifetimes; - -import org.junit.Assert; -import org.junit.Test; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -public class SimpleLifetimeTest -{ - private final SimpleLifetime _lifetime = new SimpleLifetime(); - private final List _events = new ArrayList<>(); - @Test - public void testAddition() - { - _lifetime.register(new LoggingComponent(_events,"a")); - _lifetime.start(); - _lifetime.end(); - Assert.assertEquals(_events, Arrays.asList("a activated", "a deactivated")); - } - @Test - public void testLateAddition() - { - _lifetime.start(); - _lifetime.register(new LoggingComponent(_events,"a")); - _lifetime.end(); - Assert.assertEquals(_events, Arrays.asList("a activated", "a deactivated")); - } - @Test - public void testActivationOrder() - { - _lifetime.register(new LoggingComponent(_events,"a")); - _lifetime.register(new LoggingComponent(_events,"b")); - _lifetime.start(); - _lifetime.end(); - Assert.assertEquals(_events, Arrays.asList("a activated", "b activated", "b deactivated", "a deactivated")); - } - - -} diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Blink.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Blink.java index bd50cddd3..2da9df000 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Blink.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/Blink.java @@ -4,7 +4,6 @@ import java.util.HashMap; import org.bukkit.Bukkit; import org.bukkit.Effect; -import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; @@ -113,7 +112,7 @@ public class Blink extends SkillActive //Lock Players for (Player cur : player.getWorld().getPlayers()) { - if (cur.equals(player) || cur.getGameMode() == GameMode.SPECTATOR) + if (cur.equals(player)) continue; if (UtilMath.offset(newTarget, cur.getLocation()) > 1) diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/combat/CombatComponent.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/combat/CombatComponent.java index 8f308e43c..45a9d5c51 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/combat/CombatComponent.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/combat/CombatComponent.java @@ -4,7 +4,6 @@ import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.LinkedList; import java.util.List; -import java.util.Map; import java.util.UUID; import mineplex.core.common.util.F; @@ -40,12 +39,12 @@ public class CombatComponent } } - public void AddDamage(String source, double dmg, List mod, Map metadata) + public void AddDamage(String source, double dmg, List mod) { if (source == null) source = "-"; - GetDamage().addFirst(new CombatDamage(source, dmg, mod, metadata)); + GetDamage().addFirst(new CombatDamage(source, dmg, mod)); LastDamage = System.currentTimeMillis(); } diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/combat/CombatDamage.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/combat/CombatDamage.java index b2997285a..c0dedb230 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/combat/CombatDamage.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/combat/CombatDamage.java @@ -1,8 +1,7 @@ package mineplex.minecraft.game.core.combat; -import java.util.HashMap; +import java.util.ArrayList; import java.util.List; -import java.util.Map; import mineplex.minecraft.game.core.damage.DamageChange; @@ -11,20 +10,14 @@ public class CombatDamage private String _name; private double _dmg; private long _time; - private List _mod; - private Map _metadata; + private List _mod = new ArrayList<>(); public CombatDamage(String name, double dmg, List mod) - { - this(name, dmg, mod, new HashMap<>()); - } - public CombatDamage(String name, double dmg, List mod, Map metadata) { _name = name; _dmg = dmg; _time = System.currentTimeMillis(); _mod = mod; - _metadata = metadata; } public String GetName() @@ -46,17 +39,4 @@ public class CombatDamage { return _mod; } - - /** - * Retrieves metadata that was associated with this damage via - * {@link mineplex.minecraft.game.core.damage.CustomDamageEvent#setMetadata(String, Object)}. - *

- * There is no standardized metadata that should be expected. Metadata is meant to be used - * on a per-minigame basis to store additional information about the damage. - * @return a non-null map containing the metadata - */ - public Map getMetadata() - { - return _metadata; - } } diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/combat/CombatLog.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/combat/CombatLog.java index 4fb67bf0d..879fc3c30 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/combat/CombatLog.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/combat/CombatLog.java @@ -3,7 +3,6 @@ package mineplex.minecraft.game.core.combat; import java.util.HashMap; import java.util.LinkedList; import java.util.List; -import java.util.Map; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilTime; @@ -48,17 +47,12 @@ public class CombatLog } public void Attacked(String damagerName, double damage, - LivingEntity damagerEnt, String attackName, List mod) - { - this.Attacked(damagerName, damage, damagerEnt, attackName, mod, new HashMap<>()); - } - public void Attacked(String damagerName, double damage, - LivingEntity damagerEnt, String attackName, List mod, Map metadata) + LivingEntity damagerEnt, String attackName, List mod) { // Add Attacked CombatComponent comp = GetEnemy(damagerName, damagerEnt); - comp.AddDamage(attackName, damage, mod, metadata); + comp.AddDamage(attackName, damage, mod); // Set Last LastDamager = comp; diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/combat/CombatManager.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/combat/CombatManager.java index ab3cc5171..b6591802f 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/combat/CombatManager.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/combat/CombatManager.java @@ -307,10 +307,11 @@ public class CombatManager extends MiniPlugin Get((Player)event.GetDamagerEntity(true)).SetLastCombatEngaged(System.currentTimeMillis()); Get(event.GetDamageePlayer()).SetLastCombatEngaged(System.currentTimeMillis()); } + Get(event.GetDamageePlayer()).Attacked( UtilEnt.getName(event.GetDamagerEntity(true)), (int) event.GetDamage(), event.GetDamagerEntity(true), - reason, event.GetDamageMod(), event.getMetadata()); + reason, event.GetDamageMod()); } // Damager is WORLD else @@ -408,9 +409,9 @@ public class CombatManager extends MiniPlugin if (event.GetReason() != null) reason = event.GetReason(); - + Get(event.GetDamageePlayer()).Attacked(source, - (int) event.GetDamage(), null, reason, event.GetDamageMod(), event.getMetadata()); + (int) event.GetDamage(), null, reason, event.GetDamageMod()); } } @@ -487,8 +488,8 @@ public class CombatManager extends MiniPlugin if (log.GetAssists() > 0) killPlayer += " + " + log.GetAssists(); - String weapon = (String) log.GetKiller().GetDamage().getFirst().getMetadata().get("customWeapon"); - weapon = weapon == null ? log.GetKiller().GetLastDamageSource() : weapon; + String weapon = log.GetKiller().GetLastDamageSource(); + UtilPlayer.message( cur, F.main("Death", diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/CustomDamageEvent.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/CustomDamageEvent.java index a4830cb56..ec3781d43 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/CustomDamageEvent.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/CustomDamageEvent.java @@ -2,9 +2,7 @@ package mineplex.minecraft.game.core.damage; import java.util.ArrayList; import java.util.HashMap; -import java.util.Map; -import org.apache.commons.lang.Validate; import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.entity.LivingEntity; @@ -31,7 +29,6 @@ public class CustomDamageEvent extends Event implements Cancellable private HashMap _knockbackMod = new HashMap(); - private Map _metadata = new HashMap<>(); //Ents private LivingEntity _damageeEntity; private Player _damageePlayer; @@ -371,34 +368,6 @@ public class CustomDamageEvent extends Event implements Cancellable return IsCancelled(); } - /** - * Associates the provided metadata key with the provided value. - * Metadata can later be retrieved from individual {@link - * mineplex.minecraft.game.core.combat.CombatDamage} instances acquired - * from the {@link mineplex.minecraft.game.core.combat.CombatLog}. - * - * @param key non-null key to associate the value with - * @param value nullable value - * @throws IllegalArgumentException if key is null - */ - public void setMetadata(String key, Object value) - { - Validate.notNull(key); - _metadata.put(key, value); - } - - /** - * Gets all Metadata associated with this event. There is - * no standardized metadata that should be expected. - * - * @see #setMetadata(String, Object) - * @return non-null map of metadata - */ - public Map getMetadata() - { - return _metadata; - } - @Override @Deprecated /** diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/DamageManager.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/DamageManager.java index f1905d25a..ebb331257 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/DamageManager.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/DamageManager.java @@ -345,7 +345,7 @@ public class DamageManager extends MiniPlugin Player damagee = event.GetDamageePlayer(); //Not Survival - if (damagee.getGameMode() != GameMode.SURVIVAL && damagee.getGameMode() != GameMode.ADVENTURE) + if (damagee.getGameMode() != GameMode.SURVIVAL) { event.SetCancelled("Damagee in Creative"); return; @@ -373,7 +373,7 @@ public class DamageManager extends MiniPlugin Player damager = event.GetDamagerPlayer(true); //Not Survival - if (damager.getGameMode() != GameMode.SURVIVAL && damager.getGameMode() != GameMode.ADVENTURE) + if (damager.getGameMode() != GameMode.SURVIVAL) { event.SetCancelled("Damager in Creative"); return; diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/explosion/CustomExplosion.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/explosion/CustomExplosion.java index 220e2cb7f..f7984765a 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/explosion/CustomExplosion.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/explosion/CustomExplosion.java @@ -252,6 +252,7 @@ public class CustomExplosion extends Explosion continue; double d7 = entity.f(this.posX, this.posY, this.posZ) / this._size; // XXX + if (d7 <= 1.0D) { double d0 = entity.locX - this.posX; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java index 614655cfa..94d745ab4 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java @@ -13,9 +13,6 @@ import java.util.Optional; import java.util.Set; import java.util.UUID; -import mineplex.core.lifetimes.Lifetimed; -import mineplex.core.lifetimes.ListenerComponent; -import mineplex.core.lifetimes.PhasedLifetime; import org.apache.commons.lang3.tuple.Triple; import org.bukkit.Bukkit; import org.bukkit.ChatColor; @@ -109,8 +106,9 @@ import nautilus.game.arcade.world.WorldData; import net.minecraft.server.v1_8_R3.EntityItem; import net.minecraft.server.v1_8_R3.PacketPlayInUseEntity; -public abstract class Game extends ListenerComponent implements Lifetimed +public abstract class Game implements Listener { + private final static int MAX_TICK_SPEED_MEASUREMENT = 40; public long getGameLiveTime() @@ -134,7 +132,6 @@ public abstract class Game extends ListenerComponent implements Lifetimed private GameType _gameType; protected String[] _gameDesc; - private PhasedLifetime _lifetime = new PhasedLifetime<>(); // Map private HashMap> _files; @@ -387,7 +384,6 @@ public abstract class Game extends ListenerComponent implements Lifetimed { Manager = manager; - _lifetime.register(this); // Player List UtilTabTitle.broadcastHeaderAndFooter(C.cGold + C.Bold + gameType.GetName(), "Visit " + C.cGreen + "www.mineplex.com" + ChatColor.RESET + " for News, Forums and Shop"); @@ -758,9 +754,6 @@ public abstract class Game extends ListenerComponent implements Lifetimed for (Player player : UtilServer.getPlayers()) player.leaveVehicle(); - - _lifetime.setPhase(state); - // Event GameStateChangeEvent stateEvent = new GameStateChangeEvent(this, state); UtilServer.getServer().getPluginManager().callEvent(stateEvent); @@ -2343,11 +2336,7 @@ public abstract class Game extends ListenerComponent implements Lifetimed public void disable() { - cleanupModules(); - cleanupCommands(); Managers.get(AntiHack.class).resetIgnoredChecks(); - getLifetime().end(); - getStatTrackers().forEach(HandlerList::unregisterAll); } @EventHandler @@ -2455,10 +2444,5 @@ public abstract class Game extends ListenerComponent implements Lifetimed { return clazz.cast(_modules.get(clazz)); } - - @Override - public PhasedLifetime getLifetime() - { - return _lifetime; - } + } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/GameComponent.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/GameComponent.java deleted file mode 100644 index 00118f80c..000000000 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/GameComponent.java +++ /dev/null @@ -1,31 +0,0 @@ -package nautilus.game.arcade.game; - -import mineplex.core.lifetimes.Lifetime; -import mineplex.core.lifetimes.Lifetimed; -import mineplex.core.lifetimes.ListenerComponent; - -import java.util.Arrays; - -public class GameComponent extends ListenerComponent implements Lifetimed -{ - private final Lifetime _lifetime; - - public GameComponent(Game game, Game.GameState...active) - { - if (active == null || active.length == 0) - { - // Active for the entire duration of the game. - _lifetime = game.getLifetime(); - _lifetime.register(this); - } else - { - _lifetime = game.getLifetime().register(this, Arrays.asList(active)); - } - } - - @Override - public Lifetime getLifetime() - { - return _lifetime; - } -} diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/Gladiators.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/Gladiators.java index 907c62858..59dd19d6c 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/Gladiators.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/Gladiators.java @@ -1115,7 +1115,6 @@ public class Gladiators extends SoloGame @Override public void disable() { - super.disable(); _hotbarEditor.deregisterSelf(); // De-register as listener _hotbarEditor.onDisable(); // Fully disable } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/GunModule.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/GunModule.java index 648a15578..ae6606a81 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/GunModule.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/GunModule.java @@ -946,7 +946,6 @@ public class GunModule implements Listener } event.SetKnockback(false); - event.setMetadata("gunType", "KNIFE"); } } @@ -1058,7 +1057,6 @@ public class GunModule implements Listener event.SetIgnoreArmor(true); Bukkit.getPluginManager().callEvent(new CustomGunDamageEvent(bullet, event.GetDamageePlayer(), hitArea == 1, event, this)); - event.setMetadata("gunType", bullet.Gun.getGunStats().name()); } public int getArrowHitArea(Player damagee, Location origin, Vector trajectory) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/Minestrike.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/Minestrike.java index 7dfd7593d..17ddcab9f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/Minestrike.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/Minestrike.java @@ -7,7 +7,6 @@ import java.util.HashSet; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Color; -import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; @@ -249,8 +248,9 @@ public class Minestrike extends TeamGame GameTeam team = GetTeam(event.getPlayer()); if (team == null) return; - GadgetManager gadgetManager = Manager.getCosmeticManager().getGadgetManager(); - GameModifierMineStrikeSkin knifeSkin = (GameModifierMineStrikeSkin) gadgetManager.getActiveGameModifier(event.getPlayer(), + + GadgetManager gadgetManager = Manager.getCosmeticManager().getGadgetManager(); + GameModifierMineStrikeSkin knifeSkin = (GameModifierMineStrikeSkin) gadgetManager.getActiveGameModifier(event.getPlayer(), GameModifierType.MineStrike, GameModifierMineStrikeSkin.getWeaponFilter("Knife")); Material mat = Material.IRON_AXE; @@ -270,7 +270,6 @@ public class Minestrike extends TeamGame { if (IsAlive(event.getPlayer())) { - event.getPlayer().setGameMode(GameMode.ADVENTURE); //Pistol Gun gun = new Gun(GunStats.GLOCK_18, _gunModule); _gunModule.registerGun(gun, event.getPlayer()); @@ -291,7 +290,6 @@ public class Minestrike extends TeamGame { if (IsAlive(event.getPlayer())) { - event.getPlayer().setGameMode(GameMode.ADVENTURE); //Pistol Gun gun = new Gun(GunStats.P2000, _gunModule); _gunModule.registerGun(gun, event.getPlayer()); @@ -403,26 +401,19 @@ public class Minestrike extends TeamGame if (GetTeam(killed).equals(GetTeam(killer))) return; - int amount; + int amount = 300; - String gunType = (String) event.GetLog().GetLastDamager().GetDamage().getFirst().getMetadata().get("gunType"); - switch (gunType) - { - case "AWP": - amount = 100; - break; - case "PPBIZON": - amount = 600; - break; - case "NOVA": - amount = 900; - break; - case "KNIFE": - amount = 1500; - break; - default: - amount = 300; - } + if (event.GetLog().GetLastDamager().GetReason().contains("AWP")) + amount = 100; + + else if (event.GetLog().GetLastDamager().GetReason().contains("PP-Bizon")) + amount = 600; + + else if (event.GetLog().GetLastDamager().GetReason().contains("Nova")) + amount = 900; + + else if (event.GetLog().GetLastDamager().GetReason().contains("Knife")) + amount = 1500; _shopManager.addMoney(killer, amount, "kill with " + event.GetLog().GetLastDamager().GetReason()); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/items/guns/Gun.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/items/guns/Gun.java index cc694d4f9..550d4df3f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/items/guns/Gun.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/items/guns/Gun.java @@ -588,11 +588,7 @@ public class Gun extends StrikeItem { return _gunStats.getGunType(); } - - public GunStats getGunStats() - { - return _gunStats; - } + public String getBaseStatName(boolean withPlayerName) { return (withPlayerName ? getOwnerName() + "." : "") + getName() + "." + _activeSkinName; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/WizardSpellMenu.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/WizardSpellMenu.java index f9f5a9236..6a384727d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/WizardSpellMenu.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/WizardSpellMenu.java @@ -1,14 +1,13 @@ package nautilus.game.arcade.game.games.wizards; +import mineplex.core.MiniPlugin; import mineplex.core.common.util.C; import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilServer; import mineplex.core.itemstack.ItemBuilder; -import mineplex.core.lifetimes.Lifetime; import nautilus.game.arcade.events.GameStateChangeEvent; import nautilus.game.arcade.game.Game.GameState; -import nautilus.game.arcade.game.GameComponent; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.entity.Player; @@ -21,17 +20,18 @@ import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.inventory.InventoryHolder; import org.bukkit.inventory.ItemStack; +import org.bukkit.plugin.java.JavaPlugin; -public class WizardSpellMenu extends GameComponent +public class WizardSpellMenu extends MiniPlugin { private Wizards _wizards; private WizardSpellMenuShop _wizardShop; private ItemStack _wizardSpells = new ItemBuilder(Material.ENCHANTED_BOOK).setTitle(C.cGold + "Wizard Spells") .addLore(C.cGray + "Right click with this to view the spells").build(); - public WizardSpellMenu(Wizards wizards) + public WizardSpellMenu(String moduleName, JavaPlugin plugin, Wizards wizards) { - super(wizards); + super("Wizard Spell Menu", plugin); _wizardShop = new WizardSpellMenuShop(this, wizards.getArcadeManager().GetClients(), wizards.getArcadeManager() .GetDonation(), wizards); _wizards = wizards; @@ -49,7 +49,7 @@ public class WizardSpellMenu extends GameComponent @EventHandler public void onDeath(final PlayerDeathEvent event) { - Bukkit.getScheduler().scheduleSyncDelayedTask(UtilServer.getPlugin(), new Runnable() + Bukkit.getScheduler().scheduleSyncDelayedTask(_plugin, new Runnable() { public void run() { @@ -131,4 +131,5 @@ public class WizardSpellMenu extends GameComponent } } } + } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/Wizards.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/Wizards.java index 25b041e31..c4463ea18 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/Wizards.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/Wizards.java @@ -153,7 +153,7 @@ public class Wizards extends SoloGame new KitWitchDoctor(manager) }); - _wizard = new WizardSpellMenu(this); + _wizard = new WizardSpellMenu("Wizard Spell Menu", getArcadeManager().getPlugin(), this); AnnounceStay = false; BlockBreak = true; @@ -357,7 +357,7 @@ public class Wizards extends SoloGame { percent = 10; } - else if (name.contains("GOLD") || name.contains("CHAINMAIL")) + else if (name.contains("GOLDEN") || name.contains("CHAINMAIL")) { percent = 15; } @@ -1115,16 +1115,8 @@ public class Wizards extends SoloGame @EventHandler public void onClick(InventoryClickEvent event) { - if (event.getClickedInventory() == null) - { + if (event.getClickedInventory() == null || !(event.getClickedInventory().getHolder() instanceof BlockState)) return; - } - InventoryHolder holder = event.getClickedInventory().getHolder(); - // DoubleChests aren't a BlockState as they represent more than one block - if (!(holder instanceof BlockState || holder instanceof DoubleChest)) - { - return; - } ItemStack item = event.getCurrentItem(); @@ -1277,13 +1269,9 @@ public class Wizards extends SoloGame @EventHandler public void onDropItem(PlayerDropItemEvent event) { - // Check to see if they item they're dropping is from one of the first five slots(wand slots) - for (int i = 0; i < 5; i++) + if (event.getPlayer().getInventory().getHeldItemSlot() < 5) { - if (event.getPlayer().getInventory().getItem(i) == null) - { - event.setCancelled(true); - } + event.setCancelled(true); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellAnvilDrop.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellAnvilDrop.java index 48948d9b7..2b4ae19f6 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellAnvilDrop.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellAnvilDrop.java @@ -90,7 +90,7 @@ public class SpellAnvilDrop extends Spell implements SpellClick int spellLevel = entity.getMetadata("SpellLevel").get(0).asInt(); CustomExplosion explosion = new CustomExplosion(Wizards.getArcadeManager().GetDamage(), Wizards.getArcadeManager() - .GetExplosion(), entity.getLocation(), 4 + (spellLevel / 2F), "Anvil Drop"); + .GetExplosion(), entity.getLocation(), 1 + (spellLevel / 2F), "Anvil Drop"); explosion.setPlayer((Player) entity.getMetadata("Wizard").get(0).value(), true); @@ -98,8 +98,7 @@ public class SpellAnvilDrop extends Spell implements SpellClick explosion.setDropItems(false); - explosion.setBlockExplosionSize(explosion.getSize() -3); - explosion.setExplosionDamage(3 + (spellLevel * 2)); + explosion.setMaxDamage(6 + (spellLevel * 4)); explosion.explode(); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellFireball.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellFireball.java index 84b150454..00ea56112 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellFireball.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellFireball.java @@ -32,17 +32,17 @@ public class SpellFireball extends Spell implements SpellClick int spellLevel = projectile.getMetadata("SpellLevel").get(0).asInt(); CustomExplosion explosion = new CustomExplosion(Wizards.getArcadeManager().GetDamage(), Wizards.getArcadeManager() - .GetExplosion(), projectile.getLocation(), (spellLevel * 0.3F) + 4F, "Fireball"); + .GetExplosion(), projectile.getLocation(), (spellLevel * 0.3F) + 1F, "Fireball"); explosion.setPlayer((Player) projectile.getMetadata("FireballSpell").get(0).value(), true); explosion.setFallingBlockExplosion(true); - explosion.setBlockExplosionSize(explosion.getSize() - 2); + explosion.setBlockExplosionSize(explosion.getSize() + 1); explosion.setDropItems(false); - explosion.setExplosionDamage(spellLevel + 6); + explosion.setMaxDamage(spellLevel + 6); explosion.explode(); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellRumble.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellRumble.java index 9ee0fd7fd..936af0589 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellRumble.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellRumble.java @@ -278,12 +278,10 @@ public class SpellRumble extends Spell implements SpellClickBlock, SpellClick if (entity instanceof Player) { - // Why does Slowing by 2 apply slowness 1? The world may never know. - // As such, we subtract one from the spellLevel and ask no more questions Wizards.getArcadeManager() .GetCondition() .Factory() - .Slow("Rumble", (LivingEntity) entity, player, 3, spellLevel-1, false, false, + .Slow("Rumble", (LivingEntity) entity, player, 3, spellLevel, false, false, false, false); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellSummonWolves.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellSummonWolves.java index b93e0d450..e546be6dc 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellSummonWolves.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wizards/spells/SpellSummonWolves.java @@ -86,7 +86,6 @@ public class SpellSummonWolves extends Spell implements SpellClick, SpellClickBl if (tamer instanceof Player) { event.SetDamager((Player) tamer); - event.setMetadata("customWeapon", "Summon Wolves"); event.setKnockbackOrigin(wolf.getLocation()); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameCreationManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameCreationManager.java index b0c6ae5f9..39ed239e9 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameCreationManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameCreationManager.java @@ -87,7 +87,8 @@ public class GameCreationManager implements Listener { if (Manager.GetGame().GetState() == GameState.Dead) { - Manager.GetGame().disable(); + HandlerList.unregisterAll(Manager.GetGame()); + //Schedule Cleanup _ended.add(Manager.GetGame()); @@ -104,6 +105,15 @@ public class GameCreationManager implements Listener while (gameIterator.hasNext()) { Game game = gameIterator.next(); + + game.cleanupModules(); + game.cleanupCommands(); + game.disable(); + + HandlerList.unregisterAll(game); + + for (StatTracker tracker : game.getStatTrackers()) + HandlerList.unregisterAll(tracker); TimingManager.start("GameCreationManager - Attempting Removal - " + game.GetName()); @@ -113,7 +123,8 @@ public class GameCreationManager implements Listener gameIterator.remove(); } else - { + { + boolean removedPlayers = false; if (UtilTime.elapsed(game.GetStateTime(), 20000)) { @@ -143,7 +154,7 @@ public class GameCreationManager implements Listener game.WorldData.Uninitialize(); game.WorldData = null; gameIterator.remove(); - + TimingManager.stop("GameCreationManager - Uninit World - " + game.GetName()); }; } @@ -264,7 +275,7 @@ public class GameCreationManager implements Listener TimingManager.stop("DisplayNext"); TimingManager.start("registerEvents"); - Manager.GetGame().getLifetime().start(GameState.Loading); + UtilServer.getServer().getPluginManager().registerEvents(Manager.GetGame(), Manager.getPlugin()); TimingManager.stop("registerEvents"); } diff --git a/Plugins/pom.xml b/Plugins/pom.xml index dbc3f82c8..137620d6a 100644 --- a/Plugins/pom.xml +++ b/Plugins/pom.xml @@ -134,25 +134,11 @@ 2.8.1 compile - - junit - junit - 4.12 - test - - - org.hamcrest - hamcrest-library - 1.3 - test - - ${project.name} - ${project.basedir}/test ${project.basedir}/src