mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-27 05:05:18 +01:00
Make superflat check more accurate
Will allow fix superflat to run in SkyGrid. https://github.com/BentoBoxWorld/SkyGrid/issues/22
This commit is contained in:
parent
2403cd201f
commit
10b8c51aee
@ -111,15 +111,11 @@ public class CleanSuperFlatListener extends FlagListener {
|
||||
if (!ready) {
|
||||
return true;
|
||||
}
|
||||
// Clean super flat does not work if the world handles its own generator explicitly
|
||||
if (getIWM().inWorld(world) && Flags.CLEAN_SUPER_FLAT.isSetForWorld(world) && getIWM().isUseOwnGenerator(world)) {
|
||||
Flags.CLEAN_SUPER_FLAT.setSetting(world, false);
|
||||
getPlugin().logWarning("Clean super flat is not available for " + world.getName());
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!getIWM().inWorld(world) || !Flags.CLEAN_SUPER_FLAT.isSetForWorld(world) ||
|
||||
(!e.getChunk().getBlock(0, 0, 0).getType().equals(Material.BEDROCK)
|
||||
(!(e.getChunk().getBlock(0, 0, 0).getType().equals(Material.BEDROCK)
|
||||
&& e.getChunk().getBlock(0, 1, 0).getType().equals(Material.DIRT)
|
||||
&& e.getChunk().getBlock(0, 2, 0).getType().equals(Material.DIRT)
|
||||
&& e.getChunk().getBlock(0, 3, 0).getType().equals(Material.GRASS_BLOCK))
|
||||
|| (world.getEnvironment().equals(Environment.NETHER) && (!plugin.getIWM().isNetherGenerate(world)
|
||||
|| !plugin.getIWM().isNetherIslands(world)))
|
||||
|| (world.getEnvironment().equals(Environment.THE_END) && (!plugin.getIWM().isEndGenerate(world)
|
||||
|
@ -101,7 +101,8 @@ public class CleanSuperFlatListenerTest {
|
||||
chunk = mock(Chunk.class);
|
||||
when(chunk.getWorld()).thenReturn(world);
|
||||
block = mock(Block.class);
|
||||
when(block.getType()).thenReturn(Material.BEDROCK);
|
||||
// Super flat!
|
||||
when(block.getType()).thenReturn(Material.BEDROCK, Material.DIRT, Material.DIRT, Material.GRASS_BLOCK);
|
||||
when(chunk.getBlock(Mockito.anyInt(), Mockito.anyInt(), Mockito.anyInt())).thenReturn(block);
|
||||
|
||||
// Fire the ready event
|
||||
|
Loading…
Reference in New Issue
Block a user