use of wraith.waystones.access.WaystoneValue in project FabricWaystones by LordDeatHunter.
the class WaystoneStorage method toTag.
public NbtCompound toTag(NbtCompound tag) {
if (tag == null) {
tag = new NbtCompound();
}
NbtList waystones = new NbtList();
for (Map.Entry<String, WaystoneValue> waystone : WAYSTONES.entrySet()) {
String hash = waystone.getKey();
WaystoneValue entity = waystone.getValue();
NbtCompound waystoneTag = new NbtCompound();
waystoneTag.putString("hash", hash);
waystoneTag.putString("name", entity.getWaystoneName());
BlockPos pos = entity.way_getPos();
waystoneTag.putIntArray("position", Arrays.asList(pos.getX(), pos.getY(), pos.getZ()));
waystoneTag.putString("dimension", entity.getWorldName());
waystones.add(waystoneTag);
}
tag.put("waystones", waystones);
NbtList globals = new NbtList();
var globalWaystones = getGlobals();
for (String globalWaystone : globalWaystones) {
globals.add(NbtString.of(globalWaystone));
}
tag.put("global_waystones", globals);
return tag;
}
Aggregations