/** * Converts the Explosion to an {@link NBTTagCompound} for use in creating fireworks {@link ItemStack}s. * * @return An NBTTagCompound representing the Explosion. */ public NBTTagCompound getTagCompound() { NBTTagCompound tag = new NBTTagCompound(); tag.setBoolean("Flicker", this.twinkle); tag.setBoolean("Trail", this.trail); tag.setByte("Type", (byte) this.type.ordinal()); int[] colorArray = new int[this.primaryColors.size()]; for (int i = 0; i < this.primaryColors.size(); i++) { colorArray[i] = this.primaryColors.get(i); } tag.setIntArray("Colors", colorArray); colorArray = new int[this.fadeColors.size()]; for (int i = 0; i < this.fadeColors.size(); i++) { colorArray[i] = this.fadeColors.get(i); } tag.setIntArray("FadeColors", colorArray); return tag; }