use of net.minecraft.entity.projectile.FireworkRocketEntity in project BluePower by Qmunity.
the class DateEventHandler method spawnFirework.
public static void spawnFirework(World world, double x, double y, double z) {
ItemStack rocket = new ItemStack(Items.FIREWORK_ROCKET);
ItemStack itemstack1 = getFireworkCharge();
CompoundNBT nbttagcompound = new CompoundNBT();
CompoundNBT nbttagcompound1 = new CompoundNBT();
ListNBT nbttaglist = new ListNBT();
if (!itemstack1.isEmpty() && itemstack1.getItem() == Items.FIREWORK_STAR && itemstack1.hasTag() && itemstack1.getTag().hasUUID("Explosion")) {
nbttaglist.add(itemstack1.getTag().getCompound("Explosion"));
}
nbttagcompound1.put("Explosions", nbttaglist);
nbttagcompound1.putByte("Flight", (byte) 2);
nbttagcompound.put("Fireworks", nbttagcompound1);
rocket.setTag(nbttagcompound);
FireworkRocketEntity entity = new FireworkRocketEntity(world, x, y, z, rocket);
world.addFreshEntity(entity);
}
Aggregations