Skip to content

Commit

Permalink
WItemSlot: Add getters for backing inventory details
Browse files Browse the repository at this point in the history
Adds the following property getters:
- getInventory
- getStartIndex
- getSlotsWide
- getSlotsHigh
  • Loading branch information
Juuxel committed Aug 15, 2024
1 parent 8e985d6 commit 9e78afd
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/main/java/io/github/cottonmc/cotton/gui/widget/WItemSlot.java
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,42 @@ public boolean canFocus() {
return true;
}

/**
* {@return the inventory backing this slot}
* @since 11.1.0
*/
public Inventory getInventory() {
return inventory;
}

/**
* {@return the starting index of slots in the backing inventory}
* @since 11.1.0
*/
public int getStartIndex() {
return startIndex;
}

/**
* {@return the width of this slot widget in individual slots}
* @since 11.1.0
*/
public int getSlotsWide() {
return slotsWide;
}

/**
* {@return the height of this slot widget in individual slots}
* @since 11.1.0
*/
public int getSlotsHigh() {
return slotsHigh;
}

/**
* {@return whether this slot is a big slot}
* Big slots are commonly used for crafting results and similar outputs.
*/
public boolean isBigSlot() {
return big;
}
Expand Down

0 comments on commit 9e78afd

Please sign in to comment.