From 72d257230437124156ab463c6c4199737c2d2976 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Tue, 14 Nov 2023 19:50:23 +1300 Subject: [PATCH] #935: Change Consumer and Predicates to super By: DerFrZocker --- paper-api/src/main/java/org/bukkit/Bukkit.java | 2 +- paper-api/src/main/java/org/bukkit/Material.java | 2 +- .../src/main/java/org/bukkit/RegionAccessor.java | 8 ++++---- paper-api/src/main/java/org/bukkit/Server.java | 2 +- paper-api/src/main/java/org/bukkit/World.java | 14 +++++++------- .../java/org/bukkit/scheduler/BukkitScheduler.java | 12 ++++++------ 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/paper-api/src/main/java/org/bukkit/Bukkit.java b/paper-api/src/main/java/org/bukkit/Bukkit.java index b9c181540..001703ba1 100644 --- a/paper-api/src/main/java/org/bukkit/Bukkit.java +++ b/paper-api/src/main/java/org/bukkit/Bukkit.java @@ -1937,7 +1937,7 @@ public final class Bukkit { * @return new data instance */ @NotNull - public static BlockData createBlockData(@NotNull Material material, @Nullable Consumer consumer) { + public static BlockData createBlockData(@NotNull Material material, @Nullable Consumer consumer) { return server.createBlockData(material, consumer); } diff --git a/paper-api/src/main/java/org/bukkit/Material.java b/paper-api/src/main/java/org/bukkit/Material.java index 7ed67f356..f06e06d82 100644 --- a/paper-api/src/main/java/org/bukkit/Material.java +++ b/paper-api/src/main/java/org/bukkit/Material.java @@ -4504,7 +4504,7 @@ public enum Material implements Keyed, Translatable { * @return new data instance */ @NotNull - public BlockData createBlockData(@Nullable Consumer consumer) { + public BlockData createBlockData(@Nullable Consumer consumer) { return Bukkit.createBlockData(this, consumer); } diff --git a/paper-api/src/main/java/org/bukkit/RegionAccessor.java b/paper-api/src/main/java/org/bukkit/RegionAccessor.java index 02de62c08..369b95b15 100644 --- a/paper-api/src/main/java/org/bukkit/RegionAccessor.java +++ b/paper-api/src/main/java/org/bukkit/RegionAccessor.java @@ -182,7 +182,7 @@ public interface RegionAccessor { * @param stateConsumer The consumer which should get called for every block which gets changed * @return true if the tree was created successfully, otherwise false */ - boolean generateTree(@NotNull Location location, @NotNull Random random, @NotNull TreeType type, @Nullable Consumer stateConsumer); + boolean generateTree(@NotNull Location location, @NotNull Random random, @NotNull TreeType type, @Nullable Consumer stateConsumer); /** * 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. * @return true if the tree was created successfully, otherwise false */ - boolean generateTree(@NotNull Location location, @NotNull Random random, @NotNull TreeType type, @Nullable Predicate statePredicate); + boolean generateTree(@NotNull Location location, @NotNull Random random, @NotNull TreeType type, @Nullable Predicate statePredicate); /** * Creates a entity at the given {@link Location} @@ -309,7 +309,7 @@ public interface RegionAccessor { * {@link Entity} requested cannot be spawned */ @NotNull - T spawn(@NotNull Location location, @NotNull Class clazz, @Nullable Consumer function) throws IllegalArgumentException; + T spawn(@NotNull Location location, @NotNull Class clazz, @Nullable Consumer function) throws IllegalArgumentException; /** * 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. */ @NotNull - public T spawn(@NotNull Location location, @NotNull Class clazz, boolean randomizeData, @Nullable Consumer function) throws IllegalArgumentException; + public T spawn(@NotNull Location location, @NotNull Class clazz, boolean randomizeData, @Nullable Consumer function) throws IllegalArgumentException; /** * Gets the highest non-empty (impassable) coordinate at the given diff --git a/paper-api/src/main/java/org/bukkit/Server.java b/paper-api/src/main/java/org/bukkit/Server.java index e033b5753..130c169fb 100644 --- a/paper-api/src/main/java/org/bukkit/Server.java +++ b/paper-api/src/main/java/org/bukkit/Server.java @@ -1649,7 +1649,7 @@ public interface Server extends PluginMessageRecipient { * @return new data instance */ @NotNull - public BlockData createBlockData(@NotNull Material material, @Nullable Consumer consumer); + public BlockData createBlockData(@NotNull Material material, @Nullable Consumer consumer); /** * Creates a new {@link BlockData} instance with material and properties diff --git a/paper-api/src/main/java/org/bukkit/World.java b/paper-api/src/main/java/org/bukkit/World.java index aecb77d0a..682854c03 100644 --- a/paper-api/src/main/java/org/bukkit/World.java +++ b/paper-api/src/main/java/org/bukkit/World.java @@ -454,7 +454,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient * @return ItemDrop entity created as a result of this method */ @NotNull - public Item dropItem(@NotNull Location location, @NotNull ItemStack item, @Nullable Consumer function); + public Item dropItem(@NotNull Location location, @NotNull ItemStack item, @Nullable Consumer function); /** * 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 */ @NotNull - public Item dropItemNaturally(@NotNull Location location, @NotNull ItemStack item, @Nullable Consumer function); + public Item dropItemNaturally(@NotNull Location location, @NotNull ItemStack item, @Nullable Consumer function); /** * Creates an {@link Arrow} entity at the given {@link Location} @@ -642,7 +642,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient * non-null collection. */ @NotNull - public Collection getNearbyEntities(@NotNull Location location, double x, double y, double z, @Nullable Predicate filter); + public Collection getNearbyEntities(@NotNull Location location, double x, double y, double z, @Nullable Predicate filter); /** * 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 */ @NotNull - public Collection getNearbyEntities(@NotNull BoundingBox boundingBox, @Nullable Predicate filter); + public Collection getNearbyEntities(@NotNull BoundingBox boundingBox, @Nullable Predicate filter); /** * 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) */ @Nullable - public RayTraceResult rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance, @Nullable Predicate filter); + public RayTraceResult rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance, @Nullable Predicate filter); /** * Performs a ray trace that checks for entity collisions. @@ -747,7 +747,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient * is no hit */ @Nullable - public RayTraceResult rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance, double raySize, @Nullable Predicate filter); + public RayTraceResult rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance, double raySize, @Nullable Predicate filter); /** * 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 null if there is no hit */ @Nullable - public RayTraceResult rayTrace(@NotNull Location start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks, double raySize, @Nullable Predicate filter); + public RayTraceResult rayTrace(@NotNull Location start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks, double raySize, @Nullable Predicate filter); /** * Gets the default spawn {@link Location} of this world diff --git a/paper-api/src/main/java/org/bukkit/scheduler/BukkitScheduler.java b/paper-api/src/main/java/org/bukkit/scheduler/BukkitScheduler.java index 5aefb7f2d..0368e9125 100644 --- a/paper-api/src/main/java/org/bukkit/scheduler/BukkitScheduler.java +++ b/paper-api/src/main/java/org/bukkit/scheduler/BukkitScheduler.java @@ -227,7 +227,7 @@ public interface BukkitScheduler { * @throws IllegalArgumentException if plugin is null * @throws IllegalArgumentException if task is null */ - public void runTask(@NotNull Plugin plugin, @NotNull Consumer task) throws IllegalArgumentException; + public void runTask(@NotNull Plugin plugin, @NotNull Consumer task) throws IllegalArgumentException; /** * @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 task is null */ - public void runTaskAsynchronously(@NotNull Plugin plugin, @NotNull Consumer task) throws IllegalArgumentException; + public void runTaskAsynchronously(@NotNull Plugin plugin, @NotNull Consumer task) throws IllegalArgumentException; /** * @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 task is null */ - public void runTaskLater(@NotNull Plugin plugin, @NotNull Consumer task, long delay) throws IllegalArgumentException; + public void runTaskLater(@NotNull Plugin plugin, @NotNull Consumer task, long delay) throws IllegalArgumentException; /** * @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 task is null */ - public void runTaskLaterAsynchronously(@NotNull Plugin plugin, @NotNull Consumer task, long delay) throws IllegalArgumentException; + public void runTaskLaterAsynchronously(@NotNull Plugin plugin, @NotNull Consumer task, long delay) throws IllegalArgumentException; /** * @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 task is null */ - public void runTaskTimer(@NotNull Plugin plugin, @NotNull Consumer task, long delay, long period) throws IllegalArgumentException; + public void runTaskTimer(@NotNull Plugin plugin, @NotNull Consumer task, long delay, long period) throws IllegalArgumentException; /** * @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 task is null */ - public void runTaskTimerAsynchronously(@NotNull Plugin plugin, @NotNull Consumer task, long delay, long period) throws IllegalArgumentException; + public void runTaskTimerAsynchronously(@NotNull Plugin plugin, @NotNull Consumer task, long delay, long period) throws IllegalArgumentException; /** * @param plugin the reference to the plugin scheduling task