Skip to content

Commit 19759c2

Browse files
committed
Fix HoF recipe not syncing when set to null
1 parent adcb684 commit 19759c2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

common/src/main/java/dev/itsmeow/whisperwoods/blockentity/HandOfFateBlockEntity.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ public Item getDisplayItem() {
339339
}
340340

341341
public void read(CompoundTag nbt) {
342-
if (nbt.contains("recipe")) {
342+
if (nbt.contains("recipe") && !"empty".equals(nbt.getString("recipe"))) {
343343
this.setRecipe(RECIPES.getOrDefault(nbt.getString("recipe"), null));
344344
if (this.data != null) {
345345
this.data.read(nbt);
@@ -355,6 +355,8 @@ public CompoundTag write(CompoundTag compound) {
355355
if (this.data != null) {
356356
this.data.write(compound);
357357
}
358+
} else {
359+
compound.putString("recipe", "empty");
358360
}
359361
return compound;
360362
}

0 commit comments

Comments
 (0)