diff --git a/README.MD b/README.MD index f6d5c6e..aca02ae 100644 --- a/README.MD +++ b/README.MD @@ -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. diff --git a/src/main/java/net/kaikk/mc/bcl/Events.java b/src/main/java/net/kaikk/mc/bcl/Events.java index 76ac4ba..70dac72 100644 --- a/src/main/java/net/kaikk/mc/bcl/Events.java +++ b/src/main/java/net/kaikk/mc/bcl/Events.java @@ -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; @@ -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; @@ -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); + } + } } diff --git a/src/main/java/net/kaikk/mc/bcl/datastore/MySqlDataStore.java b/src/main/java/net/kaikk/mc/bcl/datastore/MySqlDataStore.java index 0b3bf91..a5c280b 100644 --- a/src/main/java/net/kaikk/mc/bcl/datastore/MySqlDataStore.java +++ b/src/main/java/net/kaikk/mc/bcl/datastore/MySqlDataStore.java @@ -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);