From dd59556dc0d90930a0291f3653c43aab06f6a0fd Mon Sep 17 00:00:00 2001 From: BONNe Date: Fri, 1 May 2020 23:33:12 +0300 Subject: [PATCH 1/5] Increment development version. --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 850e134..9fdd888 100644 --- a/pom.xml +++ b/pom.xml @@ -46,11 +46,11 @@ 1.8 1.15.2-R0.1-SNAPSHOT - 1.13.0 + 1.14.0-SNAPSHOT ${build.version}-SNAPSHOT - 1.13.0 + 1.14.0 -LOCAL From 93ee3cdd33ca36ba8e5211de2ff10d4c369c8941 Mon Sep 17 00:00:00 2001 From: BONNe Date: Sun, 28 Jun 2020 11:12:27 +0300 Subject: [PATCH 2/5] Prepare for 1.16.1 release. - Added nether and the end biome sections in config. --- pom.xml | 2 +- .../world/bentobox/caveblock/Settings.java | 56 ++++++++++++++++++- .../generators/ChunkGeneratorWorld.java | 50 ++++++++++++++--- src/main/resources/config.yml | 10 +++- 4 files changed, 104 insertions(+), 14 deletions(-) diff --git a/pom.xml b/pom.xml index 9fdd888..c4064a5 100644 --- a/pom.xml +++ b/pom.xml @@ -45,7 +45,7 @@ UTF-8 1.8 - 1.15.2-R0.1-SNAPSHOT + 1.16.1-R0.1-SNAPSHOT 1.14.0-SNAPSHOT ${build.version}-SNAPSHOT diff --git a/src/main/java/world/bentobox/caveblock/Settings.java b/src/main/java/world/bentobox/caveblock/Settings.java index a52a1bf..c317d76 100644 --- a/src/main/java/world/bentobox/caveblock/Settings.java +++ b/src/main/java/world/bentobox/caveblock/Settings.java @@ -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") diff --git a/src/main/java/world/bentobox/caveblock/generators/ChunkGeneratorWorld.java b/src/main/java/world/bentobox/caveblock/generators/ChunkGeneratorWorld.java index 63916ae..75e4c02 100644 --- a/src/main/java/world/bentobox/caveblock/generators/ChunkGeneratorWorld.java +++ b/src/main/java/world/bentobox/caveblock/generators/ChunkGeneratorWorld.java @@ -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()); + } } } } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 611f45f..70cbe07 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -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: From cf8e29b5626d0105f25175bace9088f16f39594d Mon Sep 17 00:00:00 2001 From: BONNe Date: Thu, 9 Jul 2020 21:40:23 +0300 Subject: [PATCH 3/5] Add 1.15.2 backward compatibility. Update to 1.14 api. --- pom.xml | 2 +- src/main/java/world/bentobox/caveblock/Settings.java | 3 ++- src/main/resources/config.yml | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index c4064a5..23dd7c2 100644 --- a/pom.xml +++ b/pom.xml @@ -46,7 +46,7 @@ 1.8 1.16.1-R0.1-SNAPSHOT - 1.14.0-SNAPSHOT + 1.14.0 ${build.version}-SNAPSHOT diff --git a/src/main/java/world/bentobox/caveblock/Settings.java b/src/main/java/world/bentobox/caveblock/Settings.java index c317d76..cca6098 100644 --- a/src/main/java/world/bentobox/caveblock/Settings.java +++ b/src/main/java/world/bentobox/caveblock/Settings.java @@ -1,6 +1,7 @@ package world.bentobox.caveblock; +import com.google.common.base.Enums; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; @@ -2055,7 +2056,7 @@ public class Settings implements WorldSettings @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; + private Biome defaultNetherBiome = Enums.getIfPresent(Biome.class, "NETHER").or(Enums.getIfPresent(Biome.class, "NETHER_WASTES").or(Biome.BADLANDS)); @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.)") diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 70cbe07..69436da 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -194,7 +194,6 @@ world: remove-mobs-whitelist: - WITHER - ENDERMAN - - ZOMBIFIED_PIGLIN - ZOMBIE_VILLAGER # World flags. These are boolean settings for various flags for this world flags: From c12ab7eb5a57447e0271af925756526c2c066766 Mon Sep 17 00:00:00 2001 From: BONNe Date: Thu, 9 Jul 2020 21:43:37 +0300 Subject: [PATCH 4/5] Update version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 23dd7c2..c8c07e1 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ ${build.version}-SNAPSHOT - 1.14.0 + 1.15.0 -LOCAL From aaea6fd6fe0e5f1f3196f8fcfefb2ca467b56dee Mon Sep 17 00:00:00 2001 From: tastybento Date: Fri, 10 Jul 2020 21:19:10 -0700 Subject: [PATCH 5/5] Fixes blueprint bundles. https://github.com/BentoBoxWorld/CaveBlock/issues/49 --- pom.xml | 2 +- src/main/resources/blueprints/default.json | 6 +++--- src/main/resources/blueprints/miner-cave.json | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index c8c07e1..4dfecc3 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ ${build.version}-SNAPSHOT - 1.15.0 + 1.15.1 -LOCAL diff --git a/src/main/resources/blueprints/default.json b/src/main/resources/blueprints/default.json index 296cfd2..9688550 100644 --- a/src/main/resources/blueprints/default.json +++ b/src/main/resources/blueprints/default.json @@ -7,9 +7,9 @@ ], "requirePermission": false, "blueprints": { - "NORMAL": "the cave", - "NETHER": "the nether cave", - "THE_END": "the end cave" + "NORMAL": "cave", + "NETHER": "nether-cave", + "THE_END": "end-cave" }, "slot": 0 } \ No newline at end of file diff --git a/src/main/resources/blueprints/miner-cave.json b/src/main/resources/blueprints/miner-cave.json index 3876306..a9ccd37 100644 --- a/src/main/resources/blueprints/miner-cave.json +++ b/src/main/resources/blueprints/miner-cave.json @@ -7,9 +7,9 @@ ], "requirePermission": false, "blueprints": { - "NORMAL": "miner's cave", - "NETHER": "the nether cave", - "THE_END": "the end cave" + "NORMAL": "miners-cave", + "NETHER": "nether-cave", + "THE_END": "end-cave" }, "slot": 1 } \ No newline at end of file