Fixed /rn not working well with sea level very low.

This commit is contained in:
ryanhamshire 2015-04-13 20:21:58 -07:00
parent 22f3d0c00e
commit 7d81dc4f5e

View File

@ -155,7 +155,9 @@ class RestoreNatureProcessingTask implements Runnable
private void removePlayerLeaves() private void removePlayerLeaves()
{ {
for(int x = 1; x < snapshots.length - 1; x++) if(this.seaLevel < 1) return;
for(int x = 1; x < snapshots.length - 1; x++)
{ {
for(int z = 1; z < snapshots[0][0].length - 1; z++) for(int z = 1; z < snapshots[0][0].length - 1; z++)
{ {
@ -174,7 +176,9 @@ class RestoreNatureProcessingTask implements Runnable
private void fillBigHoles() private void fillBigHoles()
{ {
for(int x = 1; x < snapshots.length - 1; x++) if(this.seaLevel < 3) return;
for(int x = 1; x < snapshots.length - 1; x++)
{ {
for(int z = 1; z < snapshots[0][0].length - 1; z++) for(int z = 1; z < snapshots[0][0].length - 1; z++)
{ {
@ -235,7 +239,9 @@ class RestoreNatureProcessingTask implements Runnable
private void reduceStone() private void reduceStone()
{ {
for(int x = 1; x < snapshots.length - 1; x++) if(this.seaLevel < 1) return;
for(int x = 1; x < snapshots.length - 1; x++)
{ {
for(int z = 1; z < snapshots[0][0].length - 1; z++) for(int z = 1; z < snapshots[0][0].length - 1; z++)
{ {
@ -280,7 +286,9 @@ class RestoreNatureProcessingTask implements Runnable
private void reduceLogs() private void reduceLogs()
{ {
boolean jungleBiome = this.biome == Biome.JUNGLE || this.biome == Biome.JUNGLE_HILLS; if(this.seaLevel < 1) return;
boolean jungleBiome = this.biome == Biome.JUNGLE || this.biome == Biome.JUNGLE_HILLS;
//scan all blocks above sea level //scan all blocks above sea level
for(int x = 1; x < snapshots.length - 1; x++) for(int x = 1; x < snapshots.length - 1; x++)
@ -525,7 +533,7 @@ class RestoreNatureProcessingTask implements Runnable
do do
{ {
changed = false; changed = false;
for(int y = this.seaLevel - 10; y <= this.seaLevel; y++) for(int y = Math.max(this.seaLevel - 10, 0); y <= this.seaLevel; y++)
{ {
for(int x = 1; x < snapshots.length - 1; x++) for(int x = 1; x < snapshots.length - 1; x++)
{ {
@ -580,7 +588,9 @@ class RestoreNatureProcessingTask implements Runnable
private void removeDumpedFluids() private void removeDumpedFluids()
{ {
//remove any surface water or lava above sea level, presumed to be placed by players if(this.seaLevel < 1) return;
//remove any surface water or lava above sea level, presumed to be placed by players
//sometimes, this is naturally generated. but replacing it is very easy with a bucket, so overall this is a good plan //sometimes, this is naturally generated. but replacing it is very easy with a bucket, so overall this is a good plan
if(this.environment == Environment.NETHER) return; if(this.environment == Environment.NETHER) return;
for(int x = 1; x < snapshots.length - 1; x++) for(int x = 1; x < snapshots.length - 1; x++)