3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 20:40:08 +01:00

SPIGOT-2786: Restore some fireworks code lost in update

Dieser Commit ist enthalten in:
md_5 2016-11-18 10:11:19 +11:00
Ursprung 486ba9f481
Commit 4bf2fc8782

Datei anzeigen

@ -1,6 +1,8 @@
package org.bukkit.craftbukkit.entity;
import net.minecraft.server.EntityFireworks;
import net.minecraft.server.ItemStack;
import net.minecraft.server.Items;
import org.bukkit.Material;
import org.bukkit.craftbukkit.CraftServer;
@ -18,7 +20,15 @@ public class CraftFirework extends CraftEntity implements Firework {
public CraftFirework(CraftServer server, EntityFireworks entity) {
super(server, entity);
this.item = CraftItemStack.asCraftMirror(getHandle().getDataWatcher().get(EntityFireworks.FIREWORK_ITEM));
ItemStack item = getHandle().getDataWatcher().get(EntityFireworks.FIREWORK_ITEM);
if (item.isEmpty()) {
item = new ItemStack(Items.FIREWORKS);
getHandle().getDataWatcher().set(EntityFireworks.FIREWORK_ITEM, item);
}
this.item = CraftItemStack.asCraftMirror(item);
// Ensure the item is a firework...
if (this.item.getType() != Material.FIREWORK) {