#1083: Add API methods to Vault

This commit is contained in:
Jishuna 2024-12-14 11:39:20 +11:00 committed by md_5
parent 3339db1661
commit c0302c1911
No known key found for this signature in database
GPG key ID: E8E901AC7C617C11

View file

@ -1,10 +1,99 @@
package org.bukkit.block;
import org.bukkit.inventory.ItemStack;
import org.bukkit.loot.LootTable;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* Represents a captured state of a trial spawner.
* Represents a captured state of a vault.
*/
@ApiStatus.Experimental
public interface Vault extends TileState {
/**
* Gets the distance(squared) at which a player must enter for this vault to
* activate.
*
* @return the distance(squared) at which a player must enter for this vault
* to activate.
*/
double getActivationRange();
/**
* Sets the distance(squared) at which a player must enter for this vault to
* activate.
*
* @param range the distance(squared) at which a player must enter for this
* vault to activate.
*/
void setActivationRange(double range);
/**
* Gets the distance(squared) at which a player must exit for the vault to
* deactivate.
*
* @return the distance(squared) at which a player must exit for the vault
* to deactivate.
*/
double getDeactivationRange();
/**
* Sets the distance(squared) at which a player must exit for this vault to
* deactivate.
*
* @param range the distance(squared) at which a player must exit for this
* vault to deactivate.
*/
void setDeactivationRange(double range);
/**
* Gets the {@link LootTable} this vault will pick rewards from.
*
* @return the loot table
*/
@NotNull
LootTable getLootTable();
/**
* Sets the {@link LootTable} this vault will pick rewards from.
*
* @param table the loot table
*/
void setLootTable(@NotNull LootTable table);
/**
* Gets the {@link LootTable} this vault will display items from. <br>
* If this value is null the regular loot table will be used to display
* items.
*
* @return the loot table to display items from
*/
@Nullable
LootTable getDisplayLootTable();
/**
* Sets the {@link LootTable} this vault will display items from. <br>
* If this value is set to null the regular loot table will be used to
* display items.
*
* @param table the loot table to display items from
*/
void setDisplayLootTable(@Nullable LootTable table);
/**
* Gets the {@link ItemStack} players must use to unlock this vault.
*
* @return the key item
*/
@NotNull
ItemStack getKeyItem();
/**
* Sets the {@link ItemStack} players must use to unlock this vault.
*
* @param keyItem the key item
*/
void setKeyItem(@NotNull ItemStack keyItem);
}