diff --git a/plugin.yml b/plugin.yml index a16aa01..fff1f8f 100644 --- a/plugin.yml +++ b/plugin.yml @@ -2,7 +2,7 @@ name: GriefPrevention main: me.ryanhamshire.GriefPrevention.GriefPrevention softdepend: [Vault, Multiverse-Core, My Worlds, MystCraft, Transporter] dev-url: http://dev.bukkit.org/server-mods/grief-prevention -version: 7.0 +version: 7.0.1 commands: abandonclaim: description: Deletes a claim. diff --git a/src/me/ryanhamshire/GriefPrevention/BlockEventHandler.java b/src/me/ryanhamshire/GriefPrevention/BlockEventHandler.java index 144c640..b0c5c27 100644 --- a/src/me/ryanhamshire/GriefPrevention/BlockEventHandler.java +++ b/src/me/ryanhamshire/GriefPrevention/BlockEventHandler.java @@ -554,6 +554,12 @@ public class BlockEventHandler implements Listener if(!GriefPrevention.instance.config_fireSpreads && igniteEvent.getCause() != IgniteCause.FLINT_AND_STEEL && igniteEvent.getCause() != IgniteCause.LIGHTNING) { igniteEvent.setCancelled(true); + + Block underBlock = igniteEvent.getBlock().getRelative(BlockFace.DOWN); + if(underBlock.getType() != Material.NETHERRACK) + { + igniteEvent.getBlock().setType(Material.AIR); + } } } @@ -566,6 +572,13 @@ public class BlockEventHandler implements Listener if(!GriefPrevention.instance.config_fireSpreads) { spreadEvent.setCancelled(true); + + Block underBlock = spreadEvent.getBlock().getRelative(BlockFace.DOWN); + if(underBlock.getType() != Material.NETHERRACK) + { + spreadEvent.getBlock().setType(Material.AIR); + } + return; } @@ -590,6 +603,13 @@ public class BlockEventHandler implements Listener if(!GriefPrevention.instance.config_fireDestroys) { burnEvent.setCancelled(true); + + Block underBlock = burnEvent.getBlock().getRelative(BlockFace.DOWN); + if(underBlock.getType() != Material.NETHERRACK) + { + burnEvent.getBlock().setType(Material.AIR); + } + return; } diff --git a/src/me/ryanhamshire/GriefPrevention/CleanupUnusedClaimsTask.java b/src/me/ryanhamshire/GriefPrevention/CleanupUnusedClaimsTask.java index d7893c0..f795aa0 100644 --- a/src/me/ryanhamshire/GriefPrevention/CleanupUnusedClaimsTask.java +++ b/src/me/ryanhamshire/GriefPrevention/CleanupUnusedClaimsTask.java @@ -207,7 +207,7 @@ class CleanupUnusedClaimsTask implements Runnable } //unfortunately, java/minecraft don't do a good job of clearing unused memory, leading to out of memory errors from this type of world scanning - if(this.nextClaimIndex % 10 == 0) + if(this.nextClaimIndex % 5 == 0) { System.gc(); } diff --git a/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java b/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java index 12fa2fb..782ce17 100644 --- a/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java +++ b/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java @@ -1464,7 +1464,10 @@ public class GriefPrevention extends JavaPlugin //if another player isn't specified, assume current player if(args.length < 1) { - otherPlayer = player; + if(player != null) + otherPlayer = player; + else + return false; } //otherwise if no permission to delve into another player's claims data diff --git a/src/me/ryanhamshire/GriefPrevention/RestoreNatureExecutionTask.java b/src/me/ryanhamshire/GriefPrevention/RestoreNatureExecutionTask.java index 427b832..2ce620d 100644 --- a/src/me/ryanhamshire/GriefPrevention/RestoreNatureExecutionTask.java +++ b/src/me/ryanhamshire/GriefPrevention/RestoreNatureExecutionTask.java @@ -62,7 +62,7 @@ class RestoreNatureExecutionTask implements Runnable Claim cachedClaim = null; for(int x = 1; x < this.snapshots.length - 1; x++) { - for(int z = 1; z < this.snapshots[0][0].length; z++) + for(int z = 1; z < this.snapshots[0][0].length - 1; z++) { for(int y = this.miny; y < this.snapshots[0].length; y++) {