/** * Creates a randomized fireworks {@link ItemStack}. * * @param flightDuration The flight duration of the fireworks. Possible range is between 0 (inclusive) and 3 (inclusive). * @param explosions The amount of {@link Explosion}s that will occur when the fireworks detonate. * @param primaryColors The amount of different primary colors that each Explosion will have. * @param fadeColors The amount of different fade colors that each Explosion will have. * @return A randomized fireworks ItemStack. */ public static ItemStack getRandomFireworks(int flightDuration, int explosions, int primaryColors, int fadeColors) { explosions = MathHelper.clamp(explosions, 0, Integer.MAX_VALUE); Explosion[] explosionsArray = new Explosion[explosions]; for (int i = 0; i < explosions; i++) { explosionsArray[i] = Explosion.getRandom(primaryColors, fadeColors); } return getFireworksStack(flightDuration, explosionsArray); }