summaryrefslogtreecommitdiffstats
path: root/nms-patches/EntityFireball.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nms-patches/EntityFireball.patch')
-rw-r--r--nms-patches/EntityFireball.patch50
1 files changed, 9 insertions, 41 deletions
diff --git a/nms-patches/EntityFireball.patch b/nms-patches/EntityFireball.patch
index 416b8ebe..c0780ae7 100644
--- a/nms-patches/EntityFireball.patch
+++ b/nms-patches/EntityFireball.patch
@@ -1,15 +1,14 @@
--- a/net/minecraft/server/EntityFireball.java
+++ b/net/minecraft/server/EntityFireball.java
-@@ -2,6 +2,8 @@
-
- import java.util.List;
+@@ -1,5 +1,7 @@
+ package net.minecraft.server;
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
+
public abstract class EntityFireball extends Entity {
private int e = -1;
-@@ -15,6 +17,8 @@
+@@ -13,6 +15,8 @@
public double dirX;
public double dirY;
public double dirZ;
@@ -18,7 +17,7 @@
public EntityFireball(World world) {
super(world);
-@@ -38,10 +42,17 @@
+@@ -36,10 +40,17 @@
public EntityFireball(World world, EntityLiving entityliving, double d0, double d1, double d2) {
super(world);
this.shooter = entityliving;
@@ -36,7 +35,7 @@
d0 += this.random.nextGaussian() * 0.4D;
d1 += this.random.nextGaussian() * 0.4D;
d2 += this.random.nextGaussian() * 0.4D;
-@@ -117,6 +128,12 @@
+@@ -83,6 +94,12 @@
if (movingobjectposition != null) {
this.a(movingobjectposition);
@@ -49,50 +48,19 @@
}
this.locX += this.motX;
-@@ -181,6 +198,8 @@
-
- nbttagcompound.setString("inTile", minecraftkey == null ? "" : minecraftkey.toString());
- nbttagcompound.setByte("inGround", (byte) (this.i ? 1 : 0));
-+ // CraftBukkit - Fix direction being mismapped to invalid variables
-+ nbttagcompound.set("power", this.a(new double[] { this.dirX, this.dirY, this.dirZ}));
- nbttagcompound.set("direction", this.a(new double[] { this.motX, this.motY, this.motZ}));
- }
-
-@@ -195,12 +214,20 @@
- }
-
- this.i = nbttagcompound.getByte("inGround") == 1;
-- if (nbttagcompound.hasKeyOfType("direction", 9)) {
-+ // CraftBukkit start - direction -> power
-+ if (nbttagcompound.hasKeyOfType("power", 9)) {
-+ NBTTagList nbttaglist = nbttagcompound.getList("power", 6);
-+
-+ this.dirX = nbttaglist.d(0);
-+ this.dirY = nbttaglist.d(1);
-+ this.dirZ = nbttaglist.d(2);
-+ } else if (nbttagcompound.hasKeyOfType("direction", 9)) {
- NBTTagList nbttaglist = nbttagcompound.getList("direction", 6);
-
- this.motX = nbttaglist.d(0);
- this.motY = nbttaglist.d(1);
- this.motZ = nbttaglist.d(2);
-+ // CraftBukkit end
- } else {
- this.die();
- }
-@@ -221,6 +248,11 @@
+@@ -187,6 +204,11 @@
} else {
- this.ac();
+ this.ao();
if (damagesource.getEntity() != null) {
+ // CraftBukkit start
+ if (CraftEventFactory.handleNonLivingEntityDamageEvent(this, damagesource, f)) {
+ return false;
+ }
+ // CraftBukkit end
- Vec3D vec3d = damagesource.getEntity().ap();
+ Vec3D vec3d = damagesource.getEntity().aB();
if (vec3d != null) {
-@@ -234,6 +266,7 @@
+@@ -200,6 +222,7 @@
if (damagesource.getEntity() instanceof EntityLiving) {
this.shooter = (EntityLiving) damagesource.getEntity();