diff --git a/src/main/java/com/minelittlepony/unicopia/server/world/Ether.java b/src/main/java/com/minelittlepony/unicopia/server/world/Ether.java index 1dd46a92..73ffa38d 100644 --- a/src/main/java/com/minelittlepony/unicopia/server/world/Ether.java +++ b/src/main/java/com/minelittlepony/unicopia/server/world/Ether.java @@ -25,7 +25,7 @@ public class Ether extends PersistentState { return WorldOverlay.getPersistableStorage(world, ID, Ether::new, Ether::new); } - private final Map, Map>>> endpoints; + private final Map>>> endpoints; private final Object locker = new Object(); @@ -33,7 +33,7 @@ public class Ether extends PersistentState { Ether(World world, NbtCompound compound) { this.world = world; - this.endpoints = NbtSerialisable.readMap(compound.getCompound("endpoints"), id -> SpellType.getKey(Identifier.tryParse(id)), typeNbt -> { + this.endpoints = NbtSerialisable.readMap(compound.getCompound("endpoints"), Identifier::tryParse, typeNbt -> { return NbtSerialisable.readMap((NbtCompound)typeNbt, UUID::fromString, entityNbt -> { return NbtSerialisable.readMap((NbtCompound)entityNbt, UUID::fromString, Entry::new); }); @@ -49,7 +49,7 @@ public class Ether extends PersistentState { public NbtCompound writeNbt(NbtCompound compound) { synchronized (locker) { pruneNodes(); - compound.put("endpoints", NbtSerialisable.writeMap(endpoints, type -> type.getId().toString(), entities -> { + compound.put("endpoints", NbtSerialisable.writeMap(endpoints, Identifier::toString, entities -> { return NbtSerialisable.writeMap(entities, UUID::toString, spells -> { return NbtSerialisable.writeMap(spells, UUID::toString, Entry::toNBT); }); @@ -62,7 +62,7 @@ public class Ether extends PersistentState { public Entry getOrCreate(T spell, Caster caster) { synchronized (locker) { Entry entry = (Entry)endpoints - .computeIfAbsent(spell.getTypeAndTraits().type(), typeId -> new HashMap<>()) + .computeIfAbsent(spell.getTypeAndTraits().type().getId(), typeId -> new HashMap<>()) .computeIfAbsent(caster.asEntity().getUuid(), entityId -> new HashMap<>()) .computeIfAbsent(spell.getUuid(), spellid -> { markDirty(); @@ -82,7 +82,7 @@ public class Ether extends PersistentState { public void remove(SpellType spellType, UUID entityId) { synchronized (locker) { - endpoints.computeIfPresent(spellType, (typeId, entries) -> { + endpoints.computeIfPresent(spellType.getId(), (typeId, entries) -> { if (entries.remove(entityId) != null) { markDirty(); }