OFile
is a Java class designed to simplify interactions with YAML configuration files within Bukkit and Spigot Minecraft server plugins. It provides an easy-to-use API for reading and writing data to YAML files, making plugin development more efficient and straightforward.
- Easy creation and management of YAML configuration files.
- Supports basic CRUD operations for configuration data.
- Automatic handling of file creation and existence checks.
- Methods for reading and writing various data types, including strings, integers, booleans, lists, and maps.
- JDK 8 or newer.
- Bukkit or Spigot server.
To use OFile
in your project, follow these steps:
- Download the
OFile.java
file from this repository. - Add the file to your plugin's source code directory.
- Ensure your project is set up to compile with the Bukkit/Spigot API.
Here's a quick example to get you started:
import path.to.OFile;
public class YourPluginClass {
public void someMethod() {
// Creating a new OFile instance for "example" config
OFile configFile = new OFile("example");
// Setting a value
configFile.set("path.to.value", "This is a value");
// Getting a value
String value = configFile.getString("path.to.value");
System.out.println(value); // Outputs: This is a value
}
}
Replace "example"
with the name of your YAML file (without the .yml
extension), and adapt the code to fit your plugin's structure and requirements.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.