From aead01a6154684607337b17c65df79452d848d97 Mon Sep 17 00:00:00 2001 From: Black Hole Date: Wed, 24 Jul 2019 05:12:40 +0200 Subject: [PATCH] Set spawning entity for fireworks spawned by a crossbow (#2358) Fixes #2327 --- ...wEvent-consumeArrow-and-getArrowItem-AP.patch | 8 ++++---- Spigot-Server-Patches/Firework-API-s.patch | 16 ++++++++++++++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Spigot-Server-Patches/EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch b/Spigot-Server-Patches/EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch index 7003207ba9..e4519fd3bb 100644 --- a/Spigot-Server-Patches/EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch +++ b/Spigot-Server-Patches/EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch @@ -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 @@ -0,0 +0,0 @@ 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 @@ -0,0 +0,0 @@ public class ItemBow extends ItemProjectileWeapon { @@ -59,7 +59,7 @@ 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 @@ -0,0 +0,0 @@ public class ItemCrossbow extends ItemProjectileWeapon { @@ -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 @@ -0,0 +0,0 @@ import net.minecraft.server.GeneratorAccess; diff --git a/Spigot-Server-Patches/Firework-API-s.patch b/Spigot-Server-Patches/Firework-API-s.patch index 555c267e56..c2cee70af1 100644 --- a/Spigot-Server-Patches/Firework-API-s.patch +++ b/Spigot-Server-Patches/Firework-API-s.patch @@ -1,11 +1,11 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Aikar -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 @@ -0,0 +0,0 @@ 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 +@@ -0,0 +0,0 @@ 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