diff --git a/gradle.properties b/gradle.properties index f216427..40969a3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -53,7 +53,7 @@ mod_name=Zontreck's Library Mod # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. mod_license=GPLv3 # The mod version. See https://semver.org/ -mod_version=1201.13.042524.0321 +mod_version=1201.13.042524.0327 # The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. # This should match the base package used for the mod sources. # See https://maven.apache.org/guides/mini/guide-naming-conventions.html diff --git a/src/main/java/dev/zontreck/libzontreck/memory/world/BlockRestoreQueue.java b/src/main/java/dev/zontreck/libzontreck/memory/world/BlockRestoreQueue.java index 9c8c2ab..530b61c 100644 --- a/src/main/java/dev/zontreck/libzontreck/memory/world/BlockRestoreQueue.java +++ b/src/main/java/dev/zontreck/libzontreck/memory/world/BlockRestoreQueue.java @@ -147,21 +147,24 @@ public abstract class BlockRestoreQueue PrimitiveBlock block = PrimitiveBlock.deserialize(NbtIo.read(dis)); - try { - res.deleteRow(); - if (!res.rowDeleted()) { + if(block.level.getBlockState(block.position).is(block.blockType)) + { + try { + res.deleteRow(); + if (!res.rowDeleted()) { + + } + } catch (SQLException e001) { + PreparedStatement pstat = DatabaseWrapper.get().prepareStatement("DELETE FROM `blocks` WHERE queueName=? AND posX=? AND posY=? AND posZ=?;"); + pstat.setString(1, getRestoreQueueName()); + pstat.setInt(2, block.position.getX()); + pstat.setInt(3, block.position.getY()); + pstat.setInt(4, block.position.getZ()); + DatabaseWrapper.get().executePreparedStatement(pstat); } - } catch (SQLException e001) { - PreparedStatement pstat = DatabaseWrapper.get().prepareStatement("DELETE FROM `blocks` WHERE queueName=? AND posX=? AND posY=? AND posZ=?;"); - pstat.setString(1, getRestoreQueueName()); - pstat.setInt(2, block.position.getX()); - pstat.setInt(3, block.position.getY()); - pstat.setInt(4, block.position.getZ()); - DatabaseWrapper.get().executePreparedStatement(pstat); } - return block; } else return null;