This commit is contained in:
petrak@ 2022-11-20 21:36:55 -06:00
parent 2878dcb0c1
commit ef176058ea

View file

@ -232,13 +232,13 @@ public class PatternRegistry {
/**
* Maps angle sigs to resource locations and their preferred start dir so we can look them up in the main registry
* Save this on the world in case the random algorithm changes.
*/
public static class Save extends SavedData {
private static final String TAG_OP_ID = "op_id";
private static final String TAG_START_DIR = "start_dir";
// TODO: this is slightly weird that we save it *on* the world
// might it be better to recalculate it every time the world loads?
// Maps hex signatures to (op ids, canonical start dir)
private Map<String, Pair<ResourceLocation, HexDir>> lookup;
private boolean missingEntries;
@ -279,7 +279,7 @@ public class PatternRegistry {
public CompoundTag save(CompoundTag tag) {
this.lookup.forEach((sig, rhs) -> {
var entry = new CompoundTag();
entry.putString(TAG_OP_ID, sig.toString());
entry.putString(TAG_OP_ID, rhs.getFirst().toString());
entry.putInt(TAG_START_DIR, rhs.getSecond().ordinal());
tag.put(sig, entry);
});