use of net.minecraft.nbt.NbtLongArray in project Astromine by Mixinors.
the class WorldHoloBridgeComponent method writeToNbt.
/**
* Serializes this {@link WorldHoloBridgeComponent} to a {@link NbtCompound}.
*/
@Override
public void writeToNbt(NbtCompound tag) {
var dataTag = new NbtList();
for (var entry : entries.long2ObjectEntrySet()) {
var pointTag = new NbtCompound();
var vecs = new long[entry.getValue().size()];
var i = 0;
for (var vec : entry.getValue()) {
vecs[i++] = BlockPos.asLong(vec.getX(), vec.getY(), vec.getZ());
}
pointTag.putLong("Positions", entry.getLongKey());
pointTag.put("Vectors", new NbtLongArray(vecs));
dataTag.add(pointTag);
}
tag.put("Data", dataTag);
}
Aggregations