RuneHive-Game
Loading...
Searching...
No Matches
BotStartupEvent.java
Go to the documentation of this file.
1package com.runehive.game.task.impl;
2
3import com.runehive.Config;
4import com.runehive.content.bot.PlayerBot;
5import com.runehive.content.bot.objective.BotObjective;
6import com.runehive.game.task.TickableTask;
7
8/**
9 * This loads all the bots into the game world after starting the server.
10 *
11 * @author Daniel
12 */
13public class BotStartupEvent extends TickableTask {
14
15 public BotStartupEvent() {
16 super(false, 100);
17 }
18
19 @Override
20 protected void tick() {
21 if (tick >= Config.MAX_BOTS) {
22 cancel();
23 return;
24 }
25
26 PlayerBot bot = new PlayerBot();
27 bot.register();
28 BotObjective.WALK_TO_BANK.init(bot);
29 }
30}
The class that contains setting-related constants for the server.
Definition Config.java:24
static final int MAX_BOTS
The amount of bots that will spawn into the game world.
Definition Config.java:172
void register()
Registers an entity to the World.
synchronized final void cancel()
Cancels all subsequent executions.
Definition Task.java:113
TickableTask(boolean instant, int delay)