Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Gets the full ID of an ItemStack. ID:DATA
- *
- * @param itemStack The {@see org.bukkit.inventory.ItemStack}.
- * @return the full ID of an {@see org.bukkit.inventory.ItemStack}.
- */
- public String getFullId(ItemStack itemStack) {
- // Define a new String builder to append the ID and the data.
- StringBuilder stringBuilder = new StringBuilder();
- // Append the ID.
- stringBuilder.append(itemStack.getTypeId());
- // If the item has a data, we add it.
- if (itemStack.getData() != null && itemStack.getData().getData() != 0)
- stringBuilder.append(":" + itemStack.getData().getData());
- // Return the StringBuilder as a String.
- return stringBuilder.toString();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement