Skip to content

Commit

Permalink
Updated: Fix missed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
BlaneyXYZ committed Jul 26, 2024
1 parent a850f09 commit 859661d
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public InventoryGUI(final Inventory base) {
}

/**
* Tags an ItemStack with the given UUID, which can be used to quickly get the item again.
* Tags an ItemStack with the given Key, which can be used to quickly get the item again.
*
* @param is ItemStack to tag
* @param key Key to tag the item with
Expand Down Expand Up @@ -94,7 +94,7 @@ public void addItem(final ClickHandler clickHandler, final int x, final int y, f

/**
* Adds an item to the GUI. The given {@link ClickHandler} will be associated with this item. The item will be
* tagged with the given UUID.
* tagged with the given Key.
*
* @param key Key to tag the item with
* @param clickHandler ClickHandler to use for the item
Expand Down Expand Up @@ -158,10 +158,10 @@ public UUID getIdentifier() {
}

/**
* Gets an ItemStack from this GUI by its UUID tag.
* Gets an ItemStack from this GUI by its Key tag.
*
* @param key Key tag of item
* @return ItemStack or null if no matching UUID
* @return ItemStack or null if no matching Key
*/
public ItemStack getItemStack(final NamespacedKey key) {
if (key == null) return null;
Expand Down Expand Up @@ -229,7 +229,7 @@ public void replaceItemStack(final ItemStack original, final ItemStack replaceme
* @param replacement Replacement ItemStack
*/
public void replaceItemStack(final NamespacedKey key, final ItemStack replacement) {
if (key == null) throw new IllegalArgumentException("UUID cannot be null");
if (key == null) throw new IllegalArgumentException("Key cannot be null");
for (int i = 0; i < this.getBase().getSize(); i++) {
final ItemStack is = this.getBase().getItem(i);
if (!key.equals(this.getTag(is))) continue;
Expand All @@ -255,14 +255,14 @@ public ItemStack setItemMeta(final ItemStack is, final String name, final String
}

/**
* Sets the name of the ItemStack tagged with the given UUID.
* Sets the name of the ItemStack tagged with the given Key.
*
* @param key Key of the ItemStack
* @param name New name
*/
public void setName(final NamespacedKey key, final String name) {
final ItemStack is = this.getItemStack(key);
if (is == null) throw new IllegalArgumentException("No such ItemStack UUID found");
if (is == null) throw new IllegalArgumentException("No such ItemStack Key found");
this.replaceItemStack(key, this.setItemMeta(is, name));
}

Expand Down

0 comments on commit 859661d

Please sign in to comment.