Add a /we random command to spawn a random world event

This commit is contained in:
Ben 2016-04-10 12:56:00 +01:00
parent 37bb64bffd
commit 66274188c8
2 changed files with 12 additions and 0 deletions

View File

@ -124,6 +124,17 @@ public class WorldEventManager extends MiniPlugin implements ScoreboardElement
}
}
public void randomEvent()
{
if (_runningEvents.size() == 0)
{
if (UtilServer.getPlayers().length > 0)
{
tryStartEvent();
}
}
}
private void tryStartEvent()
{
WorldEventType[] types = WorldEventType.values();

View File

@ -14,6 +14,7 @@ public class WorldEventCommand extends MultiCommandBase<WorldEventManager>
AddCommand(new StartCommand(Plugin));
AddCommand(new ClearCommand(Plugin));
AddCommand(new RandomCommand(Plugin));
}
@Override