Search in sources :

Example 16 with DimensionDescriptor

use of mcjty.rftoolsdim.dimensions.description.DimensionDescriptor in project RFToolsDimensions by McJty.

the class RfToolsDimensionManager method readFromNBT.

@Override
public void readFromNBT(NBTTagCompound tagCompound) {
    dimensions.clear();
    dimensionToID.clear();
    dimensionInformation.clear();
    reclaimedIds.clear();
    NBTTagList lst = tagCompound.getTagList("dimensions", Constants.NBT.TAG_COMPOUND);
    for (int i = 0; i < lst.tagCount(); i++) {
        NBTTagCompound tc = lst.getCompoundTagAt(i);
        int id = tc.getInteger("id");
        DimensionDescriptor descriptor = new DimensionDescriptor(tc);
        dimensions.put(id, descriptor);
        dimensionToID.put(descriptor, id);
        DimensionInformation dimensionInfo = new DimensionInformation(descriptor, tc);
        dimensionInformation.put(id, dimensionInfo);
    }
    int[] lstIds = tagCompound.getIntArray("reclaimedIds");
    for (int id : lstIds) {
        reclaimedIds.add(id);
    }
}
Also used : NBTTagList(net.minecraft.nbt.NBTTagList) DimensionDescriptor(mcjty.rftoolsdim.dimensions.description.DimensionDescriptor) NBTTagCompound(net.minecraft.nbt.NBTTagCompound)

Aggregations

DimensionDescriptor (mcjty.rftoolsdim.dimensions.description.DimensionDescriptor)16 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)6 ItemStack (net.minecraft.item.ItemStack)5 RfToolsDimensionManager (mcjty.rftoolsdim.dimensions.RfToolsDimensionManager)4 ArrayList (java.util.ArrayList)3 DimensionInformation (mcjty.rftoolsdim.dimensions.DimensionInformation)3 DimletKey (mcjty.rftoolsdim.dimensions.dimlets.DimletKey)3 EntityPlayer (net.minecraft.entity.player.EntityPlayer)3 NBTTagList (net.minecraft.nbt.NBTTagList)3 TextComponentString (net.minecraft.util.text.TextComponentString)3 Map (java.util.Map)2 Settings (mcjty.rftoolsdim.config.Settings)2 PacketBuffer (net.minecraft.network.PacketBuffer)2 ClassInheritanceMultiMap (net.minecraft.util.ClassInheritanceMultiMap)2 WorldServer (net.minecraft.world.WorldServer)2 IOException (java.io.IOException)1 HashMap (java.util.HashMap)1 DimensionStorage (mcjty.rftoolsdim.dimensions.DimensionStorage)1 TerrainType (mcjty.rftoolsdim.dimensions.types.TerrainType)1 BlockPos (net.minecraft.util.math.BlockPos)1