Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/com/ldtteam/structurize/util/ChangeStorage.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -128,7 +128,8 @@ public boolean undo(final Level world, @Nullable final ChangeStorage undoStorage
{
final Map.Entry<BlockPos, BlockChangeData> 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()))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the TE reference check?

{
continue;
}
Expand Down