Config and such
This commit is contained in:
parent
cd2132ba45
commit
beae6e6ce0
2 changed files with 12 additions and 7 deletions
|
@ -231,6 +231,7 @@ public class DiscordPlugin extends ButtonPlugin {
|
|||
} else {
|
||||
dc.updatePresence(Presence.online(Activity.playing("testing"))).subscribe();
|
||||
}
|
||||
getLogger().info("Loaded!");
|
||||
} catch (Exception e) {
|
||||
TBMCCoreAPI.SendException("An error occurred while enabling DiscordPlugin!", e);
|
||||
}
|
||||
|
|
|
@ -117,6 +117,7 @@ public class MinecraftChatModule extends Component<DiscordPlugin> {
|
|||
|
||||
/**
|
||||
* Whether players logged on from Discord should be recognised by other plugins. Some plugins might break if it's turned off.
|
||||
* But it's really hacky.
|
||||
*/
|
||||
public final ConfigData<Boolean> addFakePlayersToBukkit = getConfig().getData("addFakePlayersToBukkit", true);
|
||||
|
||||
|
@ -164,17 +165,20 @@ public class MinecraftChatModule extends Component<DiscordPlugin> {
|
|||
//e.printStackTrace();
|
||||
}
|
||||
|
||||
try { //TODO: Config ^^
|
||||
if (addFakePlayersToBukkit.get()) {
|
||||
try {
|
||||
serverWatcher = new ServerWatcher();
|
||||
serverWatcher.enableDisable(true);
|
||||
} catch (Exception e) {
|
||||
TBMCCoreAPI.SendException("Failed to hack the server (object)!", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void disable() {
|
||||
try {
|
||||
try { //If it's not enabled it won't do anything
|
||||
if (serverWatcher != null)
|
||||
serverWatcher.enableDisable(false);
|
||||
} catch (Exception e) {
|
||||
TBMCCoreAPI.SendException("Failed to restore the server object!", e);
|
||||
|
|
Loading…
Reference in a new issue