Commits

coll1234567 authored and md_5 committed c0302c1911e
#1083: Add API methods to Vault
No tags

src/main/java/org/bukkit/block/Vault.java

Modified
1 1 package org.bukkit.block;
2 2
3 +import org.bukkit.inventory.ItemStack;
4 +import org.bukkit.loot.LootTable;
3 5 import org.jetbrains.annotations.ApiStatus;
6 +import org.jetbrains.annotations.NotNull;
7 +import org.jetbrains.annotations.Nullable;
4 8
5 9 /**
6 - * Represents a captured state of a trial spawner.
10 + * Represents a captured state of a vault.
7 11 */
8 12 @ApiStatus.Experimental
9 13 public interface Vault extends TileState {
14 +
15 + /**
16 + * Gets the distance(squared) at which a player must enter for this vault to
17 + * activate.
18 + *
19 + * @return the distance(squared) at which a player must enter for this vault
20 + * to activate.
21 + */
22 + double getActivationRange();
23 +
24 + /**
25 + * Sets the distance(squared) at which a player must enter for this vault to
26 + * activate.
27 + *
28 + * @param range the distance(squared) at which a player must enter for this
29 + * vault to activate.
30 + */
31 + void setActivationRange(double range);
32 +
33 + /**
34 + * Gets the distance(squared) at which a player must exit for the vault to
35 + * deactivate.
36 + *
37 + * @return the distance(squared) at which a player must exit for the vault
38 + * to deactivate.
39 + */
40 + double getDeactivationRange();
41 +
42 + /**
43 + * Sets the distance(squared) at which a player must exit for this vault to
44 + * deactivate.
45 + *
46 + * @param range the distance(squared) at which a player must exit for this
47 + * vault to deactivate.
48 + */
49 + void setDeactivationRange(double range);
50 +
51 + /**
52 + * Gets the {@link LootTable} this vault will pick rewards from.
53 + *
54 + * @return the loot table
55 + */
56 + @NotNull
57 + LootTable getLootTable();
58 +
59 + /**
60 + * Sets the {@link LootTable} this vault will pick rewards from.
61 + *
62 + * @param table the loot table
63 + */
64 + void setLootTable(@NotNull LootTable table);
65 +
66 + /**
67 + * Gets the {@link LootTable} this vault will display items from. <br>
68 + * If this value is null the regular loot table will be used to display
69 + * items.
70 + *
71 + * @return the loot table to display items from
72 + */
73 + @Nullable
74 + LootTable getDisplayLootTable();
75 +
76 + /**
77 + * Sets the {@link LootTable} this vault will display items from. <br>
78 + * If this value is set to null the regular loot table will be used to
79 + * display items.
80 + *
81 + * @param table the loot table to display items from
82 + */
83 + void setDisplayLootTable(@Nullable LootTable table);
84 +
85 + /**
86 + * Gets the {@link ItemStack} players must use to unlock this vault.
87 + *
88 + * @return the key item
89 + */
90 + @NotNull
91 + ItemStack getKeyItem();
92 +
93 + /**
94 + * Sets the {@link ItemStack} players must use to unlock this vault.
95 + *
96 + * @param keyItem the key item
97 + */
98 + void setKeyItem(@NotNull ItemStack keyItem);
10 99 }

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut