Giter Site home page Giter Site logo

ez-cfg's Introduction

EZ-Cfg [Minecraft]

A Minecraft dev-Library for making work with configuration files easier and faster

Usage

The following example gives an example of usage (uses Lombok)

@Data
public class MySetting implements YamlConfigData<MySetting, MyPlugin> {
    // Required
    @NonNull private final MyPlugin plugin;

    @CfgField private String myString = "foo";
    @CfgField("IsSomeOptionEnabled") private boolean optionEnabled = true;

    // Complex objects
    @CfgField("holograms.Vector") private Vector hologramsVector = new Vector(0.0, 1.25, 0.0);
    @CfgField("holograms.IDs") private List<Integer> hologramsIds = Collections.emptyList();
}

Then load the values using any available method

MySetting setting = new MySetting().load();
// OR
MySetting setting = new MySetting().load(new File("path/to/File.yml"));
// OR
MySetting setting = new MySetting().load("path/to/File.yml");

Maven:

Due to this library using custom repositories it cannot be deployed to Maven Central so in order to use it you can use JitPack's repo:

<repositories>
  ...
  <repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
  </repository>
  ...
</repositories>
<dependencies>
  ...
  <dependency>
    <groupId>com.github.JarvisCraft.EZ-Cfg</groupId>
    <artifactId>ez-cfg-spigot<!-- or ez-cfg-bungee --></artifactId>
    <version>-SNAPSHOT</version>
  </dependency>
  ...
<dependencies>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.