2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/entity/projectile/EntityFireball.java
|
|
|
|
+++ b/net/minecraft/world/entity/projectile/EntityFireball.java
|
2024-06-13 17:05:00 +02:00
|
|
|
@@ -18,11 +18,18 @@
|
2021-03-15 23:00:00 +01:00
|
|
|
import net.minecraft.world.phys.MovingObjectPosition;
|
|
|
|
import net.minecraft.world.phys.Vec3D;
|
2014-11-25 22:32:16 +01:00
|
|
|
|
2024-02-21 10:55:34 +01:00
|
|
|
+// CraftBukkit start
|
|
|
|
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
|
|
|
+import org.bukkit.event.entity.EntityRemoveEvent;
|
|
|
|
+// CraftBukkit end
|
2014-11-25 22:32:16 +01:00
|
|
|
+
|
2020-06-25 02:00:00 +02:00
|
|
|
public abstract class EntityFireball extends IProjectile {
|
2014-11-25 22:32:16 +01:00
|
|
|
|
2024-06-13 17:05:00 +02:00
|
|
|
public static final double INITAL_ACCELERATION_POWER = 0.1D;
|
|
|
|
public static final double DEFLECTION_SCALE = 0.5D;
|
|
|
|
public double accelerationPower;
|
2014-11-25 22:32:16 +01:00
|
|
|
+ public float bukkitYield = 1; // CraftBukkit
|
|
|
|
+ public boolean isIncendiary = true; // CraftBukkit
|
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
protected EntityFireball(EntityTypes<? extends EntityFireball> entitytypes, World world) {
|
2018-07-15 02:00:00 +02:00
|
|
|
super(entitytypes, world);
|
2024-06-13 17:05:00 +02:00
|
|
|
@@ -71,7 +78,7 @@
|
2024-02-21 10:55:34 +01:00
|
|
|
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()) {
|
2024-06-13 17:05:00 +02:00
|
|
|
@@ -81,7 +88,13 @@
|
2023-12-05 17:40:00 +01:00
|
|
|
MovingObjectPosition movingobjectposition = ProjectileHelper.getHitResultOnMoveVector(this, this::canHitEntity, this.getClipType());
|
2014-11-25 22:32:16 +01:00
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
if (movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.MISS) {
|
2024-04-23 17:15:00 +02:00
|
|
|
- this.hitTargetOrDeflectSelf(movingobjectposition);
|
|
|
|
+ this.preHitTargetOrDeflectSelf(movingobjectposition); // CraftBukkit - projectile hit event
|
2014-11-25 22:32:16 +01:00
|
|
|
+
|
|
|
|
+ // CraftBukkit start - Fire ProjectileHitEvent
|
2021-06-11 07:00:00 +02:00
|
|
|
+ if (this.isRemoved()) {
|
2016-11-28 02:47:01 +01:00
|
|
|
+ CraftEventFactory.callProjectileHitEvent(this, movingobjectposition);
|
2014-11-25 22:32:16 +01:00
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
}
|
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
this.checkInsideBlocks();
|