SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, #1008: Add EntityRemoveEvent

By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
CraftBukkit/Spigot
2024-02-21 20:55:34 +11:00
parent 6dc11b5d28
commit 64cd2b148a
81 changed files with 2037 additions and 475 deletions

View File

@@ -1,6 +1,17 @@
--- a/net/minecraft/world/entity/projectile/EntityThrownExpBottle.java
+++ b/net/minecraft/world/entity/projectile/EntityThrownExpBottle.java
@@ -39,9 +39,18 @@
@@ -11,6 +11,10 @@
import net.minecraft.world.level.World;
import net.minecraft.world.phys.MovingObjectPosition;
+// CraftBukkit start
+import org.bukkit.event.entity.EntityRemoveEvent;
+// CraftBukkit end
+
public class EntityThrownExpBottle extends EntityProjectileThrowable {
public EntityThrownExpBottle(EntityTypes<? extends EntityThrownExpBottle> entitytypes, World world) {
@@ -39,11 +43,20 @@
protected void onHit(MovingObjectPosition movingobjectposition) {
super.onHit(movingobjectposition);
if (this.level() instanceof WorldServer) {
@@ -18,5 +29,8 @@
+ // CraftBukkit end
+
EntityExperienceOrb.award((WorldServer) this.level(), this.position(), i);
this.discard();
- this.discard();
+ this.discard(EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause
}
}