Paper/patches/server/0351-Fix-last-firework-in-stack-not-having-effects-when-d.patch

24 lines
1.6 KiB
Diff
Raw Normal View History

2021-06-11 14:02:28 +02:00
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
2022-03-01 06:43:03 +01:00
index 4830da3279c1f5b18307dfe148f42b05e5b6b9d3..047dd5600e3aae8b19bfc33566ee60541131e60a 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
+++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
2022-03-01 06:43:03 +01:00
@@ -509,7 +509,7 @@ public interface DispenseItemBehavior {
2021-06-11 14:02:28 +02:00
}
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);