From 6a668004e072a8761ffd1df54f69179fc1572a4c Mon Sep 17 00:00:00 2001 From: LCastr0 Date: Fri, 7 Apr 2017 14:06:44 -0300 Subject: [PATCH] Added game start event to core, to be called inside arcade and handled inside core --- .../core/arcadeevents/CoreGameStartEvent.java | 33 +++++++++++++++++++ .../taunts => arcadeevents}/GameType.java | 2 +- .../core/gadget/event/TauntCommandEvent.java | 2 +- .../gadget/gadgets/taunts/EternalTaunt.java | 1 + .../core/gadget/types/TauntGadget.java | 2 +- .../game/arcade/command/TauntCommand.java | 2 +- 6 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/arcadeevents/CoreGameStartEvent.java rename Plugins/Mineplex.Core/src/mineplex/core/{gadget/gadgets/taunts => arcadeevents}/GameType.java (95%) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/arcadeevents/CoreGameStartEvent.java b/Plugins/Mineplex.Core/src/mineplex/core/arcadeevents/CoreGameStartEvent.java new file mode 100644 index 000000000..c9ca0757c --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/arcadeevents/CoreGameStartEvent.java @@ -0,0 +1,33 @@ +package mineplex.core.arcadeevents; + +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; + +public class CoreGameStartEvent extends Event +{ + + private static final HandlerList handlers = new HandlerList(); + + private GameType _gameType; + + public CoreGameStartEvent(GameType gameType) + { + _gameType = gameType; + } + + public GameType getGameType() + { + return _gameType; + } + + public HandlerList getHandlers() + { + return handlers; + } + + public static HandlerList getHandlerList() + { + return handlers; + } + +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/taunts/GameType.java b/Plugins/Mineplex.Core/src/mineplex/core/arcadeevents/GameType.java similarity index 95% rename from Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/taunts/GameType.java rename to Plugins/Mineplex.Core/src/mineplex/core/arcadeevents/GameType.java index a0fe9230b..2bd7e1ed4 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/taunts/GameType.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/arcadeevents/GameType.java @@ -1,4 +1,4 @@ -package mineplex.core.gadget.gadgets.taunts; +package mineplex.core.arcadeevents; public enum GameType { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/event/TauntCommandEvent.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/event/TauntCommandEvent.java index e803d54e2..00ef321e2 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/event/TauntCommandEvent.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/event/TauntCommandEvent.java @@ -5,7 +5,7 @@ import org.bukkit.event.Event; import org.bukkit.event.HandlerList; import mineplex.core.common.util.UtilTime; -import mineplex.core.gadget.gadgets.taunts.GameType; +import mineplex.core.arcadeevents.GameType; public class TauntCommandEvent extends Event { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/taunts/EternalTaunt.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/taunts/EternalTaunt.java index 53e6a7793..f7fa1d10f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/taunts/EternalTaunt.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/taunts/EternalTaunt.java @@ -18,6 +18,7 @@ import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerPickupItemEvent; import org.bukkit.util.Vector; +import mineplex.core.arcadeevents.GameType; import mineplex.core.common.Rank; import mineplex.core.common.util.C; import mineplex.core.common.util.F; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/TauntGadget.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/TauntGadget.java index 0cca83b9f..85074ed29 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/TauntGadget.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/types/TauntGadget.java @@ -13,7 +13,7 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import mineplex.core.gadget.GadgetManager; -import mineplex.core.gadget.gadgets.taunts.GameType; +import mineplex.core.arcadeevents.GameType; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/TauntCommand.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/TauntCommand.java index bc17eb83d..cd3a1a3ff 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/TauntCommand.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/TauntCommand.java @@ -9,7 +9,7 @@ import mineplex.core.common.Rank; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilTime; import mineplex.core.gadget.event.TauntCommandEvent; -import mineplex.core.gadget.gadgets.taunts.GameType; +import mineplex.core.arcadeevents.GameType; import mineplex.minecraft.game.core.combat.CombatManager; import nautilus.game.arcade.ArcadeManager;