Prepare for 1.16.1 release.

- Added nether and the end biome sections in config.
This commit is contained in:
BONNe 2020-06-28 11:12:27 +03:00
parent dd59556dc0
commit 93ee3cdd33
4 changed files with 104 additions and 14 deletions

View File

@ -45,7 +45,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<!-- More visible way how to change dependency versions -->
<spigot.version>1.15.2-R0.1-SNAPSHOT</spigot.version>
<spigot.version>1.16.1-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>1.14.0-SNAPSHOT</bentobox.version>
<!-- Revision variable removes warning about dynamic version -->
<revision>${build.version}-SNAPSHOT</revision>

View File

@ -1860,6 +1860,50 @@ public class Settings implements WorldSettings
}
/**
* Method Settings#getDefaultNetherBiome returns the defaultNetherBiome of this object.
*
* @return the defaultNetherBiome (type Biome) of this object.
*/
public Biome getDefaultNetherBiome()
{
return defaultNetherBiome;
}
/**
* Method Settings#setDefaultNetherBiome sets new value for the defaultNetherBiome of this object.
* @param defaultNetherBiome new value for this object.
*
*/
public void setDefaultNetherBiome(Biome defaultNetherBiome)
{
this.defaultNetherBiome = defaultNetherBiome;
}
/**
* Method Settings#getDefaultTheEndBiome returns the defaultTheEndBiome of this object.
*
* @return the defaultTheEndBiome (type Biome) of this object.
*/
public Biome getDefaultTheEndBiome()
{
return defaultTheEndBiome;
}
/**
* Method Settings#setDefaultTheEndBiome sets new value for the defaultTheEndBiome of this object.
* @param defaultTheEndBiome new value for this object.
*
*/
public void setDefaultTheEndBiome(Biome defaultTheEndBiome)
{
this.defaultTheEndBiome = defaultTheEndBiome;
}
// ---------------------------------------------------------------------
// Section: Variables
// ---------------------------------------------------------------------
@ -2009,6 +2053,10 @@ public class Settings implements WorldSettings
@ConfigEntry(path = "world.nether.caves", needsReset = true)
private boolean netherIslands = true;
@ConfigComment("The default biome for the nether world (this may affect what mobs can spawn)")
@ConfigEntry(path = "world.nether.biome", since = "1.14.0")
private Biome defaultNetherBiome = Biome.NETHER_WASTES;
@ConfigComment("Nether spawn protection radius - this is the distance around the nether spawn")
@ConfigComment("that will be protected from player interaction (breaking blocks, pouring lava etc.)")
@ConfigComment("Minimum is 0 (not recommended), maximum is 100. Default is 25.")
@ -2026,7 +2074,7 @@ public class Settings implements WorldSettings
@ConfigComment("Main block of which world will be generated.")
@ConfigEntry(path = "world.nether.main-block", needsReset = true)
private Material netherMainBlock = Material.STONE;
private Material netherMainBlock = Material.NETHERRACK;
@ConfigComment("Blocks that will occasionally replace main block by random chance.")
@ConfigComment("Blocks will replace only main-block and will try to create packs that")
@ -2047,6 +2095,10 @@ public class Settings implements WorldSettings
@ConfigEntry(path = "world.end.caves", needsReset = true)
private boolean endIslands = true;
@ConfigComment("The default biome for the end world (this may affect what mobs can spawn)")
@ConfigEntry(path = "world.end.biome", since = "1.14.0")
private Biome defaultTheEndBiome = Biome.THE_END;
@ConfigEntry(path = "world.end.dragon-spawn", experimental = true)
private boolean dragonSpawn = false;
@ -2060,7 +2112,7 @@ public class Settings implements WorldSettings
@ConfigComment("Main block of which world will be generated.")
@ConfigEntry(path = "world.end.main-block", needsReset = true)
private Material endMainBlock = Material.STONE;
private Material endMainBlock = Material.END_STONE;
@ConfigComment("Blocks that will occasionally replace main block by random chance.")
@ConfigComment("Blocks will replace only main-block and will try to create packs that")

View File

