mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-09-28 06:37:30 +02:00
Fixes clean super-flat issue from 1.19 worlds
In 1.19 worlds it was fixed that super-flat worlds are generated at min-height, instead at 0. This change keeps the previous super-flat chunk generation until 1.18 is dropped.
This commit is contained in:
parent
d50208c0e1
commit
87a6799cd1
@ -116,17 +116,35 @@ public class CleanSuperFlatListener extends FlagListener {
|
||||
* @return true if the chunk should not be cleaned
|
||||
*/
|
||||
private boolean noClean(World world, ChunkLoadEvent e) {
|
||||
if (!ready) {
|
||||
if (!this.ready)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return !getIWM().inWorld(world) || !Flags.CLEAN_SUPER_FLAT.isSetForWorld(world) ||
|
||||
(!(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)
|
||||
|| !plugin.getIWM().isEndIslands(world))));
|
||||
|
||||
// Check if super-flat must even be working.
|
||||
if (!this.getIWM().inWorld(world) ||
|
||||
!Flags.CLEAN_SUPER_FLAT.isSetForWorld(world) ||
|
||||
world.getEnvironment().equals(Environment.NETHER) &&
|
||||
(!plugin.getIWM().isNetherGenerate(world) || !plugin.getIWM().isNetherIslands(world)) ||
|
||||
world.getEnvironment().equals(Environment.THE_END) &&
|
||||
(!plugin.getIWM().isEndGenerate(world) || !plugin.getIWM().isEndIslands(world)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check if bottom is a super-flat chunk.
|
||||
int minHeight = world.getMinHeight();
|
||||
|
||||
// Due to flat super flat chunk generation changes in 1.19, they now are generated properly at the world min.
|
||||
// Extra check for 0-4 can be removed with 1.18 dropping.
|
||||
|
||||
return !(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)) ||
|
||||
!(e.getChunk().getBlock(0, minHeight, 0).getType().equals(Material.BEDROCK) &&
|
||||
e.getChunk().getBlock(0, minHeight + 1, 0).getType().equals(Material.DIRT) &&
|
||||
e.getChunk().getBlock(0, minHeight + 2, 0).getType().equals(Material.DIRT) &&
|
||||
e.getChunk().getBlock(0, minHeight + 3, 0).getType().equals(Material.GRASS_BLOCK));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user