From c69ea7932992270b637d01fb935e881d10bc2aee Mon Sep 17 00:00:00 2001 From: Intelli Date: Sun, 6 Mar 2022 17:05:18 -0700 Subject: [PATCH] Fixed rollbacks not skipping processing for identical blocks --- src/main/java/net/coreprotect/database/Rollback.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/coreprotect/database/Rollback.java b/src/main/java/net/coreprotect/database/Rollback.java index f12323a..9a36e3f 100644 --- a/src/main/java/net/coreprotect/database/Rollback.java +++ b/src/main/java/net/coreprotect/database/Rollback.java @@ -531,13 +531,18 @@ public class Rollback extends Queue { if ((rowType == changeType) && ((!BukkitAdapter.ADAPTER.isItemFrame(oldTypeMaterial)) && (oldTypeMaterial != Material.PAINTING) && (oldTypeMaterial != Material.ARMOR_STAND)) && (oldTypeMaterial != Material.END_CRYSTAL)) { // block is already changed! - if (blockData != null) { - if (blockData.getAsString().equals(changeBlockData.getAsString()) || blockData instanceof MultipleFacing || blockData instanceof Stairs || blockData instanceof RedstoneWire) { + BlockData checkData = rowType == Material.AIR ? blockData : rawBlockData; + if (checkData != null) { + if (checkData.getAsString().equals(changeBlockData.getAsString()) || checkData instanceof MultipleFacing || checkData instanceof Stairs || checkData instanceof RedstoneWire) { if (rowType != Material.CHEST && rowType != Material.TRAPPED_CHEST) { // always update double chests changeBlock = false; } } } + else if (rowType == Material.AIR) { + changeBlock = false; + } + countBlock = false; } else if ((changeType != Material.AIR) && (changeType != Material.CAVE_AIR)) {