Skip to content

Commit

Permalink
Added javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
fulminazzo committed Apr 11, 2024
1 parent 519e541 commit a6299a7
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions gui/base/src/main/java/it/angrybear/yagl/guis/GUIImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,19 @@ public boolean isMovable(int slot) {
return this;
}

protected int addSingle(GUIContent content, int j) {
for (; j < this.contents.size(); j++) {
Contents c = this.contents.get(j);
/**
* Tries to add the given content from the given index.
*
* @param content the content
* @param index the index
* @return the new index if it was successful, -1 in case of error
*/
protected int addSingle(final @NotNull GUIContent content, int index) {
for (; index < this.contents.size(); index++) {
Contents c = this.contents.get(index);
if (c == null) {
this.contents.set(j, new Contents(content));
return j;
this.contents.set(index, new Contents(content));
return index;
}
}
return -1;
Expand Down

0 comments on commit a6299a7

Please sign in to comment.