RuneHive-Game
Loading...
Searching...
No Matches
BotStartupEvent.java
Go to the documentation of this file.
1
package
com.runehive.game.task.impl;
2
3
import
com.runehive.Config;
4
import
com.runehive.content.bot.PlayerBot;
5
import
com.runehive.content.bot.objective.BotObjective;
6
import
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
*/
13
public
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
}
com.runehive.Config
The class that contains setting-related constants for the server.
Definition
Config.java:24
com.runehive.Config.MAX_BOTS
static final int MAX_BOTS
The amount of bots that will spawn into the game world.
Definition
Config.java:172
com.runehive.content.bot.PlayerBot
The player bot entity.
Definition
PlayerBot.java:29
com.runehive.content.bot.PlayerBot.register
void register()
Registers an entity to the World.
Definition
PlayerBot.java:71
com.runehive.game.task.Task.cancel
synchronized final void cancel()
Cancels all subsequent executions.
Definition
Task.java:113
com.runehive.game.task.TickableTask.TickableTask
TickableTask(boolean instant, int delay)
Definition
TickableTask.java:7
com.runehive.game.task.impl.BotStartupEvent.BotStartupEvent
BotStartupEvent()
Definition
BotStartupEvent.java:15
com.runehive.game.task.impl.BotStartupEvent.tick
void tick()
Definition
BotStartupEvent.java:20
com.runehive.content.bot.objective.BotObjective
Definition
BotObjective.java:6
com.runehive.content.bot.objective.BotObjective.WALK_TO_BANK
WALK_TO_BANK
Definition
BotObjective.java:9