From ee857f3a834f5ff85ada53a0062d3a39b210a417 Mon Sep 17 00:00:00 2001 From: ryanhamshire Date: Wed, 15 Jun 2016 08:52:17 -0700 Subject: [PATCH] Fix partial nature restorations. Were occurring in select situations. --- .../GriefPrevention/RestoreNatureExecutionTask.java | 10 ++++++++-- .../GriefPrevention/RestoreNatureProcessingTask.java | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/me/ryanhamshire/GriefPrevention/RestoreNatureExecutionTask.java b/src/me/ryanhamshire/GriefPrevention/RestoreNatureExecutionTask.java index 4776f69..20af989 100644 --- a/src/me/ryanhamshire/GriefPrevention/RestoreNatureExecutionTask.java +++ b/src/me/ryanhamshire/GriefPrevention/RestoreNatureExecutionTask.java @@ -80,8 +80,14 @@ class RestoreNatureExecutionTask implements Runnable break; } - currentBlock.setTypeId(blockUpdate.typeId); - currentBlock.setData(blockUpdate.data); + try + { + currentBlock.setTypeIdAndData(blockUpdate.typeId, blockUpdate.data, false); + } + catch(IllegalArgumentException e) + { + //just don't update this block and continue trying to update other blocks + } } } } diff --git a/src/me/ryanhamshire/GriefPrevention/RestoreNatureProcessingTask.java b/src/me/ryanhamshire/GriefPrevention/RestoreNatureProcessingTask.java index 211b548..23f10ac 100644 --- a/src/me/ryanhamshire/GriefPrevention/RestoreNatureProcessingTask.java +++ b/src/me/ryanhamshire/GriefPrevention/RestoreNatureProcessingTask.java @@ -608,6 +608,7 @@ class RestoreNatureProcessingTask implements Runnable if(block.typeId != Material.AIR.getId() && !(ignoreLeaves && block.typeId == Material.SNOW.getId()) && !(ignoreLeaves && block.typeId == Material.LEAVES.getId()) && + !(ignoreLeaves && block.typeId == Material.LEAVES_2.getId()) && !(block.typeId == Material.STATIONARY_WATER.getId()) && !(block.typeId == Material.WATER.getId()) && !(block.typeId == Material.LAVA.getId()) &&