Skip to content

File Items is a very lightweight library that helps loading items with customizable features from a YAML file.

License

Notifications You must be signed in to change notification settings

bilektugrul/FileItems

 
 

Repository files navigation

File Items

File Items is a very lightweight library that helps loading items with customizable features, such as display names, glowing effects, hidden tooltips, amounts, lore, data, durability, unbreakable item flags, and custom keys from a YAML file.

Documentation

Donations

Using File Items

The project isn't in the Central Repository yet, so specifying a repository is needed.
To add this project as a dependency to your project, add the following to your pom.xml:

Maven dependency

<repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
</repository>
<dependency>
    <groupId>com.github.Despical</groupId>
    <artifactId>FileItems</artifactId>
    <version>1.1.1</version>
</dependency>

Gradle dependency

repositories {
    maven { url 'https://jitpack.io' }
}
dependencies {
    implementation 'com.github.Despical:FileItems:1.1.1'
}

Example usage

import org.bukkit.plugin.java.JavaPlugin;

/**
 * @author Despical
 * <p>
 * Created at 19.09.2024
 */
public class ExamplePlugin extends JavaPlugin {

	@Override
	public void onEnable() {
		// Create the file if not exist.

		ItemManager itemManager = new ItemManager(this);
		itemManager.addCustomKey("slot");
		itemManager.registerItems("items", "game-items");

		SpecialItem item = itemManager.getItem("leave-item");
		int slot = item.getCustomKey("slot");

		getServer().getOnlinePlayers().forEach(player -> player.getInventory().setItem(slot, item.getItemStack()));
	}
}
game-items:
  leave-item:
    name: "&c&lReturn to Lobby &7(Right Click)"
    material: RED_BED
    slot: 8
    lore:
      - "&7Right-click to leave to the lobby!"

License

This code is under GPL-3.0 License

See the LICENSE file for required notices and attributions.

Contributing

I accept Pull Requests via GitHub. There are some guidelines which will make applying PRs easier for me:

  • Ensure you didn't use spaces! Please use tabs for indentation.
  • Respect the code style.
  • Do not increase the version numbers in any examples files and the README.md to the new version that this Pull Request would represent.
  • Create minimal diffs - disable on save actions like reformat source code or organize imports. If you feel the source code should be reformatted create a separate PR for this change.

You can learn more about contributing via GitHub in contribution guidelines.

Building from source

To build this project from source code, run the following from Git Bash:

git clone https://github.com/Despical/FileItems && cd FileItems
mvn clean package

Important

Maven must be installed to build this project.

About

File Items is a very lightweight library that helps loading items with customizable features from a YAML file.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%