RuneHive-Game
Loading...
Searching...
No Matches
DoubleExperienceJob.java
Go to the documentation of this file.
1package com.runehive.game.world.cronjobs.impl;
2
3import com.runehive.Config;
4import com.runehive.RuneHive;
5import com.runehive.game.world.World;
6import com.runehive.game.world.cronjobs.Job;
7import org.joda.time.DateTime;
8
9import java.time.DayOfWeek;
10
11public class DoubleExperienceJob extends Job {
12
14 super("Double Experience");
15 }
16
17 @Override
18 public void execute() {
19 final DateTime time = RuneHive.currentDateTime();
20 final DayOfWeek day = DayOfWeek.of(time.getDayOfWeek());
21 final boolean enable = (day == DayOfWeek.SATURDAY || day == DayOfWeek.SUNDAY);
22
23 if (enable && !Config.DOUBLE_EXPERIENCE) {
24 World.sendMessage("<col=ff0000>Double EXP has been enabled!");
25 // DiscordPlugin.sendSimpleMessage("Double EXP has been enabled!");
26 } else if (!enable && Config.DOUBLE_EXPERIENCE) {
27 World.sendMessage("<col=ff0000>Double EXP has been disabled!");
28 // DiscordPlugin.sendSimpleMessage("Double EXP has been disabled!");
29 }
30
32 }
33}
The class that contains setting-related constants for the server.
Definition Config.java:24
static boolean DOUBLE_EXPERIENCE
Definition Config.java:139
static DateTime currentDateTime()
Represents the game world.
Definition World.java:46
static void sendMessage(String... messages)
Sends a global message.
Definition World.java:396