Skip to content

Commit

Permalink
Implement the reload method for sponge
Browse files Browse the repository at this point in the history
  • Loading branch information
KasperFranz committed May 31, 2020
1 parent 52ece41 commit 9342865
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ The base command is betterchunkloader (with the alias of bcl), this gives the ge
| `chunks` | [ add \| set \| remove ] [User] [Type] [Amount] | `betterchunkloader.chunks` | change a players amount of the different chunk loaders (personal or world)
| `delete` | [User] | `betterchunkloader.delete` | Remove the specified players chunk loaders.
| `purge` | | `betterchunkloader.purge` | Remove Chunk loaders in not existing worlds (eg. after removing a world)
| `reload` | | `betterchunkloader.reload` | Reloads the configuration (implemented in v.3.8.RC3)

## metadata
As part of version 3.8.0, you can now set up metadata on the user for a few defaults.
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/net/kaikk/mc/bcl/Events.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.kaikk.mc.bcl;

import guru.franz.mc.bcl.utils.Messenger;
import net.kaikk.mc.bcl.config.Config;
import net.kaikk.mc.bcl.datastore.DataStoreManager;
import net.kaikk.mc.bcl.utils.BCLPermission;
Expand All @@ -13,6 +14,7 @@
import org.spongepowered.api.event.block.InteractBlockEvent;
import org.spongepowered.api.event.filter.Getter;
import org.spongepowered.api.event.filter.cause.First;
import org.spongepowered.api.event.game.GameReloadEvent;
import org.spongepowered.api.event.network.ClientConnectionEvent;
import org.spongepowered.api.event.world.LoadWorldEvent;
import org.spongepowered.api.text.Text;
Expand Down Expand Up @@ -131,5 +133,15 @@ public void onWorldLoad(LoadWorldEvent event) {
}
}
}

@Listener
public void onReload(GameReloadEvent event){

try {
BetterChunkLoader.instance().setupPlugin();
} catch (Exception e) {
Messenger.logException(e);
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ private void refreshConnection() throws MySQLConnectionException {
String password = mysql.getNode("Password").getString();
String hostname = mysql.getNode("Hostname").getString();
String database = mysql.getNode("Database").getString();

connectionProps.put("user", user);
connectionProps.put("password", password);

Expand Down

0 comments on commit 9342865

Please sign in to comment.