@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/projectile/EntityFireball.java
|
||||
+++ b/net/minecraft/world/entity/projectile/EntityFireball.java
|
||||
@@ -17,11 +17,18 @@
|
||||
@@ -18,6 +18,11 @@
|
||||
import net.minecraft.world.phys.MovingObjectPosition;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
+
|
||||
public abstract class EntityFireball extends IProjectile {
|
||||
|
||||
public static final double ATTACK_DEFLECTION_SCALE = 0.1D;
|
||||
@@ -25,6 +30,8 @@
|
||||
public double xPower;
|
||||
public double yPower;
|
||||
public double zPower;
|
||||
@@ -19,20 +21,7 @@
|
||||
|
||||
protected EntityFireball(EntityTypes<? extends EntityFireball> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@@ -36,6 +43,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) {
|
||||
@@ -76,7 +89,7 @@
|
||||
@@ -72,7 +79,7 @@
|
||||
Entity entity = this.getOwner();
|
||||
|
||||
if (!this.level().isClientSide && (entity != null && entity.isRemoved() || !this.level().hasChunkAt(this.blockPosition()))) {
|
||||
@@ -41,12 +30,12 @@
|
||||
} else {
|
||||
super.tick();
|
||||
if (this.shouldBurn()) {
|
||||
@@ -86,7 +99,13 @@
|
||||
@@ -82,7 +89,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
|
||||
- this.hitTargetOrDeflectSelf(movingobjectposition);
|
||||
+ this.preHitTargetOrDeflectSelf(movingobjectposition); // CraftBukkit - projectile hit event
|
||||
+
|
||||
+ // CraftBukkit start - Fire ProjectileHitEvent
|
||||
+ if (this.isRemoved()) {
|
||||
@@ -56,15 +45,3 @@
|
||||
}
|
||||
|
||||
this.checkInsideBlocks();
|
||||
@@ -184,6 +203,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);
|
||||
|
||||
Reference in New Issue
Block a user