Skip to content

ForestTechMC/ForestConfigAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

ForestConfigAPI

badge badge badge badge badge badge badge

JavaDoc 1.0

Small and effective Config API for Developers!
Only spigot support!
(Bungee version)

Table of contents

Getting started

Make sure you reloaded maven or gradle in your project.

Add ForestConfigAPI to your project

badge

You need to add this dependency into your plugin, then look at under the dependencies example

Maven
<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>com.github.ForestTechMC</groupId>
        <artifactId>ForestConfigAPI</artifactId>
        <version>VERSION</version>
        <scope>provided</scope>
    </dependency>
</dependencies>
Gradle
allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

dependencies {
    implementation 'com.github.ForestTechMC:ForestConfigAPI:VERSION'
}

Using Config API

    // Main class
    private Main plugin;
    // This API
    private ConfigAPI configAPI;
    
    // Load method
    public void loadConfig() {
        // Constructor with Main class, and name
        configAPI = new ConfigAPI(plugin, "coolConfig");    
        // Create config
        configAPI.create();
        
        // getConfig() -> this return you configuration of file for using like normal config
        configAPI.getConfig().set("coolMessage", "Cool message in config!");
        // this save your edits
        configAPI.save();
    }
    
        // Here you can see, how to get string from your "coolConfig.yml" with path "coolMessage"
    public void messages() {
        configAPI.getConfig().getString("coolMessage");
    }

License

ForestRedisAPI is licensed under the permissive MIT license. Please see LICENSE.txt for more information.