2020-05-06 09:48:49 +00:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2020-01-18 17:31:05 +00:00
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.
2021-03-16 07:19:45 +00:00
diff --git a/src/main/java/net/minecraft/core/dispenser/IDispenseBehavior.java b/src/main/java/net/minecraft/core/dispenser/IDispenseBehavior.java
2021-05-03 08:42:29 +00:00
index 50911632341d1b861c00f01077cae43884147fe0..0055a96b51a1d38d31e129c417c97bcfc9d0b745 100644
2021-03-16 07:19:45 +00:00
--- a/src/main/java/net/minecraft/core/dispenser/IDispenseBehavior.java
+++ b/src/main/java/net/minecraft/core/dispenser/IDispenseBehavior.java
2021-05-03 08:42:29 +00:00
@@ -427,7 +427,7 @@ public interface IDispenseBehavior {
2020-01-18 17:31:05 +00:00
}
itemstack1 = CraftItemStack.asNMSCopy(event.getItem());
2020-06-25 23:38:24 +00:00
- EntityFireworks entityfireworks = new EntityFireworks(isourceblock.getWorld(), itemstack, isourceblock.getX(), isourceblock.getY(), isourceblock.getX(), true);
+ EntityFireworks entityfireworks = new EntityFireworks(isourceblock.getWorld(), itemstack1, isourceblock.getX(), isourceblock.getY(), isourceblock.getX(), true); // Paper - GH-2871 - fix last firework in stack having no effects when dispensed
2020-01-18 17:31:05 +00:00
2020-06-25 23:38:24 +00:00
IDispenseBehavior.a(isourceblock, entityfireworks, enumdirection);
entityfireworks.shoot((double) enumdirection.getAdjacentX(), (double) enumdirection.getAdjacentY(), (double) enumdirection.getAdjacentZ(), 0.5F, 1.0F);