Java Code Examples for net.minecraft.nbt.compoundnbt#getByte()
The following examples show how to use
net.minecraft.nbt.compoundnbt#getByte() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RenderBlockTileEntity.java From MiningGadgets with MIT License | 5 votes |
@Override public void read(CompoundNBT tag) { super.read(tag); renderBlock = NBTUtil.readBlockState(tag.getCompound("renderBlock")); originalDurability = tag.getInt("originalDurability"); priorDurability = tag.getInt("priorDurability"); durability = tag.getInt("durability"); ticksSinceMine = tag.getInt("ticksSinceMine"); playerUUID = tag.getUniqueId("playerUUID"); gadgetUpgrades = UpgradeTools.getUpgradesFromTag(tag); breakType = MiningProperties.BreakTypes.values()[tag.getByte("breakType")]; gadgetFilters = MiningProperties.deserializeItemStackList(tag.getCompound("gadgetFilters")); gadgetIsWhitelist = tag.getBoolean("gadgetIsWhitelist"); blockAllowed = tag.getBoolean("blockAllowed"); }
Example 2
Source File: TileEnderTank.java From EnderStorage with MIT License | 5 votes |
@Override public void read(CompoundNBT tag) { super.read(tag); liquid_state.setFrequency(frequency); rotation = tag.getByte("rot") & 3; pressure_state.invert_redstone = tag.getBoolean("ir"); }
Example 3
Source File: EnderItemStorage.java From EnderStorage with MIT License | 5 votes |
public void loadFromTag(CompoundNBT tag) { size = tag.getByte("size"); empty(); InventoryUtils.readItemStacksFromTag(items, tag.getList("Items", 10)); if (size != EnderStorageConfig.storageSize) { alignSize(); } }
Example 4
Source File: MiningProperties.java From MiningGadgets with MIT License | 4 votes |
public static BreakTypes getBreakType(ItemStack gadget) { CompoundNBT compound = gadget.getOrCreateTag(); return !compound.contains(BREAK_TYPE) ? setBreakType(gadget, BreakTypes.SHRINK) : BreakTypes.values()[compound.getByte(BREAK_TYPE)]; }
Example 5
Source File: TileEnderChest.java From EnderStorage with MIT License | 4 votes |
@Override public void read(CompoundNBT tag) { super.read(tag); rotation = tag.getByte("rot") & 3; }