From f97174528f42e270ab3779fed45cbe1adda2a8ca Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 30 Sep 2017 21:39:53 +0100 Subject: [PATCH] More halloween stuff --- .../gadgets/particle/ParticleHalloween.java | 2 +- .../src/mineplex/hub/HubManager.java | 3 ++- .../hub/plugin/HalloweenHubPlugin.java | 26 +++++++++++++++++++ .../src/mineplex/hub/plugin/HubPlugin.java | 3 +++ 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleHalloween.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleHalloween.java index b8b14d492..40f4048d3 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleHalloween.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/ParticleHalloween.java @@ -40,7 +40,7 @@ public class ParticleHalloween extends ParticleGadget public ParticleHalloween(GadgetManager manager) { super(manager, "Halloween Aura", UtilText - .splitLineToArray(C.cGray + "Legend has it that if someone were to ", LineFormat.LORE), CostConstants.FOUND_IN_TRICK_OR_TREAT, + .splitLineToArray(C.cGray + "...", LineFormat.LORE), CostConstants.FOUND_IN_TRICK_OR_TREAT, Material.PUMPKIN, (byte) 0); _nextIndexes = new int[INDEXES_PER_ITERATION]; diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java index 87e46d5d8..bce02a9ed 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java @@ -232,7 +232,8 @@ public class HubManager extends MiniClientPlugin implements IChatMess require(ProfileManager.class); require(HubPlayerManager.class); - _hubPlugin = new HalloweenHubPlugin(); + //_hubPlugin = new HalloweenHubPlugin(); + _hubPlugin = new HubPlugin(); generatePermissions(); } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/plugin/HalloweenHubPlugin.java b/Plugins/Mineplex.Hub/src/mineplex/hub/plugin/HalloweenHubPlugin.java index 13e9a2f33..777604f46 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/plugin/HalloweenHubPlugin.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/plugin/HalloweenHubPlugin.java @@ -2,8 +2,12 @@ package mineplex.hub.plugin; import net.md_5.bungee.api.ChatColor; +import org.bukkit.event.EventHandler; + import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilTextTop; +import mineplex.core.newnpc.NPC; +import mineplex.core.newnpc.event.NPCInteractEvent; import mineplex.core.titles.tracks.custom.ScrollAnimation; import mineplex.core.updater.UpdateType; import mineplex.core.utils.UtilScheduler; @@ -19,6 +23,7 @@ public class HalloweenHubPlugin extends HubPlugin .build(); private int _newsIndex; + private NPC _messengerNPC; public HalloweenHubPlugin() { @@ -26,12 +31,17 @@ public class HalloweenHubPlugin extends HubPlugin _newsManager.setEnabled(false); UtilScheduler.runEvery(UpdateType.FASTEST, this::displayNews); + UtilScheduler.runEvery(UpdateType.MIN_01, this::checkEventStart); } @Override protected void setupWorld() { _manager.GetSpawn().getWorld().setTime(18000); + _npcManager.spawnNPCs("HALLOWEEN_MESSENGER", npc -> + { + _messengerNPC = npc; + }); } private void displayNews() @@ -43,4 +53,20 @@ public class HalloweenHubPlugin extends HubPlugin UtilTextTop.display(NEWS_TEXT[_newsIndex], UtilServer.getPlayers()); } + + private void checkEventStart() + { + + } + + @EventHandler + public void npcInteract(NPCInteractEvent event) + { + if (!event.getNpc().equals(_messengerNPC)) + { + return; + } + + + } } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/plugin/HubPlugin.java b/Plugins/Mineplex.Hub/src/mineplex/hub/plugin/HubPlugin.java index 22a915753..b54e6ef8b 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/plugin/HubPlugin.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/plugin/HubPlugin.java @@ -1,6 +1,7 @@ package mineplex.hub.plugin; import mineplex.core.MiniPlugin; +import mineplex.core.newnpc.NewNPCManager; import mineplex.hub.HubManager; import mineplex.hub.hubgame.HubGame; import mineplex.hub.hubgame.HubGameManager; @@ -23,6 +24,7 @@ public class HubPlugin extends MiniPlugin protected final HubManager _manager; protected final HubGameManager _hubGameManager; protected final NewsManager _newsManager; + protected final NewNPCManager _npcManager; public HubPlugin() { @@ -36,6 +38,7 @@ public class HubPlugin extends MiniPlugin _manager = require(HubManager.class); _hubGameManager = require(HubGameManager.class); _newsManager = require(NewsManager.class); + _npcManager = require(NewNPCManager.class); setupWorld(); addHubGames();