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 diff --git a/src/main/java/com/ldtteam/structurize/util/ChangeStorage.java b/src/main/java/com/ldtteam/structurize/util/ChangeStorage.java index 201659430..270de5ce6 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,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()) != entry.getValue().getPostState()) + if (world.getBlockState(entry.getKey()).getBlock() != entry.getValue().getPostState().getBlock() + || entry.getValue().getPostTE() != world.getBlockEntity(entry.getKey())) { continue; }