aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/og/net/minecraft/world/entity/projectile/EntityFireball.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/og/net/minecraft/world/entity/projectile/EntityFireball.patch')
-rw-r--r--patch-remap/og/net/minecraft/world/entity/projectile/EntityFireball.patch58
1 files changed, 58 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/world/entity/projectile/EntityFireball.patch b/patch-remap/og/net/minecraft/world/entity/projectile/EntityFireball.patch
new file mode 100644
index 0000000000..7642d2b0c7
--- /dev/null
+++ b/patch-remap/og/net/minecraft/world/entity/projectile/EntityFireball.patch
@@ -0,0 +1,58 @@
+--- a/net/minecraft/world/entity/projectile/EntityFireball.java
++++ b/net/minecraft/world/entity/projectile/EntityFireball.java
+@@ -17,11 +17,15 @@
+ import net.minecraft.world.phys.MovingObjectPosition;
+ import net.minecraft.world.phys.Vec3D;
+
++import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
++
+ public abstract class EntityFireball extends IProjectile {
+
+ public double xPower;
+ public double yPower;
+ public double zPower;
++ public float bukkitYield = 1; // CraftBukkit
++ public boolean isIncendiary = true; // CraftBukkit
+
+ protected EntityFireball(EntityTypes<? extends EntityFireball> entitytypes, World world) {
+ super(entitytypes, world);
+@@ -36,6 +40,12 @@
+ this(entitytypes, world);
+ this.moveTo(d0, d1, d2, this.getYRot(), this.getXRot());
+ this.reapplyPosition();
++ // CraftBukkit start - Added setDirection method
++ this.setDirection(d3, d4, d5);
++ }
++
++ public void setDirection(double d3, double d4, double d5) {
++ // CraftBukkit end
+ double d6 = Math.sqrt(d3 * d3 + d4 * d4 + d5 * d5);
+
+ if (d6 != 0.0D) {
+@@ -86,7 +96,13 @@
+ MovingObjectPosition movingobjectposition = ProjectileHelper.getHitResultOnMoveVector(this, this::canHitEntity, this.getClipType());
+
+ if (movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.MISS) {
+- this.onHit(movingobjectposition);
++ this.preOnHit(movingobjectposition); // CraftBukkit - projectile hit event
++
++ // CraftBukkit start - Fire ProjectileHitEvent
++ if (this.isRemoved()) {
++ CraftEventFactory.callProjectileHitEvent(this, movingobjectposition);
++ }
++ // CraftBukkit end
+ }
+
+ this.checkInsideBlocks();
+@@ -184,6 +200,11 @@
+
+ if (entity != null) {
+ if (!this.level().isClientSide) {
++ // CraftBukkit start
++ if (CraftEventFactory.handleNonLivingEntityDamageEvent(this, damagesource, f, false)) {
++ return false;
++ }
++ // CraftBukkit end
+ Vec3D vec3d = entity.getLookAngle();
+
+ this.setDeltaMovement(vec3d);