2015-05-25 12:37:24 +02:00
|
|
|
--- a/net/minecraft/server/EntityFireball.java
|
|
|
|
+++ b/net/minecraft/server/EntityFireball.java
|
2016-02-29 22:32:46 +01:00
|
|
|
@@ -1,5 +1,7 @@
|
|
|
|
package net.minecraft.server;
|
2014-11-25 22:32:16 +01:00
|
|
|
|
|
|
|
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
|
|
|
+
|
|
|
|
public abstract class EntityFireball extends Entity {
|
|
|
|
|
2016-11-17 02:41:03 +01:00
|
|
|
public EntityLiving shooter;
|
|
|
|
@@ -8,6 +10,8 @@
|
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
|
|
|
|
|
|
|
|
public EntityFireball(World world) {
|
|
|
|
super(world);
|
2016-11-17 02:41:03 +01:00
|
|
|
@@ -31,12 +35,19 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
public EntityFireball(World world, EntityLiving entityliving, double d0, double d1, double d2) {
|
|
|
|
super(world);
|
|
|
|
this.shooter = entityliving;
|
|
|
|
+ this.projectileSource = (org.bukkit.entity.LivingEntity) entityliving.getBukkitEntity(); // CraftBukkit
|
2015-02-26 23:41:06 +01:00
|
|
|
this.setSize(1.0F, 1.0F);
|
2014-11-25 22:32:16 +01:00
|
|
|
this.setPositionRotation(entityliving.locX, entityliving.locY, entityliving.locZ, entityliving.yaw, entityliving.pitch);
|
|
|
|
this.setPosition(this.locX, this.locY, this.locZ);
|
2016-06-09 03:43:49 +02:00
|
|
|
this.motX = 0.0D;
|
|
|
|
this.motY = 0.0D;
|
|
|
|
this.motZ = 0.0D;
|
2014-11-25 22:32:16 +01:00
|
|
|
+ // CraftBukkit start - Added setDirection method
|
|
|
|
+ this.setDirection(d0, d1, d2);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void setDirection(double d0, double d1, double d2) {
|
|
|
|
+ // CraftBukkit end
|
|
|
|
d0 += this.random.nextGaussian() * 0.4D;
|
|
|
|
d1 += this.random.nextGaussian() * 0.4D;
|
|
|
|
d2 += this.random.nextGaussian() * 0.4D;
|
2016-11-17 02:41:03 +01:00
|
|
|
@@ -61,6 +72,12 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
|
|
|
|
if (movingobjectposition != null) {
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
this.locX += this.motX;
|
2016-11-17 02:41:03 +01:00
|
|
|
@@ -150,6 +167,11 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
} else {
|
2017-05-14 04:00:00 +02:00
|
|
|
this.av();
|
2014-11-25 22:32:16 +01:00
|
|
|
if (damagesource.getEntity() != null) {
|
|
|
|
+ // CraftBukkit start
|
|
|
|
+ if (CraftEventFactory.handleNonLivingEntityDamageEvent(this, damagesource, f)) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2017-05-14 04:00:00 +02:00
|
|
|
Vec3D vec3d = damagesource.getEntity().aH();
|
2014-11-25 22:32:16 +01:00
|
|
|
|
|
|
|
if (vec3d != null) {
|
2016-11-17 02:41:03 +01:00
|
|
|
@@ -163,6 +185,7 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
|
|
|
|
if (damagesource.getEntity() instanceof EntityLiving) {
|
|
|
|
this.shooter = (EntityLiving) damagesource.getEntity();
|
|
|
|
+ this.projectileSource = (org.bukkit.projectiles.ProjectileSource) this.shooter.getBukkitEntity();
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|