Deprecate ProjectileCollideEvent (#8678)

replaced by ProjectileHitEvent
propagated the cancellation of the legacy event
to the modern one
This commit is contained in:
Jake Potrebic 2022-12-22 21:20:44 -08:00 committed by GitHub
parent e05ba9866d
commit 8e83c3c7b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 45 additions and 106 deletions

View file

@ -3,13 +3,14 @@ From: Techcable <Techcable@outlook.com>
Date: Fri, 16 Dec 2016 21:25:39 -0600
Subject: [PATCH] Add ProjectileCollideEvent
Now deprecated and replaced with ProjectileHitEvent
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/ProjectileCollideEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/ProjectileCollideEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..453663893021768ae21d4980ce17ffba55d9e129
index 0000000000000000000000000000000000000000..6ae2bc3d952d34f298220738856024e0b6594199
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/entity/ProjectileCollideEvent.java
@@ -0,0 +1,67 @@
@@ -0,0 +1,69 @@
+package com.destroystokyo.paper.event.entity;
+
+import org.bukkit.entity.Entity;
@ -20,10 +21,12 @@ index 0000000000000000000000000000000000000000..453663893021768ae21d4980ce17ffba
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Called when an projectile collides with an entity
+ * Called when a projectile collides with an entity
+ * <p>
+ * This event is called <b>before</b> {@link org.bukkit.event.entity.EntityDamageByEntityEvent}, and cancelling it will allow the projectile to continue flying
+ * @deprecated Deprecated, use {@link org.bukkit.event.entity.ProjectileHitEvent} and check if there is a hit entity
+ */
+@Deprecated
+public class ProjectileCollideEvent extends EntityEvent implements Cancellable {
+ @NotNull private final Entity collidedWith;
+