mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 19:49:35 +01:00
SPIGOT-2786: Restore some fireworks code lost in update
By: md_5 <git@md-5.net>
This commit is contained in:
parent
59b6b056d4
commit
c1a05bcbea
1 changed files with 11 additions and 1 deletions
|
@ -1,6 +1,8 @@
|
||||||
package org.bukkit.craftbukkit.entity;
|
package org.bukkit.craftbukkit.entity;
|
||||||
|
|
||||||
import net.minecraft.server.EntityFireworks;
|
import net.minecraft.server.EntityFireworks;
|
||||||
|
import net.minecraft.server.ItemStack;
|
||||||
|
import net.minecraft.server.Items;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.craftbukkit.CraftServer;
|
import org.bukkit.craftbukkit.CraftServer;
|
||||||
|
@ -18,7 +20,15 @@ public class CraftFirework extends CraftEntity implements Firework {
|
||||||
|
|
||||||
public CraftFirework(CraftServer server, EntityFireworks entity) {
|
public CraftFirework(CraftServer server, EntityFireworks entity) {
|
||||||
super(server, 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...
|
// Ensure the item is a firework...
|
||||||
if (this.item.getType() != Material.FIREWORK) {
|
if (this.item.getType() != Material.FIREWORK) {
|
||||||
|
|
Loading…
Reference in a new issue