public static int[] getIntArray(ItemStack stack, String tag) { return verifyExistance(stack, tag) ? getNBT(stack).getIntArray(tag) : EMPTY_INT_ARRAY; }
@Override public AEColor[] getColorCode( ItemStack is ) { final NBTTagCompound tag = this.getData( is ); if( tag.hasKey( "colorCode" ) ) { final int[] frequency = tag.getIntArray( "colorCode" ); final AEColor[] colorArray = AEColor.values(); return new AEColor[] { colorArray[frequency[0]], colorArray[frequency[1]], colorArray[frequency[2]], colorArray[frequency[3]], colorArray[frequency[4]], colorArray[frequency[5]], colorArray[frequency[6]], colorArray[frequency[7]], }; } return DEFAULT_COLOR_CODE; }
if( nbtData.hasKey( TAG_P2P_STATE ) ) int[] stateArr = nbtData.getIntArray( TAG_P2P_STATE ); if( stateArr.length == 2 )
@Override public void readFromNBT(NBTTagCompound nbttagcompound) { super.readFromNBT(nbttagcompound); nextSendMax = nbttagcompound.getIntArray("nextSendMax"); if (nextSendMax.length < 6) { nextSendMax = new int[6]; } nextSendMin = nbttagcompound.getIntArray("nextSendMin"); if (nextSendMin.length < 6) { nextSendMin = new int[6]; } }
int[] data = nbt.getIntArray( "x" ); if( data.length != 2 )
public static final ArrayList<BlockPos> readBlockPosArrayListFromNBT(String name, NBTTagCompound compound) { int[] xArray = compound.getIntArray(name + "xArray"); int[] yArray = compound.getIntArray(name + "yArray"); int[] zArray = compound.getIntArray(name + "zArray"); ArrayList<BlockPos> posArray = new ArrayList<BlockPos>(xArray.length + 10); for (int i = 0; i < xArray.length; i++) { BlockPos pos = new BlockPos(xArray[i], yArray[i], zArray[i]); posArray.add(pos); } return posArray; }
/** * Checks if a NBTTagCompound is acceptable. For an NBTTagCompound to be acceptable, it * must not be null, and must have an integer array named Color with 3 elements. * * @param tag The NBTTagCompound to check. * @return Whether or not the ItemStack was acceptable. */ public static boolean isAcceptable (@Nonnull NBTTagCompound tag) { return tag.hasKey("Color") && tag.getIntArray("Color").length == 3; } }
@Override public void readFromNBT(final NBTTagCompound nbt) { super.readFromNBT(nbt); receiveQueue.clear(); final int[] receiveQueueNbt = nbt.getIntArray(TAG_RECEIVE_QUEUE); for (final int value : receiveQueueNbt) { receiveQueue.addLast((short) value); } }
public void readFromNBT(NBTTagCompound nbt) { int[] amountRecorded_A = nbt.getIntArray("amountRecorded_A"); int[] amountRecorded_B = nbt.getIntArray("amountRecorded_B"); for (int i = 0; i < amountRecorded.length; i++) { if (i >= amountRecorded_A.length || i >= amountRecorded_B.length) { break; } amountRecorded[i] = (((long) amountRecorded_B[i]) << 32) | amountRecorded_A[i]; } arrayPos = nbt.getInteger("arrayPos"); item = ItemIdentifier.get(ItemStackLoader.loadAndFixItemStackFromNBT(nbt)); }
@Override public boolean processIMCMessage(IMCMessage message) { if (message.key.equals("blacklist-ores-dimension")) { int[] dims = message.getNBTValue().getIntArray("dimensions"); for (int dim : dims) { Config.blacklistOreDim(dim); } return true; } return false; }
public static int[] getIntArray(ItemStack stack, String key, int[] defaultValue) { if (!keyExists(stack, key)) { return defaultValue; } return getTagCompound(stack).getIntArray(key); }
@Override public void readFromNBT(final NBTTagCompound nbt) { super.readFromNBT(nbt); final int[] stackNbt = nbt.getIntArray(TAG_STACK); final int count = Math.min(stackNbt.length, stack.length); for (int i = 0; i < count; i++) { stack[i] = (short) stackNbt[i]; } top = MathHelper.clamp(nbt.getInteger(TAG_TOP), -1, STACK_SIZE - 1); }
@Override public void readFromNBT(@Nonnull NBTTagCompound tag) { portalCoordinates = NBTHelper.readPositionCollection(tag.getTagList("PortalCoordinates", 10)); if (tag.hasKey("GeneratedMiner")) { generated = new TIntHashSet(tag.getIntArray("GeneratedMiner")); } }
@Override public void fromTag(NBTTagCompound tag) { name = tag.getString("name"); cut = tag.getBoolean("cut"); setPicture(tag.getIntArray("pixels")); }
@Override public void addInformation(ItemStack stack, @Nullable World player, List<String> tooltip, ITooltipFlag advanced) { if (stack.getTagCompound() != null) { tooltip.add(StatCollector.translateToLocal("bestiary.contains")); List<EnumBestiaryPages> pages = EnumBestiaryPages.containedPages(EnumBestiaryPages.toList(stack.getTagCompound().getIntArray("Pages"))); for (EnumBestiaryPages page : pages) { tooltip.add(TextFormatting.WHITE + "-" + StatCollector.translateToLocal("bestiary." + EnumBestiaryPages.values()[page.ordinal()].toString().toLowerCase())); } } }
public static final Map<Integer, Vector> readEntityPositionMap(String name, NBTTagCompound compound) { int[] entityIds = compound.getIntArray(name + "keys"); double[] entityX = toDoubleArray(compound.getByteArray(name + "valX")); double[] entityY = toDoubleArray(compound.getByteArray(name + "valY")); double[] entityZ = toDoubleArray(compound.getByteArray(name + "valZ")); Map<Integer, Vector> toReturn = new HashMap<Integer, Vector>(entityIds.length + 1); for (int i = 0; i < entityIds.length; i++) { toReturn.put(entityIds[i], new Vector(entityX[i], entityY[i], entityZ[i])); } return toReturn; }
public static Picture fromFile(File file) { NBTTagCompound data = file.getData(); Picture picture = new Picture(data.getString("Name"), data.getString("Author"), Size.getFromSize(data.getInteger("Resolution"))); picture.source = file; picture.pixels = data.getIntArray("Pixels"); return picture; }
public final void readFromNBT(NBTTagCompound tag) { stackToSpawn = new ItemStack(tag.getCompoundTag("spawnerStack")); npcType = tag.getString("npcType"); npcName = tag.getString("npcName"); deathCause = tag.getString("deathCause"); resurrected = tag.getBoolean("resurrected"); canRes = tag.getBoolean("canRes"); pos = tag.getIntArray("pos"); }
@Override public void readFromNBT(final NBTTagCompound nbt) { this.nameDefinition = ErrorStateRegistry.getErrorState(nbt.getString("name")); this.definition = ErrorStateRegistry.getErrorState(nbt.getString("desc")); this.data = nbt.getIntArray("data"); this.itemError = nbt.getBoolean("item"); this.tankError = nbt.getBoolean("tank"); this.powerError = nbt.getBoolean("power"); }
@Override public void readFromNBT(NBTTagCompound tagCompound) { super.readFromNBT(tagCompound); itemHandler.deserializeNBT(tagCompound.getCompoundTag("ItemHandler")); furnaceBurnTime = tagCompound.getShort("BurnTime"); currentItemBurnTime = tagCompound.getShort("CurrentItemBurnTime"); slotCookTime = tagCompound.getIntArray("CookTimes"); hasPowerUpgrade = tagCompound.getBoolean("HasPowerUpgrade"); energyStorage.setEnergyStored(tagCompound.getInteger("EnergyStored")); }