Set spawning entity for fireworks spawned by a crossbow (#2358)

Fixes #2327
This commit is contained in:
Black Hole 2019-07-24 05:12:40 +02:00 committed by Zach
parent ad8dbf3d2b
commit 8ecd433727
2 changed files with 23 additions and 11 deletions

View file

@ -1,11 +1,11 @@
From 6f4d52fa199a856189faa704379f3d029192a50c Mon Sep 17 00:00:00 2001
From 8278f3309ebe8c14615c79687585125ae81dd34a Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 28 Dec 2016 01:18:33 -0500
Date: Wed, 28 Dec 2016 07:18:33 +0100
Subject: [PATCH] Firework API's
diff --git a/src/main/java/net/minecraft/server/EntityFireworks.java b/src/main/java/net/minecraft/server/EntityFireworks.java
index 25851b70c..ffd379c97 100644
index 020562cd3..aaae9b376 100644
--- a/src/main/java/net/minecraft/server/EntityFireworks.java
+++ b/src/main/java/net/minecraft/server/EntityFireworks.java
@@ -3,6 +3,8 @@ package net.minecraft.server;
@ -52,6 +52,18 @@ index 25851b70c..ffd379c97 100644
}
@Override
diff --git a/src/main/java/net/minecraft/server/ItemCrossbow.java b/src/main/java/net/minecraft/server/ItemCrossbow.java
index 28d7fdeef..874d9f500 100644
--- a/src/main/java/net/minecraft/server/ItemCrossbow.java
+++ b/src/main/java/net/minecraft/server/ItemCrossbow.java
@@ -199,6 +199,7 @@ public class ItemCrossbow extends ItemProjectileWeapon {
if (flag1) {
object = new EntityFireworks(world, itemstack1, entityliving.locX, entityliving.locY + (double) entityliving.getHeadHeight() - 0.15000000596046448D, entityliving.locZ, true);
+ ((EntityFireworks) object).spawningEntity = entityliving.getUniqueID(); // Paper
} else {
object = a(world, entityliving, itemstack, itemstack1);
if (flag || f3 != 0.0F) {
diff --git a/src/main/java/net/minecraft/server/ItemFireworks.java b/src/main/java/net/minecraft/server/ItemFireworks.java
index 37caa79cb..aea46ffae 100644
--- a/src/main/java/net/minecraft/server/ItemFireworks.java
@ -134,5 +146,5 @@ index 6b69be742..37374ae5b 100644
+ // Paper end
}
--
2.22.0
2.22.0.windows.1

View file

@ -1,4 +1,4 @@
From c650f345d35f50bc022884fc512b7f21745eab03 Mon Sep 17 00:00:00 2001
From be897005519da1a9a186db4e62d187dff83e58b5 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 15 Jun 2013 19:51:17 -0400
Subject: [PATCH] EntityShootBowEvent consumeArrow and getArrowItem API
@ -6,7 +6,7 @@ Subject: [PATCH] EntityShootBowEvent consumeArrow and getArrowItem API
Adds ability to get what arrow was shot, and control if it should be consumed.
diff --git a/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java b/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java
index 5c3628035f..8f1b5a5502 100644
index 5c3628035..8f1b5a550 100644
--- a/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java
+++ b/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java
@@ -157,7 +157,7 @@ public abstract class EntitySkeletonAbstract extends EntityMonster implements IR
@ -19,7 +19,7 @@ index 5c3628035f..8f1b5a5502 100644
event.getProjectile().remove();
return;
diff --git a/src/main/java/net/minecraft/server/ItemBow.java b/src/main/java/net/minecraft/server/ItemBow.java
index 0ea1bf4dc0..90592fd380 100644
index 0ea1bf4dc..90592fd38 100644
--- a/src/main/java/net/minecraft/server/ItemBow.java
+++ b/src/main/java/net/minecraft/server/ItemBow.java
@@ -36,6 +36,7 @@ public class ItemBow extends ItemProjectileWeapon {
@ -59,10 +59,10 @@ index 0ea1bf4dc0..90592fd380 100644
if (itemstack1.isEmpty()) {
entityhuman.inventory.f(itemstack1);
diff --git a/src/main/java/net/minecraft/server/ItemCrossbow.java b/src/main/java/net/minecraft/server/ItemCrossbow.java
index 28d7fdeef8..a2be9b44e8 100644
index 874d9f500..f0d784108 100644
--- a/src/main/java/net/minecraft/server/ItemCrossbow.java
+++ b/src/main/java/net/minecraft/server/ItemCrossbow.java
@@ -220,7 +220,7 @@ public class ItemCrossbow extends ItemProjectileWeapon {
@@ -221,7 +221,7 @@ public class ItemCrossbow extends ItemProjectileWeapon {
((IProjectile) object).shoot((double) vector3fa.a(), (double) vector3fa.b(), (double) vector3fa.c(), f1, f2);
}
// CraftBukkit start
@ -72,7 +72,7 @@ index 28d7fdeef8..a2be9b44e8 100644
event.getProjectile().remove();
return;
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index fa96ec3247..9e6ad82ba5 100644
index fa96ec324..9e6ad82ba 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -50,6 +50,7 @@ import net.minecraft.server.GeneratorAccess;
@ -104,5 +104,5 @@ index fa96ec3247..9e6ad82ba5 100644
return event;
--
2.22.0
2.22.0.windows.1