Search in sources :

Example 6 with IntTriple

use of com.fastasyncworldedit.core.math.IntTriple in project FastAsyncWorldEdit by IntellectualSites.

the class DiskOptimizedClipboard method setTile.

@Override
public boolean setTile(int x, int y, int z, CompoundTag tag) {
    final Map<String, Tag> values = new HashMap<>(tag.getValue());
    values.put("x", new IntTag(x));
    values.put("y", new IntTag(y));
    values.put("z", new IntTag(z));
    nbtMap.put(new IntTriple(x, y, z), new CompoundTag(values));
    return true;
}
Also used : HashMap(java.util.HashMap) IntTag(com.sk89q.jnbt.IntTag) CompoundTag(com.sk89q.jnbt.CompoundTag) Tag(com.sk89q.jnbt.Tag) IntTriple(com.fastasyncworldedit.core.math.IntTriple) IntTag(com.sk89q.jnbt.IntTag) CompoundTag(com.sk89q.jnbt.CompoundTag)

Example 7 with IntTriple

use of com.fastasyncworldedit.core.math.IntTriple in project FastAsyncWorldEdit by IntellectualSites.

the class CPUOptimizedClipboard method convertTilesToIndex.

public void convertTilesToIndex() {
    if (nbtMapLoc.isEmpty()) {
        return;
    }
    for (Map.Entry<IntTriple, CompoundTag> entry : nbtMapLoc.entrySet()) {
        IntTriple key = entry.getKey();
        setTile(getIndex(key.x(), key.y(), key.z()), entry.getValue());
    }
    nbtMapLoc.clear();
}
Also used : IntTriple(com.fastasyncworldedit.core.math.IntTriple) HashMap(java.util.HashMap) Map(java.util.Map) CompoundTag(com.sk89q.jnbt.CompoundTag)

Aggregations

IntTriple (com.fastasyncworldedit.core.math.IntTriple)7 CompoundTag (com.sk89q.jnbt.CompoundTag)5 HashMap (java.util.HashMap)5 Map (java.util.Map)3 MutableBlockVector3 (com.fastasyncworldedit.core.math.MutableBlockVector3)2 IntTag (com.sk89q.jnbt.IntTag)2 Tag (com.sk89q.jnbt.Tag)2 BlockVector3 (com.sk89q.worldedit.math.BlockVector3)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1