Skip to content

Commit 364ef0b

Browse files
📝 Add docstrings to dev/paper1.21.10
Docstrings generation was requested by @JonasFranke. * #234 (comment) The following files were modified: * `src/main/java/de/j/stationofdoom/util/ItemBuilder.java`
1 parent eadc3d1 commit 364ef0b

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

src/main/java/de/j/stationofdoom/util/ItemBuilder.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,13 @@ public ItemBuilder addFlags(ItemFlag ... itemFlags) {
8282
return this;
8383
}
8484

85+
/**
86+
* Creates a PLAYER_HEAD ItemStack and, if a texture `url` is provided, applies it as the head's skin texture.
87+
*
88+
* @param url the texture value to assign to the head's `textures` property (typically a base64-encoded texture payload); if empty, the default head is returned
89+
* @param name the name to associate with the underlying GameProfile used for the head
90+
* @return an ItemStack representing the player head with the specified texture applied, or a default player head if `url` is empty
91+
*/
8592
public static ItemStack createHead(String url, String name) {
8693
ItemStack head = new ItemStack(Material.PLAYER_HEAD, (short) 1);
8794
if (url.isEmpty())
@@ -103,6 +110,13 @@ public static ItemStack createHead(String url, String name) {
103110
return head;
104111
}
105112

113+
/**
114+
* Initializes this builder's item as a player head and applies the given skin texture and profile name.
115+
*
116+
* @param url the skin texture value to apply to the head (if empty, the method returns null)
117+
* @param name the profile name to associate with the head's GameProfile
118+
* @return the current ItemBuilder configured as a PLAYER_HEAD with the specified texture and name, or `null` if `url` is empty
119+
*/
106120
public ItemBuilder getHeadBuilder(String url, String name) {
107121
item = new ItemStack(Material.PLAYER_HEAD, (short) 1);
108122
if (url.isEmpty())
@@ -133,4 +147,4 @@ public static ItemStack getHead(String name) {
133147
Main.getMainLogger().severe("An error appeared in while getting a head");
134148
return null;
135149
}
136-
}
150+
}

0 commit comments

Comments
 (0)