Skip to content

Developer API

Ján Kluka edited this page Aug 21, 2021 · 5 revisions

API


package dev.drawethree.ultrabackpacks.api;

import dev.drawethree.ultrabackpacks.model.backpack.BackpackData;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;

import java.util.List;

public interface UltraBackpacksAPI {

	/**
	 * Returns true if player has backpack in his inventory
	 *
	 * @param player Player
	 * @return true if player has backpack in his inventory
	 */
	boolean hasBackpack(Player player);

	/**
	 * Get player BackpackData
	 *
	 * @param player Player
	 * @return BackpackData.class
	 */
	BackpackData getBackpackData(Player player);

	/**
	 * Sells the contents of player backpack.
	 *
	 * @param player  Player
	 * @param sellAll If true, sells whole backpack. If false, sells only x amount of items based on AutoSell backpack enchant.
	 */
	void sellBackpack(Player player, boolean sellAll);

	/**
	 * Handles the specified broken blocks and tries to add them into backpack
	 *
	 * @param player Player
	 * @param blocks List of blocks that were broken and should be added to backpack
	 */
	void handleBlocksBroken(Player player, List<Block> blocks);

}

UBP logo

General

Default Files

Support

For Developers

Clone this wiki locally