SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, #1008: Add EntityRemoveEvent
By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
@@ -1,15 +1,18 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntitySmallFireball.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntitySmallFireball.java
|
||||
@@ -13,6 +13,8 @@
|
||||
@@ -13,6 +13,11 @@
|
||||
import net.minecraft.world.phys.MovingObjectPositionBlock;
|
||||
import net.minecraft.world.phys.MovingObjectPositionEntity;
|
||||
|
||||
+import org.bukkit.event.entity.EntityCombustByEntityEvent; // CraftBukkit
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.event.entity.EntityCombustByEntityEvent;
|
||||
+import org.bukkit.event.entity.EntityRemoveEvent;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class EntitySmallFireball extends EntityFireballFireball {
|
||||
|
||||
public EntitySmallFireball(EntityTypes<? extends EntitySmallFireball> entitytypes, World world) {
|
||||
@@ -21,6 +23,11 @@
|
||||
@@ -21,6 +26,11 @@
|
||||
|
||||
public EntitySmallFireball(World world, EntityLiving entityliving, double d0, double d1, double d2) {
|
||||
super(EntityTypes.SMALL_FIREBALL, entityliving, d0, d1, d2, world);
|
||||
@@ -21,7 +24,7 @@
|
||||
}
|
||||
|
||||
public EntitySmallFireball(World world, double d0, double d1, double d2, double d3, double d4, double d5) {
|
||||
@@ -35,7 +42,14 @@
|
||||
@@ -35,7 +45,14 @@
|
||||
Entity entity1 = this.getOwner();
|
||||
int i = entity.getRemainingFireTicks();
|
||||
|
||||
@@ -37,7 +40,7 @@
|
||||
if (!entity.hurt(this.damageSources().fireball(this, entity1), 5.0F)) {
|
||||
entity.setRemainingFireTicks(i);
|
||||
} else if (entity1 instanceof EntityLiving) {
|
||||
@@ -51,10 +65,10 @@
|
||||
@@ -51,10 +68,10 @@
|
||||
if (!this.level().isClientSide) {
|
||||
Entity entity = this.getOwner();
|
||||
|
||||
@@ -50,3 +53,12 @@
|
||||
this.level().setBlockAndUpdate(blockposition, BlockFireAbstract.getState(this.level(), blockposition));
|
||||
}
|
||||
}
|
||||
@@ -66,7 +83,7 @@
|
||||
protected void onHit(MovingObjectPosition movingobjectposition) {
|
||||
super.onHit(movingobjectposition);
|
||||
if (!this.level().isClientSide) {
|
||||
- this.discard();
|
||||
+ this.discard(EntityRemoveEvent.Cause.HIT); // CraftBukkit - add Bukkit remove cause
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user