Added lenient upper bound to type arguments

This commit is contained in:
Flo0 2024-08-31 17:36:28 +02:00
parent eeb57c5689
commit 34e6477727

View file

@ -152,7 +152,7 @@ public interface Inventory extends Iterable<ItemStack> {
* @param removalStrategy A function that determines how many items should be removed from a slot * @param removalStrategy A function that determines how many items should be removed from a slot
* @return An int representing the amount of items removed from the inventory * @return An int representing the amount of items removed from the inventory
*/ */
public int removeItems(@NotNull BiFunction<ItemStack, Integer, Integer> removalStrategy); public int removeItems(@NotNull BiFunction<? super ItemStack, Integer, Integer> removalStrategy);
/** /**
* Removes ItemStacks from the inventory, based on the given filter. * Removes ItemStacks from the inventory, based on the given filter.
@ -170,7 +170,7 @@ public interface Inventory extends Iterable<ItemStack> {
* will be removed * will be removed
* @return An int representing the amount of items removed * @return An int representing the amount of items removed
*/ */
public int removeItems(int amount, @NotNull Predicate<ItemStack> filter); public int removeItems(int amount, @NotNull Predicate<? super ItemStack> filter);
/** /**
* Removes ItemStacks from the inventory, based on the given filter. * Removes ItemStacks from the inventory, based on the given filter.
@ -187,7 +187,7 @@ public interface Inventory extends Iterable<ItemStack> {
* will be removed * will be removed
* @return An int representing the amount of items removed * @return An int representing the amount of items removed
*/ */
public int removeItems(@NotNull Predicate<ItemStack> filter); public int removeItems(@NotNull Predicate<? super ItemStack> filter);
/** /**
* Returns all ItemStacks from the inventory * Returns all ItemStacks from the inventory