From 7586aaf06e6315f564f95020c350bbb93e8fad89 Mon Sep 17 00:00:00 2001 From: FTB_lag Date: Fri, 9 Jan 2026 22:17:26 +0300 Subject: [PATCH] fix: re-checking recipe on load --- .../block/tile/CompactingDrawerTile.java | 14 ++++++++++++++ .../block/tile/SimpleCompactingDrawerTile.java | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/CompactingDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/CompactingDrawerTile.java index b3a762f5..7529b7d7 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/CompactingDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/CompactingDrawerTile.java @@ -9,6 +9,8 @@ import com.hrznstudio.titanium.block.BasicTileBlock; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.core.HolderLookup; +import net.minecraft.nbt.CompoundTag; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.player.Player; @@ -62,6 +64,18 @@ public boolean isLocked() { this.hasCheckedRecipes = false; } + @Override + public void loadAdditional(CompoundTag compound, HolderLookup.Provider provider) { + this.hasCheckedRecipes = compound.getBoolean("hasCheckedRecipes"); + super.loadAdditional(compound, provider); + } + + @Override + protected void saveAdditional(CompoundTag compoundTag, HolderLookup.Provider provider) { + super.saveAdditional(compoundTag, provider); + compoundTag.putBoolean("hasCheckedRecipes", this.hasCheckedRecipes); + } + @OnlyIn(Dist.CLIENT) @Override public void initClient() { diff --git a/src/main/java/com/buuz135/functionalstorage/block/tile/SimpleCompactingDrawerTile.java b/src/main/java/com/buuz135/functionalstorage/block/tile/SimpleCompactingDrawerTile.java index b5ade5af..769d1162 100644 --- a/src/main/java/com/buuz135/functionalstorage/block/tile/SimpleCompactingDrawerTile.java +++ b/src/main/java/com/buuz135/functionalstorage/block/tile/SimpleCompactingDrawerTile.java @@ -9,6 +9,8 @@ import com.hrznstudio.titanium.block.BasicTileBlock; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.core.HolderLookup; +import net.minecraft.nbt.CompoundTag; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.player.Player; @@ -62,6 +64,18 @@ public boolean isLocked() { this.hasCheckedRecipes = false; } + @Override + public void loadAdditional(CompoundTag compound, HolderLookup.Provider provider) { + this.hasCheckedRecipes = compound.getBoolean("hasCheckedRecipes"); + super.loadAdditional(compound, provider); + } + + @Override + protected void saveAdditional(CompoundTag compoundTag, HolderLookup.Provider provider) { + super.saveAdditional(compoundTag, provider); + compoundTag.putBoolean("hasCheckedRecipes", this.hasCheckedRecipes); + } + @OnlyIn(Dist.CLIENT) @Override public void initClient() {