2021-03-16 09:00:00 +11:00
|
|
|
--- a/net/minecraft/world/entity/projectile/EntityFireball.java
|
|
|
|
+++ b/net/minecraft/world/entity/projectile/EntityFireball.java
|
2021-06-11 15:00:00 +10:00
|
|
|
@@ -14,11 +14,15 @@
|
2021-03-16 09:00:00 +11:00
|
|
|
import net.minecraft.world.phys.MovingObjectPosition;
|
|
|
|
import net.minecraft.world.phys.Vec3D;
|
2014-11-26 08:32:16 +11:00
|
|
|
|
|
|
|
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
|
|
|
+
|
2020-06-25 10:00:00 +10:00
|
|
|
public abstract class EntityFireball extends IProjectile {
|
2014-11-26 08:32:16 +11:00
|
|
|
|
2021-06-11 15:00:00 +10:00
|
|
|
public double xPower;
|
|
|
|
public double yPower;
|
|
|
|
public double zPower;
|
2014-11-26 08:32:16 +11:00
|
|
|
+ public float bukkitYield = 1; // CraftBukkit
|
|
|
|
+ public boolean isIncendiary = true; // CraftBukkit
|
|
|
|
|
2019-04-23 12:00:00 +10:00
|
|
|
protected EntityFireball(EntityTypes<? extends EntityFireball> entitytypes, World world) {
|
2018-07-15 10:00:00 +10:00
|
|
|
super(entitytypes, world);
|
2021-06-11 15:00:00 +10:00
|
|
|
@@ -28,6 +32,12 @@
|
2019-04-23 12:00:00 +10:00
|
|
|
this(entitytypes, world);
|
2021-06-11 15:00:00 +10:00
|
|
|
this.setPositionRotation(d0, d1, d2, this.getYRot(), this.getXRot());
|
|
|
|
this.ah();
|
2014-11-26 08:32:16 +11:00
|
|
|
+ // CraftBukkit start - Added setDirection method
|
2020-06-25 10:00:00 +10:00
|
|
|
+ this.setDirection(d3, d4, d5);
|
2014-11-26 08:32:16 +11:00
|
|
|
+ }
|
|
|
|
+
|
2020-06-25 10:00:00 +10:00
|
|
|
+ public void setDirection(double d3, double d4, double d5) {
|
2014-11-26 08:32:16 +11:00
|
|
|
+ // CraftBukkit end
|
2021-06-11 15:00:00 +10:00
|
|
|
double d6 = Math.sqrt(d3 * d3 + d4 * d4 + d5 * d5);
|
2020-06-25 10:00:00 +10:00
|
|
|
|
|
|
|
if (d6 != 0.0D) {
|
2021-06-11 15:00:00 +10:00
|
|
|
@@ -74,7 +84,13 @@
|
2021-05-09 16:51:44 +10:00
|
|
|
MovingObjectPosition movingobjectposition = ProjectileHelper.a((Entity) this, this::a);
|
2014-11-26 08:32:16 +11:00
|
|
|
|
2019-04-23 12:00:00 +10:00
|
|
|
if (movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.MISS) {
|
2021-05-09 16:51:44 +10:00
|
|
|
- this.a(movingobjectposition);
|
|
|
|
+ this.preOnHit(movingobjectposition); // CraftBukkit - projectile hit event
|
2014-11-26 08:32:16 +11:00
|
|
|
+
|
|
|
|
+ // CraftBukkit start - Fire ProjectileHitEvent
|
2021-06-11 15:00:00 +10:00
|
|
|
+ if (this.isRemoved()) {
|
2016-11-28 12:47:01 +11:00
|
|
|
+ CraftEventFactory.callProjectileHitEvent(this, movingobjectposition);
|
2014-11-26 08:32:16 +11:00
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
}
|
|
|
|
|
2020-08-12 07:00:00 +10:00
|
|
|
this.checkBlockCollisions();
|
2021-06-11 15:00:00 +10:00
|
|
|
@@ -159,6 +175,11 @@
|
2020-06-25 10:00:00 +10:00
|
|
|
Entity entity = damagesource.getEntity();
|
|
|
|
|
|
|
|
if (entity != null) {
|
2014-11-26 08:32:16 +11:00
|
|
|
+ // CraftBukkit start
|
2021-04-30 17:53:58 +10:00
|
|
|
+ if (CraftEventFactory.handleNonLivingEntityDamageEvent(this, damagesource, f, false)) {
|
2014-11-26 08:32:16 +11:00
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2020-06-25 10:00:00 +10:00
|
|
|
Vec3D vec3d = entity.getLookDirection();
|
2014-11-26 08:32:16 +11:00
|
|
|
|
2019-04-23 12:00:00 +10:00
|
|
|
this.setMot(vec3d);
|