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 {
|
} else {
|
||||||
dc.updatePresence(Presence.online(Activity.playing("testing"))).subscribe();
|
dc.updatePresence(Presence.online(Activity.playing("testing"))).subscribe();
|
||||||
}
|
}
|
||||||
|
getLogger().info("Loaded!");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
TBMCCoreAPI.SendException("An error occurred while enabling DiscordPlugin!", 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.
|
* 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);
|
public final ConfigData<Boolean> addFakePlayersToBukkit = getConfig().getData("addFakePlayersToBukkit", true);
|
||||||
|
|
||||||
|
@ -164,18 +165,21 @@ public class MinecraftChatModule extends Component<DiscordPlugin> {
|
||||||
//e.printStackTrace();
|
//e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
try { //TODO: Config ^^
|
if (addFakePlayersToBukkit.get()) {
|
||||||
serverWatcher = new ServerWatcher();
|
try {
|
||||||
serverWatcher.enableDisable(true);
|
serverWatcher = new ServerWatcher();
|
||||||
} catch (Exception e) {
|
serverWatcher.enableDisable(true);
|
||||||
TBMCCoreAPI.SendException("Failed to hack the server (object)!", e);
|
} catch (Exception e) {
|
||||||
|
TBMCCoreAPI.SendException("Failed to hack the server (object)!", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void disable() {
|
protected void disable() {
|
||||||
try {
|
try { //If it's not enabled it won't do anything
|
||||||
serverWatcher.enableDisable(false);
|
if (serverWatcher != null)
|
||||||
|
serverWatcher.enableDisable(false);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
TBMCCoreAPI.SendException("Failed to restore the server object!", e);
|
TBMCCoreAPI.SendException("Failed to restore the server object!", e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue