public static void setIntArray(ItemStack stack, String tag, int[] val) { getNBT(stack).setIntArray(tag, val); }
public ItemStack generateFirework(int color) { ItemStack stack = new ItemStack(Items.FIREWORKS); NBTTagCompound explosion = new NBTTagCompound(); explosion.setIntArray("Colors", new int[] { color }); int type = 1; double rand = Math.random(); if(rand > 0.25) { if(rand > 0.9) type = 2; else type = 0; } explosion.setInteger("Type", type); if(Math.random() < 0.05) if(Math.random() < 0.5) explosion.setBoolean("Flicker", true); else explosion.setBoolean("Trail", true); ItemNBTHelper.setCompound(stack, "Explosion", explosion); NBTTagCompound fireworks = new NBTTagCompound(); fireworks.setInteger("Flight", (int) (Math.random() * 3 + 2)); NBTTagList explosions = new NBTTagList(); explosions.appendTag(explosion); fireworks.setTag("Explosions", explosions); ItemNBTHelper.setCompound(stack, "Fireworks", fireworks); return stack; }
tag.setIntArray( TAG_P2P_STATE, new int[] { state, outputCount
@Override public void writeToNBT(NBTTagCompound nbttagcompound) { super.writeToNBT(nbttagcompound); nbttagcompound.setIntArray("nextSendMax", nextSendMax); nbttagcompound.setIntArray("nextSendMin", nextSendMin); }
@Override public void writeToNBT(NBTTagCompound nbttagcompound) { super.writeToNBT(nbttagcompound); nbttagcompound.setIntArray("liquidToExtract", liquidToExtract); }
@Override public NBTTagCompound writeToNBT(NBTTagCompound nbt) { nbt.setInteger("chunkKey", chunkKey); int[] array = new int[avalibleChunkKeys.size()]; for (int i = 0; i < avalibleChunkKeys.size(); i++) { array[i] = avalibleChunkKeys.get(i); } nbt.setIntArray("avalibleChunkKeys", array); return nbt; }
@Override public NBTTagCompound serializeNBT() { NBTTagCompound nbt = new NBTTagCompound(); for (Map.Entry<String, BlockDimPos> entry : map.entrySet()) { nbt.setIntArray(entry.getKey(), entry.getValue().toIntArray()); } return nbt; }
public void writeToNBT(NBTTagCompound nbt) { int[] amountRecorded_A = new int[amountRecorded.length]; int[] amountRecorded_B = new int[amountRecorded.length]; for (int i = 0; i < amountRecorded.length; i++) { amountRecorded_A[i] = (int) amountRecorded[i]; amountRecorded_B[i] = (int) (amountRecorded[i] >> 32); } nbt.setIntArray("amountRecorded_A", amountRecorded_A); nbt.setIntArray("amountRecorded_B", amountRecorded_B); nbt.setInteger("arrayPos", arrayPos); item.makeNormalStack(1).writeToNBT(nbt); }
@Override public NBTTagCompound serialize(NBTTagCompound tag) { super.serialize(tag); tag.setInteger("currentSlot", currentActiveSlot); tag.setIntArray(Constants.NBT.ROUTING_PRIORITY, priorities); tag.setBoolean("updated", true); return tag; }
@Override public void onCreated(ItemStack itemStack, World world, EntityPlayer player) { itemStack.setTagCompound(new NBTTagCompound()); itemStack.getTagCompound().setIntArray("Pages", new int[]{0}); }
@Override public void writeToNBT(final NBTTagCompound nbt) { super.writeToNBT(nbt); final int[] queueNbt = new int[queue.length]; for (int i = 0; i < queue.length; i++) { queueNbt[i] = queue[i]; } nbt.setIntArray(TAG_QUEUE, queueNbt); nbt.setInteger(TAG_HEAD, head); nbt.setInteger(TAG_TAIL, tail); }
public static void sendOpenBagUpdate(EntityPlayer player, UUID groupId, int bag, int[] limits){ NBTTagCompound nbt = new NBTTagCompound(); nbt.setUniqueId("GroupId", groupId); nbt.setInteger("Bag", bag); nbt.setIntArray("Limits", limits); BAG_OPENED.sendMessageToPlayer(nbt, player); }
public static void addPage(EnumBestiaryPages page, ItemStack book) { if (book.getItem() instanceof ItemBestiary) { NBTTagCompound tag = book.getTagCompound(); List<EnumBestiaryPages> enumlist = containedPages(toList(tag.getIntArray("Pages"))); if (!enumlist.contains(page)) { enumlist.add(page); } tag.setIntArray("Pages", fromList(enumToInt(enumlist))); } } }
@Override public NBTTagCompound toTag() { NBTTagCompound tag = new NBTTagCompound(); tag.setString("name", name); tag.setIntArray("pixels", pixels); tag.setInteger("resolution", resolution); if(cut) tag.setBoolean("cut", cut); return tag; }
public ItemStack getDrink() { ItemStack cup = new ItemStack(FurnitureItems.DRINK); NBTTagCompound nbt = new NBTTagCompound(); nbt.setIntArray("Colour", new int[]{currentRed, currentGreen, currentBlue}); nbt.setInteger("HealAmount", healAmount); nbt.setString("Name", drinkName); cup.setTagCompound(nbt); return cup; }
@Override public void onUpdate(ItemStack stack, World world, Entity entity, int f, boolean f1) { if (stack.getTagCompound() == null) { stack.setTagCompound(new NBTTagCompound()); stack.getTagCompound().setIntArray("Pages", new int[]{EnumBestiaryPages.INTRODUCTION.ordinal()}); } }
public void writeToNBT(NBTTagCompound tagCompound) { tagCompound.setString("Name", getName()); tagCompound.setString("Author", getAuthor()); tagCompound.setIntArray("Pixels", pixels); tagCompound.setInteger("Resolution", size.width); }
}; data.setIntArray( "colorCode", colorCode );
public void writeToNBT(NBTTagCompound tag) { tag.setString("name", name); tag.setInteger("value", value); tag.setIntArray("bb", new int[] {bb.min.getX(), bb.min.getY(), bb.min.getZ(), bb.max.getX(), bb.max.getY(), bb.max.getZ()}); }
@Override public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) { super.writeToNBT(tagCompound); tagCompound.setTag("ItemHandler", itemHandler.serializeNBT()); tagCompound.setShort("BurnTime", (short) furnaceBurnTime); tagCompound.setShort("CurrentItemBurnTime", (short) currentItemBurnTime); tagCompound.setIntArray("CookTimes", ArrayUtils.clone(slotCookTime)); tagCompound.setBoolean("HasPowerUpgrade", hasPowerUpgrade); tagCompound.setInteger("EnergyStored", energyStorage.getEnergyStored()); return tagCompound; }