mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 03:52:45 +01:00
b2a28c54bb
By: md_5 <git@md-5.net>
38 lines
1.7 KiB
Diff
38 lines
1.7 KiB
Diff
--- a/net/minecraft/world/entity/projectile/EntityFireball.java
|
|
+++ b/net/minecraft/world/entity/projectile/EntityFireball.java
|
|
@@ -18,11 +18,17 @@
|
|
import net.minecraft.world.phys.MovingObjectPosition;
|
|
import net.minecraft.world.phys.Vec3D;
|
|
|
|
+// CraftBukkit start
|
|
+import org.bukkit.event.entity.EntityRemoveEvent;
|
|
+// CraftBukkit end
|
|
+
|
|
public abstract class EntityFireball extends IProjectile {
|
|
|
|
public static final double INITAL_ACCELERATION_POWER = 0.1D;
|
|
public static final double DEFLECTION_SCALE = 0.5D;
|
|
public double accelerationPower;
|
|
+ public float bukkitYield = 1; // CraftBukkit
|
|
+ public boolean isIncendiary = true; // CraftBukkit
|
|
|
|
protected EntityFireball(EntityTypes<? extends EntityFireball> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
@@ -71,7 +77,7 @@
|
|
Entity entity = this.getOwner();
|
|
|
|
if (!this.level().isClientSide && (entity != null && entity.isRemoved() || !this.level().hasChunkAt(this.blockPosition()))) {
|
|
- this.discard();
|
|
+ this.discard(EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
|
|
} else {
|
|
super.tick();
|
|
if (this.shouldBurn()) {
|
|
@@ -81,7 +87,7 @@
|
|
MovingObjectPosition movingobjectposition = ProjectileHelper.getHitResultOnMoveVector(this, this::canHitEntity, this.getClipType());
|
|
|
|
if (movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.MISS) {
|
|
- this.hitTargetOrDeflectSelf(movingobjectposition);
|
|
+ this.preHitTargetOrDeflectSelf(movingobjectposition); // CraftBukkit - projectile hit event
|
|
}
|
|
|
|
this.checkInsideBlocks();
|