Konfig: Easily add configuration to your plugin (API)
1.0.1Easily add configuration to your plugin (API)
Easily add configuration to your plugin with Konfig.
Maven:
Repo:
<repositories>
<repository>
<id>bintray-simpleauthority-konfig</id>
<url>https://dl.bintray.com/simpleauthority/konfig</url>
</repository>
</repositories>
Dependency:
<dependencies>
<dependency>
<groupId>com.algorithmjunkie.mc</groupId>
<artifactId>konfig-?</artifactId>
<version>1.0.1</version>
<scope>compile</scope>
</dependency>
</dependencies>
Change the ? to one of "core", "bukkit", or "bungee". Use core to reimplement Konfig for your platform. Use bukkit or bungee to use the library on either platform respectively.
Example :
Create a Konfig:
public class TestKonfig extends BukkitKonfig {
public TestKonfig ( JavaPlugin plugin ) {
// place test.yml in plugin's data folder
super ( plugin, "test.yml" , plugin. getDataFolder ( ) ) ;
}
// now create methods to access your data
public String getAuthToken ( ) {
return getString ( "auth-token" ) ;
}
public List < String > getBlockedUsers ( ) {
return getStringList ( "blocked-users" ) ;
}
}
Then use it:
public class TestPlugin extends JavaPlugin {
@Override
public void onEnable() {
TestKonfig konfig = new TestKonfig(this);
String authToken = konfig.getAuthToken();
List<String> blockedUsers = konfig.getBlockedUsers();
}
}
That's it.
Similar projects
Config →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta