aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0358-Fix-last-firework-in-stack-not-having-effects-when-d.patch
blob: 602eb2b818dcd851ce8a736f15eb4d322ac7a8a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Fri, 17 Jan 2020 18:44:55 -0800
Subject: [PATCH] Fix last firework in stack not having effects when dispensed
 - #2871

CB used the resulting item in the dispenser rather than the item
dispensed. The resulting item would have size == 0 and therefore
be convertered to air, hence why the effects disappeared.

diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
index ba28fdc1a7ed2bc9d55489a8aeb3f786d31c732e..89921ffeae7cc715aa18cbf8687e7c8e612e5612 100644
--- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
+++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
@@ -510,7 +510,7 @@ public interface DispenseItemBehavior {
                 }
 
                 itemstack1 = CraftItemStack.asNMSCopy(event.getItem());
-                FireworkRocketEntity entityfireworks = new FireworkRocketEntity(pointer.getLevel(), stack, pointer.x(), pointer.y(), pointer.x(), true);
+                FireworkRocketEntity entityfireworks = new FireworkRocketEntity(pointer.getLevel(), itemstack1, pointer.x(), pointer.y(), pointer.x(), true); // Paper - GH-2871 - fix last firework in stack having no effects when dispensed
 
                 DispenseItemBehavior.setEntityPokingOutOfBlock(pointer, entityfireworks, enumdirection);
                 entityfireworks.shoot((double) enumdirection.getStepX(), (double) enumdirection.getStepY(), (double) enumdirection.getStepZ(), 0.5F, 1.0F);