public static void setShort(ItemStack stack, String tag, short s) { getNBT(stack).setShort(tag, s); }
@Override public void writeToNBT( final NBTTagCompound data ) { super.writeToNBT( data ); data.setBoolean( "output", this.isOutput() ); data.setShort( "freq", this.getFrequency() ); }
tag.setShort( TAG_P2P_FREQUENCY, frequency );
@Override public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) { super.writeToNBT(tagCompound); tagCompound.setShort("BurnTime", (short) this.printerPrintTime); tagCompound.setShort("CookTime", (short) this.printingTime); tagCompound.setShort("CookTimeTotal", (short) this.totalCookTime); tagCompound.setInteger("CurrentTimePrintTime", currentItemPrintTime); return tagCompound; }
this.tagCompound.setShort( ITEM_TYPE_TAG, this.storedItems );
@Override protected void writeTypeSettingsToNbt(@Nonnull EnumFacing dir, @Nonnull NBTTagCompound dataRoot) { dataRoot.setShort("connectionMode", (short) getConnectionMode(dir).ordinal()); dataRoot.setShort("extractionSignalColor", (short) getExtractionSignalColor(dir).ordinal()); dataRoot.setShort("extractionRedstoneMode", (short) getExtractionRedstoneMode(dir).ordinal()); }
@Override protected void writeTypeSettingsToNbt(@Nonnull EnumFacing dir, @Nonnull NBTTagCompound dataRoot) { dataRoot.setShort("connectionMode", (short) forcedConnections.get(dir).ordinal()); dataRoot.setShort("inputSignalColor", (short) getInputSignalColor(dir).ordinal()); dataRoot.setShort("outputSignalColor", (short) getOutputSignalColor(dir).ordinal()); dataRoot.setBoolean("signalStrong", isOutputStrong(dir)); }
public void writeToNBT(NBTTagCompound root) { if (name.isEmpty()) { return; } root.setString("name", name); user.saveToNbt(root, "user"); root.setShort("type", (short) type.ordinal()); }
@Override public boolean writeConnectionSettingsToNBT(@Nonnull EnumFacing dir, @Nonnull NBTTagCompound nbt) { if (!getExternalConnections().contains(dir)) { return false; } NBTTagCompound dataRoot = getNbtRootForType(nbt, true); dataRoot.setShort("connectionMode", (short) getConnectionMode(dir).ordinal()); writeTypeSettingsToNbt(dir, dataRoot); return true; }
@Override protected void writeTypeSettingsToNbt(@Nonnull EnumFacing dir, @Nonnull NBTTagCompound dataRoot) { dataRoot.setShort("connectionMode", (short) getConnectionMode(dir).ordinal()); dataRoot.setShort("extractionSignalColor", (short) getExtractionSignalColor(dir).ordinal()); dataRoot.setShort("extractionRedstoneMode", (short) getExtractionRedstoneMode(dir).ordinal()); dataRoot.setShort("inputColor", (short) getInputColor(dir).ordinal()); dataRoot.setShort("outputColor", (short) getOutputColor(dir).ordinal()); dataRoot.setBoolean("selfFeed", isSelfFeedEnabled(dir)); dataRoot.setBoolean("roundRobin", isRoundRobinEnabled(dir)); dataRoot.setInteger("outputPriority", getOutputPriority(dir)); }
protected void writeSettingToNBT(NBTTagCompound nbtRoot) { nbtRoot.setByte("mode", (byte) mode.ordinal()); nbtRoot.setShort("level", (short) level); nbtRoot.setBoolean("sticky", sticky); }
@Override protected void writeTypeSettingsToNbt(@Nonnull EnumFacing dir, @Nonnull NBTTagCompound dataRoot) { super.writeTypeSettingsToNbt(dir, dataRoot); dataRoot.setShort("connectionMode", (short) getConnectionMode(dir).ordinal()); dataRoot.setShort("extractionSignalColor", (short) getExtractionSignalColor(dir).ordinal()); dataRoot.setShort("extractionRedstoneMode", (short) getExtractionRedstoneMode(dir).ordinal()); dataRoot.setShort("inputColor", (short) getInputColor(dir).ordinal()); dataRoot.setShort("outputColor", (short) getOutputColor(dir).ordinal()); dataRoot.setBoolean("selfFeed", isSelfFeedEnabled(dir)); dataRoot.setBoolean("roundRobin", isRoundRobinEnabled(dir)); dataRoot.setInteger("outputPriority", getOutputPriority(dir)); }
@Override public void writeToNBT(NBTTagCompound nbttagcompound) { dummyInventory.writeToNBT(nbttagcompound, ""); nbttagcompound.setShort("requestmode", (short) _requestMode.ordinal()); nbttagcompound.setShort("patternmode", (short) _patternMode.ordinal()); nbttagcompound.setBoolean("limited", isLimited()); for (int i = 0; i < 9; i++) { nbttagcompound.setInteger("slotArray_" + i, slotArray[i]); } }
@Override public SPacketUpdateTileEntity getUpdatePacket() { NBTTagCompound access = getUpdateTag(); access.setShort("RunTicks", (short) runTicks); access.setBoolean("IsPushing", pushing); return new SPacketUpdateTileEntity(pos, 1, access); }
@Override public @Nonnull NBTTagCompound fixTagCompound(@Nonnull NBTTagCompound compound) { String nameOld = MachineObject.block_tank.getRegistryName().toString(); String nameNew = MachineObject.block_tank.getRegistryName().toString(); if (nameOld.equals(compound.getString("id")) && compound.getShort("Damage") > 0) { compound.setString("id", nameNew); compound.setShort("Damage", (short) 0); } return compound; } }
@Override public NBTTagCompound writeToNBT(NBTTagCompound nbttagcompound) { nbttagcompound = super.writeToNBT(nbttagcompound); nbttagcompound.setString("UID", allele.getUID()); nbttagcompound.setShort("MT", maturity); nbttagcompound.setFloat("SP", yield); return nbttagcompound; }
@Override public NBTTagCompound getDefaultNBT() { NBTTagCompound nbt = new NBTTagCompound(); nbt.setDouble("e", energyStorage * 0.2); nbt.setByte("s", (byte) sBoot); nbt.setShort("c", (short) (bootTime)); nbt.setByte("d", (byte) 0); return nbt; }
data.setShort( "freq", this.getFrequency() );