Search in sources :

Example 1 with SaveMethodGetter

use of com.teamwizardry.librarianlib.features.saving.SaveMethodGetter in project Wizardry by TeamWizardry.

the class PacketWorktableUpdate method manualSaveSetter.

@SaveMethodGetter(saveName = "manual_saver")
private NBTTagCompound manualSaveSetter() {
    NBTTagCompound compound = new NBTTagCompound();
    if (components == null || links == null)
        return compound;
    NBTTagList list = new NBTTagList();
    for (Map.Entry<SpellRing, UUID> entrySet : components.entrySet()) {
        NBTTagCompound compound1 = new NBTTagCompound();
        compound1.setTag("ring", entrySet.getKey().serializeNBT());
        compound1.setString("uuid", entrySet.getValue().toString());
        list.appendTag(compound1);
    }
    compound.setTag("components", list);
    list = new NBTTagList();
    for (Map.Entry<UUID, UUID> entrySet : links.entrySet()) {
        NBTTagCompound compound1 = new NBTTagCompound();
        compound1.setString("uuid1", entrySet.getKey().toString());
        compound1.setString("uuid2", entrySet.getValue().toString());
        list.appendTag(compound1);
    }
    compound.setTag("links", list);
    return compound;
}
Also used : NBTTagList(net.minecraft.nbt.NBTTagList) SpellRing(com.teamwizardry.wizardry.api.spell.SpellRing) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) UUID(java.util.UUID) HashMap(java.util.HashMap) Map(java.util.Map) SaveMethodGetter(com.teamwizardry.librarianlib.features.saving.SaveMethodGetter)

Example 2 with SaveMethodGetter

use of com.teamwizardry.librarianlib.features.saving.SaveMethodGetter in project Wizardry by TeamWizardry.

the class PacketRenderSpell method getter.

@SaveMethodGetter(saveName = "module_saver")
public NBTTagCompound getter() {
    NBTTagCompound compound = new NBTTagCompound();
    if (spellData == null || spellRing == null)
        return compound;
    compound.setTag("spell_data", spellData);
    compound.setTag("spell_ring", spellRing.serializeNBT());
    return compound;
}
Also used : NBTTagCompound(net.minecraft.nbt.NBTTagCompound) SaveMethodGetter(com.teamwizardry.librarianlib.features.saving.SaveMethodGetter)

Aggregations

SaveMethodGetter (com.teamwizardry.librarianlib.features.saving.SaveMethodGetter)2 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)2 SpellRing (com.teamwizardry.wizardry.api.spell.SpellRing)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 UUID (java.util.UUID)1 NBTTagList (net.minecraft.nbt.NBTTagList)1