Skip to content

Commit 196f5d5

Browse files
authored
Move deprecated ItemStackLike related methods to Common (#2565)
1 parent 723d5c2 commit 196f5d5

27 files changed

+0
-565
lines changed

src/main/java/org/spongepowered/api/advancement/DisplayInfo.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -164,22 +164,6 @@ default Builder icon(ItemType itemType) {
164164
return this.icon(ItemStack.of(itemType, 1));
165165
}
166166

167-
/**
168-
* @deprecated Use {@link #icon(ItemStackLike)} instead.
169-
*/
170-
@Deprecated(forRemoval = true)
171-
default Builder icon(ItemStack itemStack) {
172-
return this.icon((ItemStackLike) itemStack);
173-
}
174-
175-
/**
176-
* @deprecated Use {@link #icon(ItemStackLike)} instead.
177-
*/
178-
@Deprecated(forRemoval = true)
179-
default Builder icon(ItemStackSnapshot itemStackSnapshot) {
180-
return this.icon((ItemStackLike) itemStackSnapshot);
181-
}
182-
183167
/**
184168
* Sets the icon of the advancement with the
185169
* specified {@link ItemStackLike}.

src/main/java/org/spongepowered/api/block/entity/Jukebox.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
import org.spongepowered.api.data.Keys;
2828
import org.spongepowered.api.data.value.Value;
29-
import org.spongepowered.api.item.inventory.ItemStack;
3029
import org.spongepowered.api.item.inventory.ItemStackLike;
3130
import org.spongepowered.api.item.inventory.ItemStackSnapshot;
3231

@@ -60,14 +59,6 @@ default Value.Mutable<ItemStackSnapshot> item() {
6059
*/
6160
void eject();
6261

63-
/**
64-
* @deprecated Use {@link #insert(ItemStackLike)} instead.
65-
*/
66-
@Deprecated(forRemoval = true)
67-
default void insert(ItemStack disc) {
68-
this.insert((ItemStackLike) disc);
69-
}
70-
7162
/**
7263
* Ejects the current music disc item in this Jukebox and inserts the given one.
7364
*

src/main/java/org/spongepowered/api/event/cause/entity/damage/DamageModifier.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -163,22 +163,6 @@ public Builder group(final String group) {
163163
return this;
164164
}
165165

166-
/**
167-
* @deprecated Use {@link #item(ItemStackLike)} instead.
168-
*/
169-
@Deprecated(forRemoval = true)
170-
public Builder item(final ItemStack itemStack) {
171-
return this.item((ItemStackLike) itemStack);
172-
}
173-
174-
/**
175-
* @deprecated Use {@link #item(ItemStackLike)} instead.
176-
*/
177-
@Deprecated(forRemoval = true)
178-
public Builder item(final ItemStackSnapshot snapshot) {
179-
return this.item((ItemStackLike) snapshot);
180-
}
181-
182166
public Builder item(final ItemStackLike item) {
183167
this.snapshot = java.util.Objects.requireNonNull(item, "item").asImmutable();
184168
return this;

src/main/java/org/spongepowered/api/item/enchantment/EnchantmentType.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
import net.kyori.adventure.text.ComponentLike;
2828
import org.spongepowered.api.block.entity.EnchantmentTable;
29-
import org.spongepowered.api.item.inventory.ItemStack;
3029
import org.spongepowered.api.item.inventory.ItemStackLike;
3130
import org.spongepowered.api.registry.DefaultedRegistryValue;
3231
import org.spongepowered.api.tag.EnchantmenTypeTags;
@@ -82,14 +81,6 @@ public interface EnchantmentType extends DefaultedRegistryValue, ComponentLike,
8281
*/
8382
int maximumEnchantabilityForLevel(int level);
8483

85-
/**
86-
* @deprecated Use {@link #canBeAppliedToStack(ItemStackLike)} instead,
87-
*/
88-
@Deprecated(forRemoval = true)
89-
default boolean canBeAppliedToStack(ItemStack stack) {
90-
return this.canBeAppliedToStack((ItemStackLike) stack);
91-
}
92-
9384
/**
9485
* Test if this enchantment type can be applied to an {@link ItemStackLike}.
9586
*
@@ -98,14 +89,6 @@ default boolean canBeAppliedToStack(ItemStack stack) {
9889
*/
9990
boolean canBeAppliedToStack(ItemStackLike stack);
10091

101-
/**
102-
* @deprecated Use {@link #canBeAppliedToStack(ItemStackLike)} instead,
103-
*/
104-
@Deprecated(forRemoval = true)
105-
default boolean canBeAppliedByTable(ItemStack stack) {
106-
return this.canBeAppliedByTable((ItemStackLike) stack);
107-
}
108-
10992
/**
11093
* Test if this enchantment type can be applied to an {@link ItemStackLike} by
11194
* the {@link EnchantmentTable}.

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

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,6 @@ public interface ArmorEquipable extends Equipable {
4646
*/
4747
ItemStack head();
4848

49-
/**
50-
* @deprecated Use {@link #setHead(ItemStackLike)} instead.
51-
*/
52-
@Deprecated(forRemoval = true)
53-
default void setHead(ItemStack head) {
54-
this.setHead((ItemStackLike) head);
55-
}
56-
5749
/**
5850
* Sets the head.
5951
*
@@ -68,14 +60,6 @@ default void setHead(ItemStack head) {
6860
*/
6961
ItemStack chest();
7062

71-
/**
72-
* @deprecated Use {@link #setChest(ItemStackLike)} instead.
73-
*/
74-
@Deprecated(forRemoval = true)
75-
default void setChest(ItemStack chest) {
76-
this.setChest((ItemStackLike) chest);
77-
}
78-
7963
/**
8064
* Sets the chest.
8165
*
@@ -90,14 +74,6 @@ default void setChest(ItemStack chest) {
9074
*/
9175
ItemStack legs();
9276

93-
/**
94-
* @deprecated Use {@link #setLegs(ItemStackLike)} instead.
95-
*/
96-
@Deprecated(forRemoval = true)
97-
default void setLegs(ItemStack legs) {
98-
this.setLegs((ItemStackLike) legs);
99-
}
100-
10177
/**
10278
* Sets the legs.
10379
*
@@ -112,14 +88,6 @@ default void setLegs(ItemStack legs) {
11288
*/
11389
ItemStack feet();
11490

115-
/**
116-
* @deprecated Use {@link #setFeet(ItemStackLike)} instead.
117-
*/
118-
@Deprecated(forRemoval = true)
119-
default void setFeet(ItemStack feet) {
120-
this.setFeet((ItemStackLike) feet);
121-
}
122-
12391
/**
12492
* Sets the feet.
12593
*
@@ -145,14 +113,6 @@ default ItemStack itemInHand(Supplier<? extends HandType> handType) {
145113
*/
146114
ItemStack itemInHand(HandType handType);
147115

148-
/**
149-
* @deprecated Use {@link #setItemInHand(Supplier, ItemStackLike)} instead.
150-
*/
151-
@Deprecated(forRemoval = true)
152-
default void setItemInHand(Supplier<? extends HandType> handType, ItemStack itemInHand) {
153-
this.setItemInHand(handType, (ItemStackLike) itemInHand);
154-
}
155-
156116
/**
157117
* Sets the equipped item in hand.
158118
*
@@ -163,14 +123,6 @@ default void setItemInHand(Supplier<? extends HandType> handType, ItemStackLike
163123
this.setItemInHand(handType.get(), itemInHand);
164124
}
165125

166-
/**
167-
* @deprecated Use {@link #setItemInHand(HandType, ItemStackLike)} instead.
168-
*/
169-
@Deprecated(forRemoval = true)
170-
default void setItemInHand(HandType handType, ItemStack itemInHand) {
171-
this.setItemInHand(handType, (ItemStackLike) itemInHand);
172-
}
173-
174126
/**
175127
* Sets the equipped item in hand.
176128
*

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,6 @@ public interface Container extends Inventory {
5959
*/
6060
List<Inventory> viewed();
6161

62-
/**
63-
* @deprecated Use {@link #setCursor(ItemStackLike)} instead.
64-
*/
65-
@Deprecated(forRemoval = true)
66-
default boolean setCursor(ItemStack item) {
67-
return this.setCursor((ItemStackLike) item);
68-
}
69-
7062
/**
7163
* Sets the viewing players cursor item.
7264
* <p>Returns false when the container is no longer open.</p>

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

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,6 @@ default boolean canEquip(final Supplier<? extends EquipmentType> type) {
5656
return this.canEquip(type.get());
5757
}
5858

59-
/**
60-
* @deprecated Use {@link #canEquip(EquipmentType, ItemStackLike)} instead.
61-
*/
62-
@Deprecated(forRemoval = true)
63-
default boolean canEquip(EquipmentType type, ItemStack equipment) {
64-
return this.canEquip(type, (ItemStackLike) equipment);
65-
}
66-
6759
/**
6860
* Gets whether this {@link Equipable} can equip the supplied equipment in its slot of
6961
* the specified type (eg. whether calling {@link #equip} with the specified
@@ -75,14 +67,6 @@ default boolean canEquip(EquipmentType type, ItemStack equipment) {
7567
*/
7668
boolean canEquip(EquipmentType type, ItemStackLike equipment);
7769

78-
/**
79-
* @deprecated Use {@link #canEquip(Supplier, ItemStackLike)} instead.
80-
*/
81-
@Deprecated(forRemoval = true)
82-
default boolean canEquip(final Supplier<? extends EquipmentType> type, final ItemStack equipment) {
83-
return this.canEquip(type, (ItemStackLike) equipment);
84-
}
85-
8670
default boolean canEquip(final Supplier<? extends EquipmentType> type, final ItemStackLike equipment) {
8771
return this.canEquip(type.get(), equipment);
8872
}
@@ -100,14 +84,6 @@ default Optional<ItemStack> equipped(final Supplier<? extends EquipmentType> typ
10084
return this.equipped(type.get());
10185
}
10286

103-
/**
104-
* @deprecated Use {@link #equip(EquipmentType, ItemStackLike)} instead.
105-
*/
106-
@Deprecated(forRemoval = true)
107-
default boolean equip(EquipmentType type, ItemStack equipment) {
108-
return this.equip(type, (ItemStackLike) equipment);
109-
}
110-
11187
/**
11288
* Sets the item currently equipped by the {@link Equipable} in the specified slot, if
11389
* the equipable has such a slot.
@@ -121,14 +97,6 @@ default boolean equip(EquipmentType type, ItemStack equipment) {
12197
*/
12298
boolean equip(EquipmentType type, ItemStackLike equipment);
12399

124-
/**
125-
* @deprecated Use {@link #equip(Supplier, ItemStackLike)} instead.
126-
*/
127-
@Deprecated(forRemoval = true)
128-
default boolean equip(final Supplier<? extends EquipmentType> type, final ItemStack equipment) {
129-
return this.equip(type, (ItemStackLike) equipment);
130-
}
131-
132100
default boolean equip(final Supplier<? extends EquipmentType> type, final ItemStackLike equipment) {
133101
return this.equip(type.get(), equipment);
134102
}

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

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,6 @@ static Builder builder() {
142142
*/
143143
ItemStack peek();
144144

145-
/**
146-
* @deprecated Use {@link #offer(ItemStackLike...)} instead.
147-
*/
148-
@Deprecated(forRemoval = true)
149-
default InventoryTransactionResult offer(ItemStack... stacks) {
150-
return this.offer((ItemStackLike[]) stacks);
151-
}
152-
153145
/**
154146
* Adds one or more ItemStacks to this inventory.
155147
*
@@ -160,14 +152,6 @@ default InventoryTransactionResult offer(ItemStack... stacks) {
160152
*/
161153
InventoryTransactionResult offer(ItemStackLike... stacks);
162154

163-
/**
164-
* @deprecated Use {@link #canFit(ItemStackLike)} instead.
165-
*/
166-
@Deprecated(forRemoval = true)
167-
default boolean canFit(ItemStack stack) {
168-
return this.canFit((ItemStackLike) stack);
169-
}
170-
171155
/**
172156
* Returns true if the entire stack can fit in this inventory.
173157
*
@@ -214,14 +198,6 @@ default boolean canFit(ItemStack stack) {
214198
*/
215199
Optional<ItemStack> peekAt(int index);
216200

217-
/**
218-
* @deprecated Use {@link #offer(int, ItemStackLike)} instead.
219-
*/
220-
@Deprecated(forRemoval = true)
221-
default InventoryTransactionResult offer(int index, ItemStack stack) {
222-
return this.offer(index, (ItemStackLike) stack);
223-
}
224-
225201
/**
226202
* Adds an ItemStack to the slot at given index.
227203
* Returns a {@link InventoryTransactionResult.Type#SUCCESS} only if the entire {@link ItemStackLike} fits the slot.
@@ -234,14 +210,6 @@ default InventoryTransactionResult offer(int index, ItemStack stack) {
234210
*/
235211
InventoryTransactionResult offer(int index, ItemStackLike stack);
236212

237-
/**
238-
* @deprecated Use {@link #set(int, ItemStackLike)} instead.
239-
*/
240-
@Deprecated(forRemoval = true)
241-
default InventoryTransactionResult set(int index, ItemStack stack) {
242-
return this.set(index, (ItemStackLike) stack);
243-
}
244-
245213
/**
246214
* Adds the ItemStack to the slot at given index overwriting the existing item.
247215
*
@@ -292,14 +260,6 @@ default InventoryTransactionResult set(int index, ItemStack stack) {
292260
*/
293261
int capacity();
294262

295-
/**
296-
* @deprecated Use {@link #contains(ItemStackLike)} instead.
297-
*/
298-
@Deprecated(forRemoval = true)
299-
default boolean contains(ItemStack stack) {
300-
return this.contains((ItemStackLike) stack);
301-
}
302-
303263
/**
304264
* Checks whether the stacks quantity or more of given stack is contained in this Inventory.
305265
* To check if an inventory contains any amount use {@link #containsAny(ItemStackLike)}.
@@ -319,14 +279,6 @@ default boolean contains(ItemStack stack) {
319279
*/
320280
boolean contains(ItemType type);
321281

322-
/**
323-
* @deprecated Use {@link #containsAny(ItemStackLike)} instead.
324-
*/
325-
@Deprecated(forRemoval = true)
326-
default boolean containsAny(ItemStack stack) {
327-
return this.containsAny((ItemStackLike) stack);
328-
}
329-
330282
/**
331283
* Checks whether the given stack is contained in this Inventory.
332284
* The stack size is ignored.

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,6 @@ public interface Slot extends Inventory {
3838
*/
3939
Slot viewedSlot();
4040

41-
/**
42-
* @deprecated Use {@link #set(ItemStackLike)} instead.
43-
*/
44-
@Deprecated(forRemoval = true)
45-
default InventoryTransactionResult set(ItemStack stack) {
46-
return this.set((ItemStackLike) stack);
47-
}
48-
4941
/**
5042
* Adds the ItemStack to this slot overwriting the existing item.
5143
*

0 commit comments

Comments
 (0)