Fabric Waystones

Fabric Waystones

16M Downloads

[Bug] Revoking ownership will crash when pressing save

Fourmisain opened this issue ยท 0 comments

commented

Here's the mentioned bug I ran into: Revoking ownership will null the owner (I assume), which will then crash when trying to put it into the NbtCompound here:

UUID owner = ((WaystoneScreenHandler)handler).getOwner();
if (name == null) {
name = "";
}
((WaystoneScreenHandler)handler).setName(name);
PacketByteBuf data = new PacketByteBuf(Unpooled.buffer());
NbtCompound tag = new NbtCompound();
tag.putString("waystone_name", name);
tag.putString("waystone_hash", hash);
tag.putUuid("waystone_owner", owner);

Not sure what's the easiest fix - using the 0 UUID to mean "no owner" would probably be good enough, alternatively another boolean field could be stored which indicates whether the owner UUID is set or not.