Skip to content

Commit

Permalink
return #createStack() & #createSnapshot() with deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
MrHell228 committed Sep 13, 2024
1 parent 2bc0eec commit c55e532
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ static ItemStack of(ItemType itemType) {
*/
void setQuantity(int quantity) throws IllegalArgumentException;

/**
* @deprecated Use {@link #asImmutable()} instead.
*/
@Deprecated(forRemoval = true)
default ItemStackSnapshot createSnapshot() {
return this.asImmutable();
}

/**
* Returns true if the specified {@link ItemStack} has the same stack
* size, {@link ItemType}, and data. Note that this method is not an
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ static ItemStackSnapshot empty() {
return Sponge.game().factoryProvider().provide(Factory.class).empty();
}

/**
* @deprecated Use {@link #asMutable()} or {@link #asMutableCopy()} instead.
*/
@Deprecated(forRemoval = true)
default ItemStack createStack() {
return this.asMutable();
}

interface Factory {

ItemStackSnapshot empty();
Expand Down

0 comments on commit c55e532

Please sign in to comment.