More halloween stuff
This commit is contained in:
parent
35b6f594d4
commit
f97174528f
@ -40,7 +40,7 @@ public class ParticleHalloween extends ParticleGadget
|
|||||||
public ParticleHalloween(GadgetManager manager)
|
public ParticleHalloween(GadgetManager manager)
|
||||||
{
|
{
|
||||||
super(manager, "Halloween Aura", UtilText
|
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);
|
Material.PUMPKIN, (byte) 0);
|
||||||
|
|
||||||
_nextIndexes = new int[INDEXES_PER_ITERATION];
|
_nextIndexes = new int[INDEXES_PER_ITERATION];
|
||||||
|
@ -232,7 +232,8 @@ public class HubManager extends MiniClientPlugin<HubClient> implements IChatMess
|
|||||||
require(ProfileManager.class);
|
require(ProfileManager.class);
|
||||||
require(HubPlayerManager.class);
|
require(HubPlayerManager.class);
|
||||||
|
|
||||||
_hubPlugin = new HalloweenHubPlugin();
|
//_hubPlugin = new HalloweenHubPlugin();
|
||||||
|
_hubPlugin = new HubPlugin();
|
||||||
|
|
||||||
generatePermissions();
|
generatePermissions();
|
||||||
}
|
}
|
||||||
|
@ -2,8 +2,12 @@ package mineplex.hub.plugin;
|
|||||||
|
|
||||||
import net.md_5.bungee.api.ChatColor;
|
import net.md_5.bungee.api.ChatColor;
|
||||||
|
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
|
||||||
import mineplex.core.common.util.UtilServer;
|
import mineplex.core.common.util.UtilServer;
|
||||||
import mineplex.core.common.util.UtilTextTop;
|
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.titles.tracks.custom.ScrollAnimation;
|
||||||
import mineplex.core.updater.UpdateType;
|
import mineplex.core.updater.UpdateType;
|
||||||
import mineplex.core.utils.UtilScheduler;
|
import mineplex.core.utils.UtilScheduler;
|
||||||
@ -19,6 +23,7 @@ public class HalloweenHubPlugin extends HubPlugin
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
private int _newsIndex;
|
private int _newsIndex;
|
||||||
|
private NPC _messengerNPC;
|
||||||
|
|
||||||
public HalloweenHubPlugin()
|
public HalloweenHubPlugin()
|
||||||
{
|
{
|
||||||
@ -26,12 +31,17 @@ public class HalloweenHubPlugin extends HubPlugin
|
|||||||
|
|
||||||
_newsManager.setEnabled(false);
|
_newsManager.setEnabled(false);
|
||||||
UtilScheduler.runEvery(UpdateType.FASTEST, this::displayNews);
|
UtilScheduler.runEvery(UpdateType.FASTEST, this::displayNews);
|
||||||
|
UtilScheduler.runEvery(UpdateType.MIN_01, this::checkEventStart);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setupWorld()
|
protected void setupWorld()
|
||||||
{
|
{
|
||||||
_manager.GetSpawn().getWorld().setTime(18000);
|
_manager.GetSpawn().getWorld().setTime(18000);
|
||||||
|
_npcManager.spawnNPCs("HALLOWEEN_MESSENGER", npc ->
|
||||||
|
{
|
||||||
|
_messengerNPC = npc;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void displayNews()
|
private void displayNews()
|
||||||
@ -43,4 +53,20 @@ public class HalloweenHubPlugin extends HubPlugin
|
|||||||
|
|
||||||
UtilTextTop.display(NEWS_TEXT[_newsIndex], UtilServer.getPlayers());
|
UtilTextTop.display(NEWS_TEXT[_newsIndex], UtilServer.getPlayers());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void checkEventStart()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void npcInteract(NPCInteractEvent event)
|
||||||
|
{
|
||||||
|
if (!event.getNpc().equals(_messengerNPC))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package mineplex.hub.plugin;
|
package mineplex.hub.plugin;
|
||||||
|
|
||||||
import mineplex.core.MiniPlugin;
|
import mineplex.core.MiniPlugin;
|
||||||
|
import mineplex.core.newnpc.NewNPCManager;
|
||||||
import mineplex.hub.HubManager;
|
import mineplex.hub.HubManager;
|
||||||
import mineplex.hub.hubgame.HubGame;
|
import mineplex.hub.hubgame.HubGame;
|
||||||
import mineplex.hub.hubgame.HubGameManager;
|
import mineplex.hub.hubgame.HubGameManager;
|
||||||
@ -23,6 +24,7 @@ public class HubPlugin extends MiniPlugin
|
|||||||
protected final HubManager _manager;
|
protected final HubManager _manager;
|
||||||
protected final HubGameManager _hubGameManager;
|
protected final HubGameManager _hubGameManager;
|
||||||
protected final NewsManager _newsManager;
|
protected final NewsManager _newsManager;
|
||||||
|
protected final NewNPCManager _npcManager;
|
||||||
|
|
||||||
public HubPlugin()
|
public HubPlugin()
|
||||||
{
|
{
|
||||||
@ -36,6 +38,7 @@ public class HubPlugin extends MiniPlugin
|
|||||||
_manager = require(HubManager.class);
|
_manager = require(HubManager.class);
|
||||||
_hubGameManager = require(HubGameManager.class);
|
_hubGameManager = require(HubGameManager.class);
|
||||||
_newsManager = require(NewsManager.class);
|
_newsManager = require(NewsManager.class);
|
||||||
|
_npcManager = require(NewNPCManager.class);
|
||||||
|
|
||||||
setupWorld();
|
setupWorld();
|
||||||
addHubGames();
|
addHubGames();
|
||||||
|
Loading…
Reference in New Issue
Block a user