From e564ab0beb9f87f22f417a4b25439ba6169fb98f Mon Sep 17 00:00:00 2001 From: someaddons Date: Sun, 4 Jan 2026 21:37:04 +0100 Subject: [PATCH 1/3] Improve undo to only skip on wrong block instead of blockstate --- .../java/com/ldtteam/structurize/util/ChangeStorage.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/ldtteam/structurize/util/ChangeStorage.java b/src/main/java/com/ldtteam/structurize/util/ChangeStorage.java index 201659430..e38ea289a 100644 --- a/src/main/java/com/ldtteam/structurize/util/ChangeStorage.java +++ b/src/main/java/com/ldtteam/structurize/util/ChangeStorage.java @@ -2,11 +2,11 @@ import com.ldtteam.structurize.Structurize; import com.ldtteam.structurize.management.Manager; +import net.minecraft.core.BlockPos; +import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; -import net.minecraft.nbt.CompoundTag; -import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; import org.jetbrains.annotations.Nullable; @@ -128,7 +128,7 @@ public boolean undo(final Level world, @Nullable final ChangeStorage undoStorage { final Map.Entry entry = iterator.next(); // Only revert block changes which this operation caused - if (world.getBlockState(entry.getKey()) != entry.getValue().getPostState()) + if (world.getBlockState(entry.getKey()).getBlock() != entry.getValue().getPostState().getBlock()) { continue; } From ec2ed4d0c8661f33d87187145168afc6991d9c3a Mon Sep 17 00:00:00 2001 From: someaddons Date: Sun, 4 Jan 2026 21:46:29 +0100 Subject: [PATCH 2/3] add DO compat --- src/main/java/com/ldtteam/structurize/util/ChangeStorage.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/ldtteam/structurize/util/ChangeStorage.java b/src/main/java/com/ldtteam/structurize/util/ChangeStorage.java index e38ea289a..270de5ce6 100644 --- a/src/main/java/com/ldtteam/structurize/util/ChangeStorage.java +++ b/src/main/java/com/ldtteam/structurize/util/ChangeStorage.java @@ -128,7 +128,8 @@ public boolean undo(final Level world, @Nullable final ChangeStorage undoStorage { final Map.Entry entry = iterator.next(); // Only revert block changes which this operation caused - if (world.getBlockState(entry.getKey()).getBlock() != entry.getValue().getPostState().getBlock()) + if (world.getBlockState(entry.getKey()).getBlock() != entry.getValue().getPostState().getBlock() + || entry.getValue().getPostTE() != world.getBlockEntity(entry.getKey())) { continue; } From efa7e8173342722cacaf527fe6296bfb8fd8c8bb Mon Sep 17 00:00:00 2001 From: someaddons Date: Sun, 4 Jan 2026 23:08:31 +0100 Subject: [PATCH 3/3] Fix itemstorage hash --- .../java/com/ldtteam/structurize/api/util/ItemStorage.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/api/java/com/ldtteam/structurize/api/util/ItemStorage.java b/src/api/java/com/ldtteam/structurize/api/util/ItemStorage.java index 2aca7beb3..bdbd740a0 100644 --- a/src/api/java/com/ldtteam/structurize/api/util/ItemStorage.java +++ b/src/api/java/com/ldtteam/structurize/api/util/ItemStorage.java @@ -174,9 +174,7 @@ public boolean ignoreNBTValue() @Override public int hashCode() { - return Objects.hash(stack.getItem()) - + (this.shouldIgnoreDamageValue ? 0 : (this.stack.getDamageValue() * 31)) - + (this.shouldIgnoreNBTValue ? 0 : ((this.stack.serializeNBT() == null) ? 0 : this.stack.serializeNBT().hashCode())); + return Objects.hash(stack.getItem()); } @Override