Search in sources :

Example 1 with SpellObjectManager

use of com.teamwizardry.wizardry.api.SpellObjectManager in project Wizardry by TeamWizardry.

the class StandardWizardryWorld method deserializeNBT.

@Override
public void deserializeNBT(NBTTagCompound compound) {
    if (compound.hasKey("spell_object_manager")) {
        spellObjectManager = new SpellObjectManager();
        spellObjectManager.manager.fromNbt(compound.getCompoundTag("spell_object_manager"));
    }
    if (compound.hasKey("drives")) {
        NBTTagList driveNBT = compound.getTagList("drives", Constants.NBT.TAG_COMPOUND);
        for (NBTBase base : driveNBT) {
            if (base instanceof NBTTagCompound) {
                if (((NBTTagCompound) base).hasKey("pos") && ((NBTTagCompound) base).hasKey("drive")) {
                    BlockPos pos = BlockPos.fromLong(((NBTTagCompound) base).getLong("pos"));
                    NemezTracker tracker = new NemezTracker();
                    tracker.deserializeNBT(((NBTTagCompound) base).getTagList("drive", Constants.NBT.TAG_COMPOUND));
                    blockNemezDrives.put(pos, tracker);
                }
            }
        }
    }
}
Also used : NBTTagList(net.minecraft.nbt.NBTTagList) NBTBase(net.minecraft.nbt.NBTBase) NemezTracker(com.teamwizardry.wizardry.common.core.nemez.NemezTracker) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) BlockPos(net.minecraft.util.math.BlockPos) SpellObjectManager(com.teamwizardry.wizardry.api.SpellObjectManager)

Aggregations

SpellObjectManager (com.teamwizardry.wizardry.api.SpellObjectManager)1 NemezTracker (com.teamwizardry.wizardry.common.core.nemez.NemezTracker)1 NBTBase (net.minecraft.nbt.NBTBase)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1 NBTTagList (net.minecraft.nbt.NBTTagList)1 BlockPos (net.minecraft.util.math.BlockPos)1