Use ? super in Consumer/Predicate API (#9939)
This commit is contained in:
parent
f9938d3949
commit
b37bbcfd98
21 changed files with 240 additions and 277 deletions
|
@ -5,15 +5,15 @@ Subject: [PATCH] Add a consumer parameter to ProjectileSource#launchProjectile
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/projectiles/ProjectileSource.java b/src/main/java/org/bukkit/projectiles/ProjectileSource.java
|
||||
index eabd8b926ec1c934cd7e77b7cc6adfae16771021..5a2dcb1dbd0a875ff9cf5fd01445196a947f2fdc 100644
|
||||
index eabd8b926ec1c934cd7e77b7cc6adfae16771021..96ebd30d339060758e726e9e1e7428d1d0813c17 100644
|
||||
--- a/src/main/java/org/bukkit/projectiles/ProjectileSource.java
|
||||
+++ b/src/main/java/org/bukkit/projectiles/ProjectileSource.java
|
||||
@@ -31,4 +31,24 @@ public interface ProjectileSource {
|
||||
@@ -31,4 +31,23 @@ public interface ProjectileSource {
|
||||
*/
|
||||
@NotNull
|
||||
public <T extends Projectile> T launchProjectile(@NotNull Class<? extends T> projectile, @Nullable Vector velocity);
|
||||
+
|
||||
+ // Paper start
|
||||
+ // Paper start - add consumer to launchProjectile
|
||||
+ /**
|
||||
+ * Launches a {@link Projectile} from the ProjectileSource with an
|
||||
+ * initial velocity, with the supplied function run before the
|
||||
|
@ -29,7 +29,6 @@ index eabd8b926ec1c934cd7e77b7cc6adfae16771021..5a2dcb1dbd0a875ff9cf5fd01445196a
|
|||
+ * @param function the function to be run before the entity is spawned
|
||||
+ * @return the launched projectile
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public <T extends Projectile> T launchProjectile(@NotNull Class<? extends T> projectile, @Nullable Vector velocity, @Nullable java.util.function.Consumer<T> function);
|
||||
+ // Paper end
|
||||
+ <T extends Projectile> @NotNull T launchProjectile(@NotNull Class<? extends T> projectile, @Nullable Vector velocity, java.util.function.@Nullable Consumer<? super T> function);
|
||||
+ // Paper end - add consumer to launchProjectile
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue