Restore blocks until correct block has been restored and verified
This commit is contained in:
parent
0dcf38ce2a
commit
c19e971e92
2 changed files with 15 additions and 12 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Reference in a new issue