I wanted to add where my players can purchase an hour of double experience.
I've written a method to allow this, but the double exp doesn't seem to be kicking in.
I've also had to change
public static final double SERVER_EXP_BONUS = 1;
to
public static double SERVER_EXP_BONUS = 1;
So keep that in mind aswell.
Help would be awesome.
Code:
public void PurchasedTimedDoubleExp() {
if(Config.SERVER_EXP_BONUS == 2) {
sendMessage("Double Exp is already manually active!");
}
for (int j = 0; j < Server.playerHandler.players.length; j++) {
if (Server.playerHandler.players[j] != null) {
Client p = (Client)Server.playerHandler.players[j];
p.sendMessage("The server now has Double XP for an hour thanks to "+ playerName +"!");
CycleEventHandler.getSingleton().addEvent(this, new CycleEvent() {
public void execute(CycleEventContainer e) {
Config.SERVER_EXP_BONUS = 2;
}
@Override
public void stop() {
}
}, 3600000);
}
}
}