🇫🇷
zMenu
Marketplace
French
French
  • Commencer
  • Plugins supportés
  • Configurations
    • Informations
    • Commandes et permissions
    • PlaceHolder
    • Comment créer un inventaire étape par étape
    • Inventaires
    • Boutons
      • Requirements
      • Action
    • Items
    • Patterns
    • Commands
    • Player data
    • Config.json
  • API
    • Informations
    • Create button
    • Create inventory
    • Create material loader
    • Fast Events
  • Plugin's files
  • Example GUI menus
Propulsé par GitBook
Sur cette page
  1. API

Create material loader

PrécédentCreate inventorySuivantFast Events

Dernière mise à jour il y a 1 an

Vous pouvez créer votre propre . Un chargeur de matériaux vous permettra de créer un ItemStack à partir de la configuration.

Exemple avec HeadDatabase :

package fr.maxlego08.menu.loader.materials;

import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.inventory.ItemStack;

import fr.maxlego08.menu.api.loader.MaterialLoader;
import me.arcaniax.hdb.api.HeadDatabaseAPI;

public class HeadDatabaseLoader implements MaterialLoader{

	@Override
	public String getKey() {
		return "hdb";
	}

	@Override
	public ItemStack load(YamlConfiguration configuration, String path, String materialString) {
		try {
			HeadDatabaseAPI api = new HeadDatabaseAPI();
			return api.getItemHead(materialString);
			
		}catch (Exception e) {
			e.printStackTrace();
		}
		
		return null;
	}

}
MaterialLoader