Skip to content

Commit 96a1c60

Browse files
committed
add documentation to ItemEvent
1 parent b18c7bc commit 96a1c60

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

api/src/main/java/net/azisaba/loreeditor/api/event/ItemEvent.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
import java.util.Collections;
1313
import java.util.List;
1414

15+
/**
16+
* Fired when an item is being displayed in the inventory.
17+
*/
1518
public final class ItemEvent {
1619
private final Player player;
1720
private final ItemStack bukkitItem;
@@ -24,22 +27,42 @@ public ItemEvent(@NotNull Player player, @NotNull ItemStack bukkitItem, @NotNull
2427
this.itemTag = itemTag;
2528
}
2629

30+
/**
31+
* Get the player who is viewing the item
32+
* @return the viewer
33+
*/
2734
public @NotNull Player getPlayer() {
2835
return player;
2936
}
3037

38+
/**
39+
* Returns the item as a Bukkit ItemStack. Modifications to this item will <b>NOT</b> be reflected in the actual item.
40+
* @return the bukkit item
41+
*/
3142
public @NotNull ItemStack getBukkitItem() {
3243
return bukkitItem;
3344
}
3445

46+
/**
47+
* Returns the item tag of the item. Modifications to this tag will <b>NOT</b> be reflected in the actual item.
48+
* @return the item tag
49+
*/
3550
public @NotNull CompoundTag getItemTag() {
3651
return itemTag;
3752
}
3853

54+
/**
55+
* Add a lore to the item. This will be displayed in the result item.
56+
* @param component the lore to add
57+
*/
3958
public void addLore(@NotNull Component component) {
4059
components.add(component);
4160
}
4261

62+
/**
63+
* Returns the list of lore components to be added to the item.
64+
* @return the list of lore components
65+
*/
4366
@Contract(pure = true)
4467
public @NotNull @UnmodifiableView List<Component> getComponents() {
4568
return Collections.unmodifiableList(components);

0 commit comments

Comments
 (0)