Added some config saving code
This commit is contained in:
parent
19dd0f5ef5
commit
73280fa88e
1 changed files with 8 additions and 1 deletions
|
@ -49,6 +49,10 @@ public class DiscordPlugin extends JavaPlugin implements IListener<ReadyEvent> {
|
||||||
lastannouncementtime = getConfig().getLong("lastannouncementtime");
|
lastannouncementtime = getConfig().getLong("lastannouncementtime");
|
||||||
lastseentime = getConfig().getLong("lastseentime");
|
lastseentime = getConfig().getLong("lastseentime");
|
||||||
Test = getConfig().getBoolean("test", true);
|
Test = getConfig().getBoolean("test", true);
|
||||||
|
getConfig().set("lastannouncementtime", lastannouncementtime);
|
||||||
|
getConfig().set("lastseentime", lastseentime);
|
||||||
|
getConfig().set("test", Test); // TODO: TMP
|
||||||
|
saveConfig();
|
||||||
}
|
}
|
||||||
ClientBuilder cb = new ClientBuilder();
|
ClientBuilder cb = new ClientBuilder();
|
||||||
cb.withToken(Files.readFirstLine(new File("TBMC", "Token.txt"), StandardCharsets.UTF_8));
|
cb.withToken(Files.readFirstLine(new File("TBMC", "Token.txt"), StandardCharsets.UTF_8));
|
||||||
|
@ -95,7 +99,7 @@ public class DiscordPlugin extends JavaPlugin implements IListener<ReadyEvent> {
|
||||||
issuechannel = devServer.getChannelByID("239519012529111040"); // bottest
|
issuechannel = devServer.getChannelByID("239519012529111040"); // bottest
|
||||||
dc.changeStatus(Status.game("testing"));
|
dc.changeStatus(Status.game("testing"));
|
||||||
}
|
}
|
||||||
//sendMessageToChannel(botchannel, "Minecraft server started up");
|
// sendMessageToChannel(botchannel, "Minecraft server started up");
|
||||||
Runnable r = new Runnable() {
|
Runnable r = new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
AnnouncementGetterThreadMethod();
|
AnnouncementGetterThreadMethod();
|
||||||
|
@ -116,6 +120,9 @@ public class DiscordPlugin extends JavaPlugin implements IListener<ReadyEvent> {
|
||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
stop = true;
|
stop = true;
|
||||||
|
getConfig().set("lastannouncementtime", lastannouncementtime);
|
||||||
|
getConfig().set("lastseentime", lastseentime);
|
||||||
|
saveConfig();
|
||||||
try {
|
try {
|
||||||
dc.changeStatus(Status.game("on TBMC"));
|
dc.changeStatus(Status.game("on TBMC"));
|
||||||
dc.logout();
|
dc.logout();
|
||||||
|
|
Loading…
Reference in a new issue