@ -78,15 +78,15 @@ public class ChunkGeneratorWorld extends ChunkGenerator
// Populate chunk with necessary information
if (world.getEnvironment().equals(World.Environment.NETHER))
{
this.populateNetherChunk(result);
this.populateNetherChunk(world, result, biomeGrid);
}
else if (world.getEnvironment().equals(World.Environment.THE_END))
{
this.populateTheEndChunk(result);
this.populateTheEndChunk(world, result, biomeGrid);
}
else
{
this.populateOverWorldChunk(result, biomeGrid);
this.populateOverWorldChunk(world, result, biomeGrid);
}
return result;
@ -95,9 +95,11 @@ public class ChunkGeneratorWorld extends ChunkGenerator
/**
* This method populates The End world chunk data.
* @param world world where chunks are generated.
* @param chunkData ChunkData that must be populated.
* @param biomeGrid BiomeGrid for this chunk.
*/
private void populateTheEndChunk(ChunkData chunkData)
private void populateTheEndChunk(World world, ChunkData chunkData, BiomeGrid biomeGrid)
{
// because everything starts at 0 and ends at 255
final int worldHeight = this.settings.getWorldDepth();
@ -114,14 +116,28 @@ public class ChunkGeneratorWorld extends ChunkGenerator
chunkData.setRegion(0, worldHeight - 1, 0,
16, worldHeight, 16,
this.settings.isEndRoof() ? Material.BEDROCK : this.settings.getEndMainBlock());
// Set biome
for (int x = 0; x < 16; x += 4)
{
for (int y = 0; y < world.getMaxHeight(); y += 4)
{
for (int z = 0; z < 16; z += 4)
{
biomeGrid.setBiome(x, y, z, this.settings.getDefaultNetherBiome());
}
}
}
}
/**
* This method populates nether world chunk data.
* @param world world where chunks are generated.
* @param chunkData ChunkData that must be populated.
* @param biomeGrid BiomeGrid for this chunk.
*/
private void populateNetherChunk(ChunkData chunkData)
private void populateNetherChunk(World world, ChunkData chunkData, BiomeGrid biomeGrid)
{
// because everything starts at 0 and ends at 255
final int worldHeight = this.settings.getWorldDepth();
@ -138,15 +154,28 @@ public class ChunkGeneratorWorld extends ChunkGenerator
chunkData.setRegion(0, worldHeight - 1, 0,
16, worldHeight, 16,
this.settings.isNetherRoof() ? Material.BEDROCK : this.settings.getNetherMainBlock());
// Set biome
for (int x = 0; x < 16; x += 4)
{
for (int y = 0; y < world.getMaxHeight(); y += 4)
{
for (int z = 0; z < 16; z += 4)
{
biomeGrid.setBiome(x, y, z, this.settings.getDefaultNetherBiome());
}
}
}
}
/**
* This method populates Over world chunk data.
* @param world world where chunks are generated.
* @param chunkData ChunkData that must be populated.
* @param biomeGrid BiomeGrid for this chunk.
*/
private void populateOverWorldChunk(ChunkData chunkData, BiomeGrid biomeGrid)
private void populateOverWorldChunk(World world, ChunkData chunkData, BiomeGrid biomeGrid)
{
// because everything starts at 0 and ends at 255
final int worldHeight = this.settings.getWorldDepth();
@ -165,11 +194,14 @@ public class ChunkGeneratorWorld extends ChunkGenerator
this.settings.isNormalRoof() ? Material.BEDROCK : this.settings.getNormalMainBlock());
// Set biome
for (int x = 0; x < 16; x++)
for (int x = 0; x < 16; x += 4)
{
for (int z = 0; z < 16; z++)
for (int y = 0; y < world.getMaxHeight(); y += 4)
{
biomeGrid.setBiome(x, z, this.settings.getDefaultBiome());
for (int z = 0; z < 16; z += 4)
{
biomeGrid.setBiome(x, y, z, this.settings.getDefaultBiome());
}
}
}
}

View File

@ -1,4 +1,4 @@
# CaveBlock Configuration 1.13.0
# CaveBlock Configuration 1.14.0-SNAPSHOT-LOCAL
caveblock:
command:
# Cave Command. What command users will run to access their cave.
@ -120,6 +120,9 @@ world:
# Caves in Nether. Change to false for standard vanilla nether.
# /!\ BentoBox currently does not support changing this value mid-game. If you do need to change it, do a full reset of your databases and worlds.
caves: true
# The default biome for the nether world (this may affect what mobs can spawn)
# Added since 1.14.0.
biome: NETHER_WASTES
# Nether spawn protection radius - this is the distance around the nether spawn
# that will be protected from player interaction (breaking blocks, pouring lava etc.)
# Minimum is 0 (not recommended), maximum is 100. Default is 25.
@ -159,6 +162,9 @@ world:
generate: true
# /!\ BentoBox currently does not support changing this value mid-game. If you do need to change it, do a full reset of your databases and worlds.
caves: true
# The default biome for the end world (this may affect what mobs can spawn)
# Added since 1.14.0.
biome: THE_END
# /!\ This feature is experimental and might not work as expected or might not work at all.
dragon-spawn: false
# Make over world roof of bedrock, if false, it will be made from stone
@ -188,7 +194,7 @@ world:
remove-mobs-whitelist:
- WITHER
- ENDERMAN
- PIG_ZOMBIE
- ZOMBIFIED_PIGLIN
- ZOMBIE_VILLAGER
# World flags. These are boolean settings for various flags for this world
flags: