@Override public NBTTagCompound write(NBTTagCompound tag) { super.write(tag); tag.setUniqueId(NBT_ID, storageId); return tag; }
@Override public NBTTagCompound write(NBTTagCompound tag) { super.write(tag); tag.setUniqueId(NBT_ID, storageId); return tag; }
@Override public NBTTagCompound write(NBTTagCompound tag) { super.write(tag); tag.setInteger(NBT_TAB_PAGE, tabPage); if (tabSelected.isPresent()) { tag.setUniqueId(NBT_TAB_SELECTED, tabSelected.get()); } return tag; }
@Override public NBTTagCompound writeToNBT(NBTTagCompound compound) { super.writeToNBT(compound); if(hasOwner()) { compound.setUniqueId("owner", this.owner); } return compound; }
@Override public void writeTile(NBTTagCompound nbt, NBTType type){ if (this.getPlayerUUID() != null && selectedQuestId != null) { nbt.setUniqueId(NBT_PLAYER_UUID, this.getPlayerUUID()); nbt.setUniqueId(NBT_QUEST, this.getQuestUUID()); nbt.setByte(NBT_TASK, (byte) selectedTask); } }
@Override public void writeToNBT(NBTTagCompound nbt) { Optional<UUID> breederID = getBreederID(); if (breederID.isPresent()) { nbt.setUniqueId(NBT_BREEDER, breederID.get()); } nbt.setInteger(NBT_REPRO_COUNT, getReproCount()); }
@Override public void setId(ItemStack disk, UUID id) { disk.setTagCompound(new NBTTagCompound()); disk.getTagCompound().setUniqueId(NBT_ID, id); }
@Override public void onUpdate(ItemStack stack, World world, Entity entity, int f, boolean f1) { if (stack.getTagCompound() == null) { stack.setTagCompound(new NBTTagCompound()); stack.getTagCompound().setUniqueId("HiveUUID", new UUID(0,0)); } }
@Override public void writeSyncableNBT(NBTTagCompound compound, NBTType type){ super.writeSyncableNBT(compound, type); this.storage.writeToNBT(compound); if(this.connectedPlayer != null && type != NBTType.SAVE_BLOCK){ compound.setUniqueId("Player", this.connectedPlayer); compound.setString("PlayerName", this.playerName); } }
public static void writeData(NBTTagCompound nbt, SyncType type) { NBTTagList research = new NBTTagList(); for (Entry<UUID, ArrayList<IResearch>> entry : PlayerResearchRegistry.research.entrySet()) { NBTTagCompound playerTag = new NBTTagCompound(); playerTag.setUniqueId(UUID, entry.getKey()); writePlayerData(entry.getValue(), playerTag, type); research.appendTag(playerTag); } if (!research.hasNoTags()) { nbt.setTag(LIST, research); } }
@Override public NBTTagCompound write(NBTTagCompound tag) { if (owner != null) { tag.setUniqueId(NBT_OWNER, owner); } tag.setString(NBT_VERSION, RS.VERSION); tag.setInteger(NBT_DIRECTION, direction.ordinal()); writeConfiguration(tag); return tag; }
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); }
private NBTTagCompound writeToNBT() { NBTTagCompound tag = new NBTTagCompound(); NBTTagList entryList = new NBTTagList(); NBTTagCompound idTag; for (UUID id : ids) { idTag = new NBTTagCompound(); idTag.setUniqueId("uuid", id); entryList.appendTag(idTag); } tag.setTag("entryList", entryList); return tag; }
public NBTTagCompound writeToNBT(NBTTagCompound compound) { super.writeToNBT(compound); compound.setInteger("HouseType", houseType); compound.setBoolean("HasPixie", hasPixie); compound.setInteger("PixieType", pixieType); compound.setBoolean("TamedPixie", tamedPixie); if (pixieOwnerUUID != null) { compound.setUniqueId("PixieOwnerUUID", pixieOwnerUUID); } ItemStackHelper.saveAllItems(compound, this.pixieItems); return compound; }
@SideOnly(Side.CLIENT) public static void sendBookSelectTaskUpdate(QuestTask task){ NBTTagCompound nbt = new NBTTagCompound(); nbt.setUniqueId("QuestId", task.getParent().getQuestId()); nbt.setInteger("TaskId", task.getId()); BOOK_SELECT_TASK.sendMessageToServer(nbt); }
@Override public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) { TileStorage storage = (TileStorage) world.getTileEntity(pos); ItemStack stack = new ItemStack(this, 1, getMetaFromState(state)); stack.setTagCompound(new NBTTagCompound()); stack.getTagCompound().setUniqueId(NetworkNodeStorage.NBT_ID, storage.getNode().getStorageId()); drops.add(stack); } }
@Override public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) { TileFluidStorage storage = (TileFluidStorage) world.getTileEntity(pos); ItemStack stack = new ItemStack(this, 1, getMetaFromState(state)); stack.setTagCompound(new NBTTagCompound()); stack.getTagCompound().setUniqueId(NetworkNodeFluidStorage.NBT_ID, storage.getNode().getStorageId()); drops.add(stack); } }
@SubscribeEvent public static void attackEntityEvent(AttackEntityEvent event) { if (event.getEntityPlayer() == null || event.getEntityPlayer().world.isRemote) { return; } ItemStack stack = event.getEntityPlayer().getHeldItemMainhand(); if (INSTANCE.hasAnyUpgradeVariant(stack) && EnergyUpgradeManager.getEnergyStored(stack) > 0) { event.getTarget().getEntityData().setUniqueId(HIT_BY_DIRECT, event.getEntityPlayer().getUniqueID()); } }
public static void migrateFluidStorageBlockItem(World world, ItemStack stack) { if (stack.hasTagCompound() && stack.getTagCompound().hasKey(NBT_STORAGE)) { NBTTagCompound storageTag = stack.getTagCompound().getCompoundTag(NBT_STORAGE); stack.setTagCompound(new NBTTagCompound()); stack.getTagCompound().setUniqueId(NetworkNodeStorage.NBT_ID, createFluidDisk(world, FluidStorageType.getById(stack.getItemDamage()).getCapacity(), storageTag)); } } }
public static void migrateItemStorageBlockItem(World world, ItemStack stack) { if (stack.hasTagCompound() && stack.getTagCompound().hasKey(NBT_STORAGE)) { NBTTagCompound storageTag = stack.getTagCompound().getCompoundTag(NBT_STORAGE); stack.setTagCompound(new NBTTagCompound()); stack.getTagCompound().setUniqueId(NetworkNodeStorage.NBT_ID, createItemDisk(world, ItemStorageType.getById(stack.getItemDamage()).getCapacity(), storageTag)); } }