Skip to content

Commit c55e532

Browse files
committed
return #createStack() & #createSnapshot() with deprecation
1 parent 2bc0eec commit c55e532

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/main/java/org/spongepowered/api/item/inventory/ItemStack.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,14 @@ static ItemStack of(ItemType itemType) {
121121
*/
122122
void setQuantity(int quantity) throws IllegalArgumentException;
123123

124+
/**
125+
* @deprecated Use {@link #asImmutable()} instead.
126+
*/
127+
@Deprecated(forRemoval = true)
128+
default ItemStackSnapshot createSnapshot() {
129+
return this.asImmutable();
130+
}
131+
124132
/**
125133
* Returns true if the specified {@link ItemStack} has the same stack
126134
* size, {@link ItemType}, and data. Note that this method is not an

src/main/java/org/spongepowered/api/item/inventory/ItemStackSnapshot.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ static ItemStackSnapshot empty() {
4545
return Sponge.game().factoryProvider().provide(Factory.class).empty();
4646
}
4747

48+
/**
49+
* @deprecated Use {@link #asMutable()} or {@link #asMutableCopy()} instead.
50+
*/
51+
@Deprecated(forRemoval = true)
52+
default ItemStack createStack() {
53+
return this.asMutable();
54+
}
55+
4856
interface Factory {
4957

5058
ItemStackSnapshot empty();

0 commit comments

Comments
 (0)