Search in sources :

Example 1 with NBTCompoundObjects

use of ivorius.ivtoolkit.tools.NBTCompoundObjects in project RecurrentComplex by Ivorforce.

the class SavedMazeReachability method writeToNBT.

@Override
public void writeToNBT(NBTTagCompound compound) {
    NBTTagLists.writeTo(compound, "groups", Lists.transform(groups, NBTCompoundObjects::writeList));
    NBTTagLists.writeTo(compound, "crossConnections", Lists.transform(crossConnections, input -> {
        NBTTagCompound compound1 = new NBTTagCompound();
        NBTCompoundObjects.writeTo(compound1, "key", input.getKey());
        NBTCompoundObjects.writeTo(compound1, "val", input.getValue());
        return compound1;
    }));
    compound.setBoolean("groupByDefault", groupByDefault);
}
Also used : NBTCompoundObject(ivorius.ivtoolkit.tools.NBTCompoundObject) NBTTagLists(ivorius.ivtoolkit.tools.NBTTagLists) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) java.util(java.util) TypeToken(com.google.gson.reflect.TypeToken) AxisAlignedTransform2D(ivorius.ivtoolkit.math.AxisAlignedTransform2D) Predicate(java.util.function.Predicate) Selection(ivorius.reccomplex.world.gen.feature.structure.generic.Selection) Collectors(java.util.stream.Collectors) Sets(com.google.common.collect.Sets) ImmutablePair(org.apache.commons.lang3.tuple.ImmutablePair) Lists(com.google.common.collect.Lists) Stream(java.util.stream.Stream) Type(java.lang.reflect.Type) Predicates(com.google.common.base.Predicates) ivorius.ivtoolkit.maze.components(ivorius.ivtoolkit.maze.components) ImmutableMultimap(com.google.common.collect.ImmutableMultimap) com.google.gson(com.google.gson) NBTCompoundObjects(ivorius.ivtoolkit.tools.NBTCompoundObjects) JsonUtils(ivorius.reccomplex.json.JsonUtils) ImmutableSetMultimap(com.google.common.collect.ImmutableSetMultimap) NBTTagCompound(net.minecraft.nbt.NBTTagCompound)

Aggregations

Predicates (com.google.common.base.Predicates)1 ImmutableMultimap (com.google.common.collect.ImmutableMultimap)1 ImmutableSetMultimap (com.google.common.collect.ImmutableSetMultimap)1 Lists (com.google.common.collect.Lists)1 Sets (com.google.common.collect.Sets)1 com.google.gson (com.google.gson)1 TypeToken (com.google.gson.reflect.TypeToken)1 AxisAlignedTransform2D (ivorius.ivtoolkit.math.AxisAlignedTransform2D)1 ivorius.ivtoolkit.maze.components (ivorius.ivtoolkit.maze.components)1 NBTCompoundObject (ivorius.ivtoolkit.tools.NBTCompoundObject)1 NBTCompoundObjects (ivorius.ivtoolkit.tools.NBTCompoundObjects)1 NBTTagLists (ivorius.ivtoolkit.tools.NBTTagLists)1 JsonUtils (ivorius.reccomplex.json.JsonUtils)1 Selection (ivorius.reccomplex.world.gen.feature.structure.generic.Selection)1 Type (java.lang.reflect.Type)1 java.util (java.util)1 Predicate (java.util.function.Predicate)1 Collectors (java.util.stream.Collectors)1 Stream (java.util.stream.Stream)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1