Search in sources :

Example 6 with PortalCoordinatesContainer

use of net.tslat.aoa3.library.misc.PortalCoordinatesContainer in project Advent-Of-Ascension by Tslat.

the class PlayerDataManager method saveToNBT.

public NBTTagCompound saveToNBT() {
    NBTTagCompound baseTag = new NBTTagCompound();
    stats.saveToNBT(baseTag);
    if (!portalCoordinatesMap.isEmpty()) {
        NBTTagCompound portalCoordinatesNBT = new NBTTagCompound();
        for (Map.Entry<Integer, PortalCoordinatesContainer> entry : portalCoordinatesMap.entrySet()) {
            NBTTagCompound portalReturnTag = new NBTTagCompound();
            PortalCoordinatesContainer container = entry.getValue();
            portalReturnTag.setInteger("FromDim", container.fromDim);
            portalReturnTag.setDouble("PosX", container.x);
            portalReturnTag.setDouble("PosY", container.y);
            portalReturnTag.setDouble("PosZ", container.z);
            portalCoordinatesNBT.setTag(entry.getKey().toString(), portalReturnTag);
        }
        baseTag.setTag("PortalMap", portalCoordinatesNBT);
    }
    return baseTag;
}
Also used : PortalCoordinatesContainer(net.tslat.aoa3.library.misc.PortalCoordinatesContainer) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) Map(java.util.Map) HashMap(java.util.HashMap)

Aggregations

PortalCoordinatesContainer (net.tslat.aoa3.library.misc.PortalCoordinatesContainer)6 PlayerDataManager (net.tslat.aoa3.utils.player.PlayerDataManager)4 BlockPos (net.minecraft.util.math.BlockPos)3 EntityPlayer (net.minecraft.entity.player.EntityPlayer)2 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)2 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Block (net.minecraft.block.Block)1 ChunkPos (net.minecraft.util.math.ChunkPos)1 WorldProvider (net.minecraft.world.WorldProvider)1 WorldServer (net.minecraft.world.WorldServer)1 ITeleporter (net.minecraftforge.common.util.ITeleporter)1 PortalBlock (net.tslat.aoa3.block.functional.portal.PortalBlock)1 AoAWorldProvider (net.tslat.aoa3.dimension.AoAWorldProvider)1 NetherTeleporter (net.tslat.aoa3.dimension.nether.NetherTeleporter)1