2015-05-25 12:37:24 +02:00
|
|
|
--- a/net/minecraft/server/EntityFireball.java
|
|
|
|
+++ b/net/minecraft/server/EntityFireball.java
|
2020-06-25 02:00:00 +02:00
|
|
|
@@ -1,10 +1,14 @@
|
2016-02-29 22:32:46 +01:00
|
|
|
package net.minecraft.server;
|
2014-11-25 22:32:16 +01:00
|
|
|
|
|
|
|
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
|
|
|
+
|
2020-06-25 02:00:00 +02:00
|
|
|
public abstract class EntityFireball extends IProjectile {
|
2014-11-25 22:32:16 +01:00
|
|
|
|
|
|
|
public double dirX;
|
|
|
|
public double dirY;
|
|
|
|
public double dirZ;
|
|
|
|
+ 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);
|
2020-06-25 02:00:00 +02:00
|
|
|
@@ -14,6 +18,12 @@
|
2019-04-23 04:00:00 +02:00
|
|
|
this(entitytypes, world);
|
2020-06-25 02:00:00 +02:00
|
|
|
this.setPositionRotation(d0, d1, d2, this.yaw, this.pitch);
|
|
|
|
this.ac();
|
2014-11-25 22:32:16 +01:00
|
|
|
+ // CraftBukkit start - Added setDirection method
|
2020-06-25 02:00:00 +02:00
|
|
|
+ this.setDirection(d3, d4, d5);
|
2014-11-25 22:32:16 +01:00
|
|
|
+ }
|
|
|
|
+
|
2020-06-25 02:00:00 +02:00
|
|
|
+ public void setDirection(double d3, double d4, double d5) {
|
2014-11-25 22:32:16 +01:00
|
|
|
+ // CraftBukkit end
|
2020-06-25 02:00:00 +02:00
|
|
|
double d6 = (double) MathHelper.sqrt(d3 * d3 + d4 * d4 + d5 * d5);
|
|
|
|
|
|
|
|
if (d6 != 0.0D) {
|
|
|
|
@@ -49,6 +59,12 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
if (movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.MISS) {
|
2014-11-25 22:32:16 +01:00
|
|
|
this.a(movingobjectposition);
|
|
|
|
+
|
|
|
|
+ // CraftBukkit start - Fire ProjectileHitEvent
|
|
|
|
+ if (this.dead) {
|
2016-11-28 02:47:01 +01:00
|
|
|
+ CraftEventFactory.callProjectileHitEvent(this, movingobjectposition);
|
2014-11-25 22:32:16 +01:00
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
}
|
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
Vec3D vec3d = this.getMot();
|
2020-06-25 02:00:00 +02:00
|
|
|
@@ -132,6 +148,11 @@
|
|
|
|
Entity entity = damagesource.getEntity();
|
|
|
|
|
|
|
|
if (entity != null) {
|
2014-11-25 22:32:16 +01:00
|
|
|
+ // CraftBukkit start
|
|
|
|
+ if (CraftEventFactory.handleNonLivingEntityDamageEvent(this, damagesource, f)) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2020-06-25 02:00:00 +02:00
|
|
|
Vec3D vec3d = entity.getLookDirection();
|
2014-11-25 22:32:16 +01:00
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
this.setMot(vec3d);
|