Search in sources :

Example 1 with TAG_MAX_CITIZENS

use of com.minecolonies.api.util.constant.NbtTagConstants.TAG_MAX_CITIZENS in project minecolonies by Minecolonies.

the class CitizenManager method writeToNBT.

@Override
public void writeToNBT(@NotNull final NBTTagCompound compound) {
    compound.setInteger(TAG_MAX_CITIZENS, maxCitizens);
    @NotNull final NBTTagList citizenTagList = citizens.values().stream().map(citizen -> citizen.writeToNBT(new NBTTagCompound())).collect(NBTUtils.toNBTTagList());
    compound.setTag(TAG_CITIZENS, citizenTagList);
}
Also used : NBTTagList(net.minecraft.nbt.NBTTagList) java.util(java.util) ColonyUtils(com.minecolonies.coremod.util.ColonyUtils) TAG_MAX_CITIZENS(com.minecolonies.api.util.constant.NbtTagConstants.TAG_MAX_CITIZENS) Constants(net.minecraftforge.common.util.Constants) Function(java.util.function.Function) EntityPlayerMP(net.minecraft.entity.player.EntityPlayerMP) CitizenData(com.minecolonies.coremod.colony.CitizenData) EntityCitizen(com.minecolonies.coremod.entity.EntityCitizen) NBTTagList(net.minecraft.nbt.NBTTagList) EntityUtils(com.minecolonies.api.util.EntityUtils) Log(com.minecolonies.api.util.Log) Constants(com.minecolonies.api.util.constant.Constants) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) LanguageHandler(com.minecolonies.api.util.LanguageHandler) Colony(com.minecolonies.coremod.colony.Colony) World(net.minecraft.world.World) ColonyViewRemoveCitizenMessage(com.minecolonies.coremod.network.messages.ColonyViewRemoveCitizenMessage) BlockPos(net.minecraft.util.math.BlockPos) Collectors(java.util.stream.Collectors) com.minecolonies.coremod.colony.buildings(com.minecolonies.coremod.colony.buildings) Nullable(org.jetbrains.annotations.Nullable) MineColonies(com.minecolonies.coremod.MineColonies) ColonyConstants(com.minecolonies.api.util.constant.ColonyConstants) NBTUtils(com.minecolonies.api.util.NBTUtils) ColonyViewCitizenViewMessage(com.minecolonies.coremod.network.messages.ColonyViewCitizenViewMessage) TAG_CITIZENS(com.minecolonies.api.util.constant.NbtTagConstants.TAG_CITIZENS) TickEvent(net.minecraftforge.fml.common.gameevent.TickEvent) NotNull(org.jetbrains.annotations.NotNull) Configurations(com.minecolonies.api.configuration.Configurations) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

Configurations (com.minecolonies.api.configuration.Configurations)1 EntityUtils (com.minecolonies.api.util.EntityUtils)1 LanguageHandler (com.minecolonies.api.util.LanguageHandler)1 Log (com.minecolonies.api.util.Log)1 NBTUtils (com.minecolonies.api.util.NBTUtils)1 ColonyConstants (com.minecolonies.api.util.constant.ColonyConstants)1 Constants (com.minecolonies.api.util.constant.Constants)1 TAG_CITIZENS (com.minecolonies.api.util.constant.NbtTagConstants.TAG_CITIZENS)1 TAG_MAX_CITIZENS (com.minecolonies.api.util.constant.NbtTagConstants.TAG_MAX_CITIZENS)1 MineColonies (com.minecolonies.coremod.MineColonies)1 CitizenData (com.minecolonies.coremod.colony.CitizenData)1 Colony (com.minecolonies.coremod.colony.Colony)1 com.minecolonies.coremod.colony.buildings (com.minecolonies.coremod.colony.buildings)1 EntityCitizen (com.minecolonies.coremod.entity.EntityCitizen)1 ColonyViewCitizenViewMessage (com.minecolonies.coremod.network.messages.ColonyViewCitizenViewMessage)1 ColonyViewRemoveCitizenMessage (com.minecolonies.coremod.network.messages.ColonyViewRemoveCitizenMessage)1 ColonyUtils (com.minecolonies.coremod.util.ColonyUtils)1 java.util (java.util)1 Function (java.util.function.Function)1 Collectors (java.util.stream.Collectors)1