@Override public void readFromNBT(NBTTagCompound compound) { super.readFromNBT(compound); owner = compound.getUniqueId("owner"); }
public static Set<UUID> getUniqueIdSet(NBTBase tag) { NBTTagList tagList = getTagList(tag, Constants.NBT.TAG_COMPOUND); Set<UUID> ret = new HashSet<>(); for (NBTBase element : tagList) { ret.add(((NBTTagCompound) element).getUniqueId("uuid")); } return ret; }
@Override public void receiveData(EntityPlayer player, NBTTagCompound nbt){ QuestingData data = QuestingData.getQuestingData(player); data.selectedQuestId = nbt.getUniqueId("QuestId"); data.selectedTask = nbt.getInteger("TaskId"); } },
public static Relationship readFromNBT(NBTTagCompound compound) { UUID uuid = compound.getUniqueId("UUID"); short score = compound.getShort("Score"); return new Relationship(uuid, score); }
private void readFromNBT(NBTTagCompound tag, boolean client) { NBTTagList entryList = tag.getTagList("entryList", Constants.NBT.TAG_COMPOUND); NBTTagCompound idTag; for (int i = 0; i < entryList.tagCount(); i++) { idTag = entryList.getCompoundTagAt(i); ids.add(idTag.getUniqueId("uuid")); } }
public EntityAINearestAttackableTargetFiltered(EntityCreature creature, Class<T> classTarget, int chance, boolean checkSight, boolean onlyNearby, @Nullable final Predicate<? super T> targetSelector) { super(creature, checkSight, onlyNearby); this.targetClass = classTarget; this.targetChance = chance; this.sorter = new EntityAINearestAttackableTarget.Sorter(creature); this.setMutexBits(1); UUID exclude = creature.getEntityData().getUniqueId("owner"); this.targetEntitySelector = (Predicate<T>) entity -> (entity != null && !entity.getUniqueID().equals(exclude)) && (targetSelector == null || targetSelector.apply(entity) && (EntitySelectors.NOT_SPECTATING.apply(entity) && EntityAINearestAttackableTargetFiltered.this.isSuitableTarget(entity, false))); }
public static Optional<UUID> getTabSelected(ItemStack stack) { if (stack.hasTagCompound() && stack.getTagCompound().hasUniqueId(NBT_TAB_SELECTED)) { return Optional.of(stack.getTagCompound().getUniqueId(NBT_TAB_SELECTED)); } return Optional.absent(); }
public static void readData(NBTTagCompound nbt, SyncType type) { NBTTagList research = nbt.getTagList(LIST, 10); for (int i = 0; i < research.tagCount(); i++) { NBTTagCompound playerTag = research.getCompoundTagAt(i); PlayerResearchRegistry.research.put(playerTag.getUniqueId(UUID), readPlayerData(playerTag, type)); } }
@Override public void read(NBTTagCompound tag) { super.read(tag); if (tag.hasKey(NBT_TAB_PAGE)) { tabPage = tag.getInteger(NBT_TAB_PAGE); } if (tag.hasUniqueId(NBT_TAB_SELECTED)) { tabSelected = Optional.of(tag.getUniqueId(NBT_TAB_SELECTED)); } }
public static Owner deserializeFromNBT(NBTTagCompound tag) { if (tag.hasKey(OWNER_NAME_TAG)) { //noinspection ConstantConditions - NBTTagCompound has getUniqueId marked as Nullable incorrectly return new Owner(tag.getUniqueId(OWNER_ID_TAG), tag.getString(OWNER_NAME_TAG)); } return Owner.EMPTY; }
@Override public void receiveData(EntityPlayer player, NBTTagCompound nbt){ UUID groupId = nbt.getUniqueId("GroupId"); int bag = nbt.getInteger("Bag"); int[] limits = nbt.getIntArray("Limits"); GuiReward.open(player, groupId, bag, limits); } };
@Override public void read(NBTTagCompound tag) { super.read(tag); if (tag.hasUniqueId(NBT_ID)) { storageId = tag.getUniqueId(NBT_ID); loadStorage(); } OneSixMigrationHelper.migrateItemStorageBlock(this, tag); }
@Override public void readSyncableNBT(NBTTagCompound compound, NBTType type){ super.readSyncableNBT(compound, type); this.storage.readFromNBT(compound); if(compound.hasKey("PlayerLeast") && type != NBTType.SAVE_BLOCK){ this.connectedPlayer = compound.getUniqueId("Player"); this.playerName = compound.getString("PlayerName"); } }
@Override public void read(NBTTagCompound tag) { super.read(tag); if (tag.hasUniqueId(NBT_ID)) { storageId = tag.getUniqueId(NBT_ID); loadStorage(); } OneSixMigrationHelper.migrateFluidStorageBlock(this, tag); }
public static Router fromTag(BlockPos pos, NBTTagCompound tag) { Router router = new Router(pos); router.routerId = tag.getUniqueId("id"); NBTTagList deviceList = tag.getTagList("network_devices", Constants.NBT.TAG_COMPOUND); for(int i = 0; i < deviceList.tagCount(); i++) { NetworkDevice device = NetworkDevice.fromTag(deviceList.getCompoundTagAt(i)); router.NETWORK_DEVICES.put(device.getId(), device); } return router; }
public void readFromNBT(NBTTagCompound compound) { houseType = compound.getInteger("HouseType"); hasPixie = compound.getBoolean("HasPixie"); pixieType = compound.getInteger("PixieType"); tamedPixie = compound.getBoolean("TamedPixie"); pixieOwnerUUID = compound.getUniqueId("TicksExisted"); this.pixieItems = NonNullList.<ItemStack>withSize(1, ItemStack.EMPTY); ItemStackHelper.loadAllItems(compound, pixieItems); super.readFromNBT(compound); }
@Override public void readEntityFromNBT(NBTTagCompound tag) { super.readEntityFromNBT(tag); this.setJungle(tag.getBoolean("Jungle")); this.setMyrmexAge(tag.getInteger("MyrmexAge")); this.setMyrmexCaste(tag.getInteger("MyrmexCaste")); hiveUUID = tag.getUniqueId("hiveUUID"); }
public void readFromNBT(NBTTagCompound compound) { hasPixie = compound.getBoolean("HasPixie"); pixieType = compound.getInteger("PixieType"); hasProduced = compound.getBoolean("HasProduced"); ticksExisted = compound.getInteger("TicksExisted"); tamedPixie = compound.getBoolean("TamedPixie"); pixieOwnerUUID = compound.getUniqueId("PixieOwnerUUID"); this.pixieItems = NonNullList.<ItemStack>withSize(1, ItemStack.EMPTY); ItemStackHelper.loadAllItems(compound, pixieItems); super.readFromNBT(compound); }
@Override public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack) { if (!world.isRemote) { NetworkNodeStorage storage = ((TileStorage) world.getTileEntity(pos)).getNode(); if (stack.hasTagCompound() && stack.getTagCompound().hasUniqueId(NetworkNodeStorage.NBT_ID)) { storage.setStorageId(stack.getTagCompound().getUniqueId(NetworkNodeStorage.NBT_ID)); } storage.loadStorage(); } // Call this after loading the storage, so the network discovery can use the loaded storage. super.onBlockPlacedBy(world, pos, state, player, stack); }
@Override public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack) { if (!world.isRemote) { NetworkNodeFluidStorage storage = ((TileFluidStorage) world.getTileEntity(pos)).getNode(); if (stack.hasTagCompound() && stack.getTagCompound().hasUniqueId(NetworkNodeFluidStorage.NBT_ID)) { storage.setStorageId(stack.getTagCompound().getUniqueId(NetworkNodeFluidStorage.NBT_ID)); } storage.loadStorage(); } // Call this after loading the storage, so the network discovery can use the loaded storage. super.onBlockPlacedBy(world, pos, state, player, stack); }