Fix downwards scannign to respect VOID_AIR

This commit is contained in:
Maxopoly
2020-04-22 11:10:53 +02:00
parent de3424e5ff
commit 9c6585b0e9
2 changed files with 4 additions and 3 deletions

View File

@@ -49,7 +49,7 @@
<dependency>
<groupId>vg.civcraft.mc.civmodcore</groupId>
<artifactId>CivModCore</artifactId>
<version>1.7.7</version>
<version>1.7.8</version>
<scope>provided</scope>
</dependency>
</dependencies>

View File

@@ -23,6 +23,7 @@ import com.wimbli.WorldBorder.WorldBorder;
import me.josvth.randomspawn.handlers.CommandHandler;
import me.josvth.randomspawn.handlers.YamlHandler;
import me.josvth.randomspawn.listeners.*;
import vg.civcraft.mc.civmodcore.api.MaterialAPI;
public class RandomSpawn extends JavaPlugin {
@@ -222,7 +223,7 @@ public class RandomSpawn extends JavaPlugin {
if (world.getEnvironment() == Environment.NETHER) {
Material blockYMat = world.getBlockAt((int)x,(int) y,(int) z).getType();
Material blockY2Mat = world.getBlockAt((int)x,(int) y+1,(int) z).getType();
while (y < 128 && !(blockYMat == Material.AIR && blockY2Mat == Material.AIR)) {
while (y < 128 && !(MaterialAPI.isAir(blockYMat) && MaterialAPI.isAir(blockY2Mat))) {
y++;
blockYMat = blockY2Mat;
blockY2Mat = world.getBlockAt((int)x,(int) y+1,(int) z).getType();
@@ -231,7 +232,7 @@ public class RandomSpawn extends JavaPlugin {
return -1;
} else {
y = 257;
while (y >= 0 && blockMat == Material.AIR) {
while (y >= 0 && MaterialAPI.isAir(blockMat)) {
y--;
blockMat = world.getBlockAt((int)x,(int) y,(int) z).getType();
}