mirror of
https://github.com/PaperMC/Paper.git
synced 2025-09-01 21:03:52 -07:00
#935: Change Consumer and Predicates to super
By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
@@ -1937,7 +1937,7 @@ public final class Bukkit {
|
|||||||
* @return new data instance
|
* @return new data instance
|
||||||
*/
|
*/
|
||||||
@NotNull
|
@NotNull
|
||||||
public static BlockData createBlockData(@NotNull Material material, @Nullable Consumer<BlockData> consumer) {
|
public static BlockData createBlockData(@NotNull Material material, @Nullable Consumer<? super BlockData> consumer) {
|
||||||
return server.createBlockData(material, consumer);
|
return server.createBlockData(material, consumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -4504,7 +4504,7 @@ public enum Material implements Keyed, Translatable {
|
|||||||
* @return new data instance
|
* @return new data instance
|
||||||
*/
|
*/
|
||||||
@NotNull
|
@NotNull
|
||||||
public BlockData createBlockData(@Nullable Consumer<BlockData> consumer) {
|
public BlockData createBlockData(@Nullable Consumer<? super BlockData> consumer) {
|
||||||
return Bukkit.createBlockData(this, consumer);
|
return Bukkit.createBlockData(this, consumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -182,7 +182,7 @@ public interface RegionAccessor {
|
|||||||
* @param stateConsumer The consumer which should get called for every block which gets changed
|
* @param stateConsumer The consumer which should get called for every block which gets changed
|
||||||
* @return true if the tree was created successfully, otherwise false
|
* @return true if the tree was created successfully, otherwise false
|
||||||
*/
|
*/
|
||||||
boolean generateTree(@NotNull Location location, @NotNull Random random, @NotNull TreeType type, @Nullable Consumer<BlockState> stateConsumer);
|
boolean generateTree(@NotNull Location location, @NotNull Random random, @NotNull TreeType type, @Nullable Consumer<? super BlockState> stateConsumer);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a tree at the given {@link Location}
|
* Creates a tree at the given {@link Location}
|
||||||
@@ -202,7 +202,7 @@ public interface RegionAccessor {
|
|||||||
* @param statePredicate The predicate which should get used to test if a block should be set or not.
|
* @param statePredicate The predicate which should get used to test if a block should be set or not.
|
||||||
* @return true if the tree was created successfully, otherwise false
|
* @return true if the tree was created successfully, otherwise false
|
||||||
*/
|
*/
|
||||||
boolean generateTree(@NotNull Location location, @NotNull Random random, @NotNull TreeType type, @Nullable Predicate<BlockState> statePredicate);
|
boolean generateTree(@NotNull Location location, @NotNull Random random, @NotNull TreeType type, @Nullable Predicate<? super BlockState> statePredicate);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a entity at the given {@link Location}
|
* Creates a entity at the given {@link Location}
|
||||||
@@ -309,7 +309,7 @@ public interface RegionAccessor {
|
|||||||
* {@link Entity} requested cannot be spawned
|
* {@link Entity} requested cannot be spawned
|
||||||
*/
|
*/
|
||||||
@NotNull
|
@NotNull
|
||||||
<T extends Entity> T spawn(@NotNull Location location, @NotNull Class<T> clazz, @Nullable Consumer<T> function) throws IllegalArgumentException;
|
<T extends Entity> T spawn(@NotNull Location location, @NotNull Class<T> clazz, @Nullable Consumer<? super T> function) throws IllegalArgumentException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new entity at the given {@link Location} with the supplied
|
* Creates a new entity at the given {@link Location} with the supplied
|
||||||
@@ -347,7 +347,7 @@ public interface RegionAccessor {
|
|||||||
* @throws IllegalArgumentException if either the world or clazz parameter are null.
|
* @throws IllegalArgumentException if either the world or clazz parameter are null.
|
||||||
*/
|
*/
|
||||||
@NotNull
|
@NotNull
|
||||||
public <T extends Entity> T spawn(@NotNull Location location, @NotNull Class<T> clazz, boolean randomizeData, @Nullable Consumer<T> function) throws IllegalArgumentException;
|
public <T extends Entity> T spawn(@NotNull Location location, @NotNull Class<T> clazz, boolean randomizeData, @Nullable Consumer<? super T> function) throws IllegalArgumentException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the highest non-empty (impassable) coordinate at the given
|
* Gets the highest non-empty (impassable) coordinate at the given
|
||||||
|
@@ -1649,7 +1649,7 @@ public interface Server extends PluginMessageRecipient {
|
|||||||
* @return new data instance
|
* @return new data instance
|
||||||
*/
|
*/
|
||||||
@NotNull
|
@NotNull
|
||||||
public BlockData createBlockData(@NotNull Material material, @Nullable Consumer<BlockData> consumer);
|
public BlockData createBlockData(@NotNull Material material, @Nullable Consumer<? super BlockData> consumer);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new {@link BlockData} instance with material and properties
|
* Creates a new {@link BlockData} instance with material and properties
|
||||||
|
@@ -454,7 +454,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
|||||||
* @return ItemDrop entity created as a result of this method
|
* @return ItemDrop entity created as a result of this method
|
||||||
*/
|
*/
|
||||||
@NotNull
|
@NotNull
|
||||||
public Item dropItem(@NotNull Location location, @NotNull ItemStack item, @Nullable Consumer<Item> function);
|
public Item dropItem(@NotNull Location location, @NotNull ItemStack item, @Nullable Consumer<? super Item> function);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Drops an item at the specified {@link Location} with a random offset
|
* Drops an item at the specified {@link Location} with a random offset
|
||||||
@@ -476,7 +476,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
|||||||
* @return ItemDrop entity created as a result of this method
|
* @return ItemDrop entity created as a result of this method
|
||||||
*/
|
*/
|
||||||
@NotNull
|
@NotNull
|
||||||
public Item dropItemNaturally(@NotNull Location location, @NotNull ItemStack item, @Nullable Consumer<Item> function);
|
public Item dropItemNaturally(@NotNull Location location, @NotNull ItemStack item, @Nullable Consumer<? super Item> function);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an {@link Arrow} entity at the given {@link Location}
|
* Creates an {@link Arrow} entity at the given {@link Location}
|
||||||
@@ -642,7 +642,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
|||||||
* non-null collection.
|
* non-null collection.
|
||||||
*/
|
*/
|
||||||
@NotNull
|
@NotNull
|
||||||
public Collection<Entity> getNearbyEntities(@NotNull Location location, double x, double y, double z, @Nullable Predicate<Entity> filter);
|
public Collection<Entity> getNearbyEntities(@NotNull Location location, double x, double y, double z, @Nullable Predicate<? super Entity> filter);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of entities within the given bounding box.
|
* Returns a list of entities within the given bounding box.
|
||||||
@@ -672,7 +672,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
|||||||
* be a non-null collection
|
* be a non-null collection
|
||||||
*/
|
*/
|
||||||
@NotNull
|
@NotNull
|
||||||
public Collection<Entity> getNearbyEntities(@NotNull BoundingBox boundingBox, @Nullable Predicate<Entity> filter);
|
public Collection<Entity> getNearbyEntities(@NotNull BoundingBox boundingBox, @Nullable Predicate<? super Entity> filter);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Performs a ray trace that checks for entity collisions.
|
* Performs a ray trace that checks for entity collisions.
|
||||||
@@ -727,7 +727,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
|||||||
* @see #rayTraceEntities(Location, Vector, double, double, Predicate)
|
* @see #rayTraceEntities(Location, Vector, double, double, Predicate)
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
public RayTraceResult rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance, @Nullable Predicate<Entity> filter);
|
public RayTraceResult rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance, @Nullable Predicate<? super Entity> filter);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Performs a ray trace that checks for entity collisions.
|
* Performs a ray trace that checks for entity collisions.
|
||||||
@@ -747,7 +747,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
|||||||
* is no hit
|
* is no hit
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
public RayTraceResult rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance, double raySize, @Nullable Predicate<Entity> filter);
|
public RayTraceResult rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance, double raySize, @Nullable Predicate<? super Entity> filter);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Performs a ray trace that checks for block collisions using the blocks'
|
* Performs a ray trace that checks for block collisions using the blocks'
|
||||||
@@ -843,7 +843,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
|||||||
* entity, or <code>null</code> if there is no hit
|
* entity, or <code>null</code> if there is no hit
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
public RayTraceResult rayTrace(@NotNull Location start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks, double raySize, @Nullable Predicate<Entity> filter);
|
public RayTraceResult rayTrace(@NotNull Location start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks, double raySize, @Nullable Predicate<? super Entity> filter);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the default spawn {@link Location} of this world
|
* Gets the default spawn {@link Location} of this world
|
||||||
|
@@ -227,7 +227,7 @@ public interface BukkitScheduler {
|
|||||||
* @throws IllegalArgumentException if plugin is null
|
* @throws IllegalArgumentException if plugin is null
|
||||||
* @throws IllegalArgumentException if task is null
|
* @throws IllegalArgumentException if task is null
|
||||||
*/
|
*/
|
||||||
public void runTask(@NotNull Plugin plugin, @NotNull Consumer<BukkitTask> task) throws IllegalArgumentException;
|
public void runTask(@NotNull Plugin plugin, @NotNull Consumer<? super BukkitTask> task) throws IllegalArgumentException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param plugin the reference to the plugin scheduling task
|
* @param plugin the reference to the plugin scheduling task
|
||||||
@@ -267,7 +267,7 @@ public interface BukkitScheduler {
|
|||||||
* @throws IllegalArgumentException if plugin is null
|
* @throws IllegalArgumentException if plugin is null
|
||||||
* @throws IllegalArgumentException if task is null
|
* @throws IllegalArgumentException if task is null
|
||||||
*/
|
*/
|
||||||
public void runTaskAsynchronously(@NotNull Plugin plugin, @NotNull Consumer<BukkitTask> task) throws IllegalArgumentException;
|
public void runTaskAsynchronously(@NotNull Plugin plugin, @NotNull Consumer<? super BukkitTask> task) throws IllegalArgumentException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param plugin the reference to the plugin scheduling task
|
* @param plugin the reference to the plugin scheduling task
|
||||||
@@ -305,7 +305,7 @@ public interface BukkitScheduler {
|
|||||||
* @throws IllegalArgumentException if plugin is null
|
* @throws IllegalArgumentException if plugin is null
|
||||||
* @throws IllegalArgumentException if task is null
|
* @throws IllegalArgumentException if task is null
|
||||||
*/
|
*/
|
||||||
public void runTaskLater(@NotNull Plugin plugin, @NotNull Consumer<BukkitTask> task, long delay) throws IllegalArgumentException;
|
public void runTaskLater(@NotNull Plugin plugin, @NotNull Consumer<? super BukkitTask> task, long delay) throws IllegalArgumentException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param plugin the reference to the plugin scheduling task
|
* @param plugin the reference to the plugin scheduling task
|
||||||
@@ -350,7 +350,7 @@ public interface BukkitScheduler {
|
|||||||
* @throws IllegalArgumentException if plugin is null
|
* @throws IllegalArgumentException if plugin is null
|
||||||
* @throws IllegalArgumentException if task is null
|
* @throws IllegalArgumentException if task is null
|
||||||
*/
|
*/
|
||||||
public void runTaskLaterAsynchronously(@NotNull Plugin plugin, @NotNull Consumer<BukkitTask> task, long delay) throws IllegalArgumentException;
|
public void runTaskLaterAsynchronously(@NotNull Plugin plugin, @NotNull Consumer<? super BukkitTask> task, long delay) throws IllegalArgumentException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param plugin the reference to the plugin scheduling task
|
* @param plugin the reference to the plugin scheduling task
|
||||||
@@ -391,7 +391,7 @@ public interface BukkitScheduler {
|
|||||||
* @throws IllegalArgumentException if plugin is null
|
* @throws IllegalArgumentException if plugin is null
|
||||||
* @throws IllegalArgumentException if task is null
|
* @throws IllegalArgumentException if task is null
|
||||||
*/
|
*/
|
||||||
public void runTaskTimer(@NotNull Plugin plugin, @NotNull Consumer<BukkitTask> task, long delay, long period) throws IllegalArgumentException;
|
public void runTaskTimer(@NotNull Plugin plugin, @NotNull Consumer<? super BukkitTask> task, long delay, long period) throws IllegalArgumentException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param plugin the reference to the plugin scheduling task
|
* @param plugin the reference to the plugin scheduling task
|
||||||
@@ -441,7 +441,7 @@ public interface BukkitScheduler {
|
|||||||
* @throws IllegalArgumentException if plugin is null
|
* @throws IllegalArgumentException if plugin is null
|
||||||
* @throws IllegalArgumentException if task is null
|
* @throws IllegalArgumentException if task is null
|
||||||
*/
|
*/
|
||||||
public void runTaskTimerAsynchronously(@NotNull Plugin plugin, @NotNull Consumer<BukkitTask> task, long delay, long period) throws IllegalArgumentException;
|
public void runTaskTimerAsynchronously(@NotNull Plugin plugin, @NotNull Consumer<? super BukkitTask> task, long delay, long period) throws IllegalArgumentException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param plugin the reference to the plugin scheduling task
|
* @param plugin the reference to the plugin scheduling task
|
||||||
|
Reference in New Issue
Block a user