Comments (3)
If you load after SLP (with depend or soft depend) you should be able to get the SLP instance and then access the parsed configuration classes through the configuration manager. To avoid conflicts between SLP and your plugin, you could then call the function that implements /slp disable
(this will also persist across reboots).
Note however that this isn't officially part of the public API (only Replacement API and Ban API is public, see API page in SLP wiki). You would be directly accessing internal classes of SLP that may change in the future. Given the maintenance-only state of SLP I doubt that any of this will change in the future, though.
I'm also just spontaneously looking at the classes and may have typos, but I think it should roughly work like this:
ServerListPlusCore slp = ServerListPlusCore.getInstance();
ServerStatusConf conf = slp.getConf(ServerStatusConf.class);
// ... parse config ...
// run /slp disable, returns true if enable state changed, or throws an exception
slp.getProfiles().setEnabled(false);
There is also PluginConf.class
and (on Bukkit) BukkitConf.class
for the !Plugin
and !Bukkit
part of the configuration, but I guess these aren't too interesting.
SLP transforms the ServerStatusConf
to a PersonalizedStatusPatch
, available via slp.getStatus().getPatch()
and slp.getStatus().getHosts()
. There the strings are already partially pre-processed (certain static placeholders applied, possibly color codes replaced, ...). I guess this is also not helpful for you, so looking at the ServerStatusConf
is probably best.
from serverlistplus.
Yeah, been looking at the patches one with getDefaults, getPersonalized and getBanned so far...
from serverlistplus.
from serverlistplus.
Related Issues (20)
- Possible update to 1.19? HOT 8
- Keeps saying internal error occured when i change the yml file HOT 1
- Not reading ServerListPlus.yml content HOT 5
- Playercount hover Glitched for Newer Versions HOT 2
- Bungeecord HOT 2
- Activity HOT 2
- slp crashes when i modify config in any way HOT 1
- fallback uuid
- Favicon not working. HOT 8
- Incompatible version with 1.20.4 (likely ProtocolLib issue, Paper is not affected) HOT 7
- players list could't work HOT 7
- SLP doesn't show all players on the network HOT 3
- Bungee - error on startup- Snakeyaml? HOT 4
- Error in --Plugin line after change first motd msg. HOT 4
- [feature request] please add PAPIProxyBridge support in slp
- PremiumVanish support HOT 2
- BungeeBan gone? (Removal of BungeeBan)
- slp showing mc version 1.20.5 as "wrong mc version" HOT 5
- Possible hover issues with latest paper builds HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serverlistplus.