aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0866-Track-projectile-source-for-fireworks-from-dispenser.patch
blob: aa366ccef9d097fb6e56a8fcac6d2b64910042ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Thu, 23 Jun 2022 19:25:51 -0700
Subject: [PATCH] Track projectile source for fireworks from dispensers


diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
index d9077127757886e5d5e8d63a46fe27f2bfba1420..b65d0c2ac5b4f7eb3da85b693c354463c6f49694 100644
--- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
+++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
@@ -517,6 +517,7 @@ public interface DispenseItemBehavior {
                 itemstack1 = CraftItemStack.asNMSCopy(event.getItem());
                 Vec3 vec3d = DispenseItemBehavior.getEntityPokingOutOfBlockPos(pointer, EntityType.FIREWORK_ROCKET, enumdirection);
                 FireworkRocketEntity entityfireworks = new FireworkRocketEntity(pointer.level(), itemstack1, vec3d.x(), vec3d.y(), vec3d.z(), true); // Paper - GH-2871 - fix last firework in stack having no effects when dispensed
+                entityfireworks.projectileSource = new org.bukkit.craftbukkit.projectiles.CraftBlockProjectileSource(pointer.blockEntity()); // Paper - track projectile source for fireworks
 
                 entityfireworks.shoot((double) enumdirection.getStepX(), (double) enumdirection.getStepY(), (double) enumdirection.getStepZ(), 0.5F, 1.0F);
                 pointer.level().addFreshEntity(entityfireworks);