From c21423accf74b58405ebbef11f6a07c83831eb51 Mon Sep 17 00:00:00 2001 From: BONNe Date: Sun, 16 Apr 2023 19:46:55 +0300 Subject: [PATCH 1/8] Init 1.19.0 version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c43b69f..f25683b 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ ${build.version}-SNAPSHOT - 1.18.0 + 1.19.0 -LOCAL bentobox-world https://sonarcloud.io From 6e7b235e7487a58456e878bfc686db90cabf4f85 Mon Sep 17 00:00:00 2001 From: tastybento Date: Sat, 24 Jun 2023 13:01:57 -0700 Subject: [PATCH 2/8] Update Github Action build script --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index db8c77b..60c51d4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,21 +11,21 @@ jobs: name: Build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - name: Set up JDK 17 - uses: actions/setup-java@v1 + uses: actions/setup-java@v3 with: java-version: 17 - name: Cache SonarCloud packages - uses: actions/cache@v1 + uses: actions/cache@v3 with: path: ~/.sonar/cache key: ${{ runner.os }}-sonar restore-keys: ${{ runner.os }}-sonar - name: Cache Maven packages - uses: actions/cache@v1 + uses: actions/cache@v3 with: path: ~/.m2 key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} From 3bf71e1b9819e8df1a51e0e0eef2579ae36c037e Mon Sep 17 00:00:00 2001 From: tastybento Date: Sat, 24 Jun 2023 13:52:00 -0700 Subject: [PATCH 3/8] Add required distribution --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 60c51d4..17b8df6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,6 +17,7 @@ jobs: - name: Set up JDK 17 uses: actions/setup-java@v3 with: + distribution: 'adopt' java-version: 17 - name: Cache SonarCloud packages uses: actions/cache@v3 From 77c058b7fdd1ace2315e4863e6ba96914ed3a41e Mon Sep 17 00:00:00 2001 From: tastybento Date: Mon, 10 Jul 2023 21:32:47 -0700 Subject: [PATCH 4/8] Update Jacoco --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f25683b..d9f5530 100644 --- a/pom.xml +++ b/pom.xml @@ -229,7 +229,7 @@ org.jacoco jacoco-maven-plugin - 0.8.3 + 0.8.11 true From 4d8b1c66496a61cc6fa8c75a15a99f261a42585a Mon Sep 17 00:00:00 2001 From: tastybento Date: Mon, 10 Jul 2023 21:36:26 -0700 Subject: [PATCH 5/8] Update pom.xml --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d9f5530..7b2cea4 100644 --- a/pom.xml +++ b/pom.xml @@ -229,7 +229,7 @@ org.jacoco jacoco-maven-plugin - 0.8.11 + 0.8.10 true From 1b4c4f86a85f5c522f822305cd85604604813860 Mon Sep 17 00:00:00 2001 From: tastybento Date: Sun, 12 Nov 2023 13:51:32 -0800 Subject: [PATCH 6/8] BentoBox 2.0.0 API --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index d9f5530..42b6048 100644 --- a/pom.xml +++ b/pom.xml @@ -45,8 +45,8 @@ UTF-8 17 - 1.19.4-R0.1-SNAPSHOT - 1.23.0 + 1.20.2-R0.1-SNAPSHOT + 2.0.0-SNAPSHOT ${build.version}-SNAPSHOT From 9e51156f87cc2817c21b6d8c6d58e29388272853 Mon Sep 17 00:00:00 2001 From: tastybento Date: Sun, 26 Nov 2023 07:59:48 -0800 Subject: [PATCH 7/8] Avoid min and max y settings for ores. Fixes #91 --- .../populators/NewMaterialPopulator.java | 175 ++++++++++-------- 1 file changed, 94 insertions(+), 81 deletions(-) diff --git a/src/main/java/world/bentobox/caveblock/generators/populators/NewMaterialPopulator.java b/src/main/java/world/bentobox/caveblock/generators/populators/NewMaterialPopulator.java index 11f1074..75e217f 100644 --- a/src/main/java/world/bentobox/caveblock/generators/populators/NewMaterialPopulator.java +++ b/src/main/java/world/bentobox/caveblock/generators/populators/NewMaterialPopulator.java @@ -1,16 +1,22 @@ package world.bentobox.caveblock.generators.populators; +import java.util.ArrayList; +import java.util.Collections; +import java.util.EnumMap; +import java.util.List; +import java.util.Map; +import java.util.Random; + import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.World; import org.bukkit.generator.BlockPopulator; import org.bukkit.generator.LimitedRegion; import org.bukkit.generator.WorldInfo; + import world.bentobox.caveblock.Utils; import world.bentobox.caveblock.generators.Ore; -import java.util.*; - /** * @author tastybento */ @@ -19,95 +25,102 @@ public class NewMaterialPopulator extends BlockPopulator { private static final Map> ORES; static { - Map> ores = new EnumMap<>(World.Environment.class); - // Source https://minecraft.fandom.com/wiki/Blob - List worldOres = new ArrayList<>(); - worldOres.add(new Ore(-64, 7, Material.DEEPSLATE_DIAMOND_ORE, 1, 10, true)); - worldOres.add(new Ore(7, 16, Material.DIAMOND_ORE, 1, 10, true)); - worldOres.add(new Ore(-64, 7, Material.DEEPSLATE_LAPIS_ORE, 1, 7, true)); - worldOres.add(new Ore(7, 64, Material.LAPIS_ORE, 1, 7, true)); - worldOres.add(new Ore(-64, 7, Material.DEEPSLATE_GOLD_ORE, 2, 9, true)); - worldOres.add(new Ore(7, 30, Material.GOLD_ORE, 2, 9, true)); - worldOres.add(new Ore(0, 16, Material.TUFF, 2, 33, false)); - worldOres.add(new Ore(-64, 7, Material.DEEPSLATE_REDSTONE_ORE, 8, 8, true)); - worldOres.add(new Ore(7, 16, Material.REDSTONE_ORE, 8, 8, true)); - worldOres.add(new Ore(0, 16, Material.GRAVEL, 8, 33, false)); - worldOres.add(new Ore(0, 79, Material.GRANITE, 5, 33, false)); - worldOres.add(new Ore(0, 79, Material.ANDESITE, 5, 33, false)); - worldOres.add(new Ore(0, 79, Material.DIORITE, 5, 33, false)); - worldOres.add(new Ore(32, 320, Material.EMERALD_ORE, 11, 1, true)); - worldOres.add(new Ore(95, 136, Material.COAL_ORE, 20, 17, false)); - worldOres.add(new Ore(0, 7, Material.DEEPSLATE_COPPER_ORE, 20, 9, true)); - worldOres.add(new Ore(7, 96, Material.COPPER_ORE, 20, 9, true)); - worldOres.add(new Ore(-64, 7, Material.DEEPSLATE_IRON_ORE, 20, 9, true)); - worldOres.add(new Ore(7, 320, Material.IRON_ORE, 20, 9, true)); - worldOres.add(new Ore(-64, 320, Material.CAVE_AIR, 8, 33, false)); - ores.put(World.Environment.NORMAL, worldOres); - List netherOres = new ArrayList<>(); - netherOres.add(new Ore(1, 22, Material.ANCIENT_DEBRIS, 1, 5, true)); - netherOres.add(new Ore(-64, 30, Material.NETHER_GOLD_ORE, 2, 9, true)); - netherOres.add(new Ore(0, 16, Material.GRAVEL, 8, 33, false)); - netherOres.add(new Ore(0, 320, Material.BASALT, 8, 33, false)); - netherOres.add(new Ore(0, 320, Material.BLACKSTONE, 8, 33, false)); - netherOres.add(new Ore(0, 320, Material.FIRE, 8, 33, false)); - netherOres.add(new Ore(200, 320, Material.GLOWSTONE, 8, 33, false)); - netherOres.add(new Ore(-64, 320, Material.CAVE_AIR, 8, 33, false)); - netherOres.add(new Ore(-64, 320, Material.LAVA, 8, 33, false)); - netherOres.add(new Ore(0, 16, Material.MAGMA_BLOCK, 8, 33, false)); - netherOres.add(new Ore(0, 320, Material.CRIMSON_FUNGUS, 8, 33, false)); - netherOres.add(new Ore(0, 320, Material.WARPED_FUNGUS, 8, 33, false)); - netherOres.add(new Ore(0, 320, Material.CRIMSON_NYLIUM, 8, 33, false)); - netherOres.add(new Ore(0, 320, Material.WARPED_NYLIUM, 8, 33, false)); - netherOres.add(new Ore(0, 320, Material.SHROOMLIGHT, 8, 33, false)); - netherOres.add(new Ore(0, 320, Material.CRIMSON_STEM, 8, 33, false)); - netherOres.add(new Ore(0, 320, Material.WARPED_STEM, 8, 33, false)); - netherOres.add(new Ore(-64, 34, Material.SOUL_SOIL, 20, 17, false)); - netherOres.add(new Ore(0, 96, Material.NETHER_QUARTZ_ORE, 20, 9, true)); - netherOres.add(new Ore(-64, 320, Material.BONE_BLOCK, 20, 9, true)); - ores.put(World.Environment.NETHER, netherOres); - List endOres = new ArrayList<>(); - endOres.add(new Ore(32, 320, Material.PURPUR_BLOCK, 11, 1, true)); - endOres.add(new Ore(95, 136, Material.OBSIDIAN, 20, 17, false)); - endOres.add(new Ore(-64, 320, Material.CAVE_AIR, 8, 33, false)); - ores.put(World.Environment.THE_END, endOres); - ORES = Collections.unmodifiableMap(ores); + Map> ores = new EnumMap<>(World.Environment.class); + // Source https://minecraft.fandom.com/wiki/Blob + List worldOres = new ArrayList<>(); + worldOres.add(new Ore(-64, 7, Material.DEEPSLATE_DIAMOND_ORE, 1, 10, true)); + worldOres.add(new Ore(7, 16, Material.DIAMOND_ORE, 1, 10, true)); + worldOres.add(new Ore(-64, 7, Material.DEEPSLATE_LAPIS_ORE, 1, 7, true)); + worldOres.add(new Ore(7, 64, Material.LAPIS_ORE, 1, 7, true)); + worldOres.add(new Ore(-64, 7, Material.DEEPSLATE_GOLD_ORE, 2, 9, true)); + worldOres.add(new Ore(7, 30, Material.GOLD_ORE, 2, 9, true)); + worldOres.add(new Ore(0, 16, Material.TUFF, 2, 33, false)); + worldOres.add(new Ore(-64, 7, Material.DEEPSLATE_REDSTONE_ORE, 8, 8, true)); + worldOres.add(new Ore(7, 16, Material.REDSTONE_ORE, 8, 8, true)); + worldOres.add(new Ore(0, 16, Material.GRAVEL, 8, 33, false)); + worldOres.add(new Ore(0, 79, Material.GRANITE, 5, 33, false)); + worldOres.add(new Ore(0, 79, Material.ANDESITE, 5, 33, false)); + worldOres.add(new Ore(0, 79, Material.DIORITE, 5, 33, false)); + worldOres.add(new Ore(32, 320, Material.EMERALD_ORE, 11, 1, true)); + worldOres.add(new Ore(95, 136, Material.COAL_ORE, 20, 17, false)); + worldOres.add(new Ore(0, 7, Material.DEEPSLATE_COPPER_ORE, 20, 9, true)); + worldOres.add(new Ore(7, 96, Material.COPPER_ORE, 20, 9, true)); + worldOres.add(new Ore(-64, 7, Material.DEEPSLATE_IRON_ORE, 20, 9, true)); + worldOres.add(new Ore(7, 320, Material.IRON_ORE, 20, 9, true)); + worldOres.add(new Ore(-64, 320, Material.CAVE_AIR, 8, 33, false)); + ores.put(World.Environment.NORMAL, worldOres); + List netherOres = new ArrayList<>(); + netherOres.add(new Ore(1, 22, Material.ANCIENT_DEBRIS, 1, 5, true)); + netherOres.add(new Ore(-64, 30, Material.NETHER_GOLD_ORE, 2, 9, true)); + netherOres.add(new Ore(0, 16, Material.GRAVEL, 8, 33, false)); + netherOres.add(new Ore(0, 320, Material.BASALT, 8, 33, false)); + netherOres.add(new Ore(0, 320, Material.BLACKSTONE, 8, 33, false)); + netherOres.add(new Ore(0, 320, Material.FIRE, 8, 33, false)); + netherOres.add(new Ore(200, 320, Material.GLOWSTONE, 8, 33, false)); + netherOres.add(new Ore(-64, 320, Material.CAVE_AIR, 8, 33, false)); + netherOres.add(new Ore(-64, 320, Material.LAVA, 8, 33, false)); + netherOres.add(new Ore(0, 16, Material.MAGMA_BLOCK, 8, 33, false)); + netherOres.add(new Ore(0, 320, Material.CRIMSON_FUNGUS, 8, 33, false)); + netherOres.add(new Ore(0, 320, Material.WARPED_FUNGUS, 8, 33, false)); + netherOres.add(new Ore(0, 320, Material.CRIMSON_NYLIUM, 8, 33, false)); + netherOres.add(new Ore(0, 320, Material.WARPED_NYLIUM, 8, 33, false)); + netherOres.add(new Ore(0, 320, Material.SHROOMLIGHT, 8, 33, false)); + netherOres.add(new Ore(0, 320, Material.CRIMSON_STEM, 8, 33, false)); + netherOres.add(new Ore(0, 320, Material.WARPED_STEM, 8, 33, false)); + netherOres.add(new Ore(-64, 34, Material.SOUL_SOIL, 20, 17, false)); + netherOres.add(new Ore(0, 96, Material.NETHER_QUARTZ_ORE, 20, 9, true)); + netherOres.add(new Ore(-64, 320, Material.BONE_BLOCK, 20, 9, true)); + ores.put(World.Environment.NETHER, netherOres); + List endOres = new ArrayList<>(); + endOres.add(new Ore(32, 320, Material.PURPUR_BLOCK, 11, 1, true)); + endOres.add(new Ore(95, 136, Material.OBSIDIAN, 20, 17, false)); + endOres.add(new Ore(-64, 320, Material.CAVE_AIR, 8, 33, false)); + ores.put(World.Environment.THE_END, endOres); + ORES = Collections.unmodifiableMap(ores); } private final int worldDepth; + /** + * @param worldDepth - Depth. If depth is set smaller than the world height, + * then the area above will be empty. Should not be less than + * cave height. + */ public NewMaterialPopulator(int worldDepth) { - this.worldDepth = worldDepth; + this.worldDepth = worldDepth; } @Override public void populate(WorldInfo worldInfo, Random random, int chunkX, int chunkZ, LimitedRegion limitedRegion) { - final int worldHeight = Math.min(worldInfo.getMaxHeight(), this.worldDepth); - for (int y = worldInfo.getMinHeight(); y < worldHeight - 1; y++) { - for (Ore o : ORES.get(worldInfo.getEnvironment())) { - if (y > o.minY() && y < o.maxY() && random.nextInt(100) <= o.chance()) { - pasteBlob(worldInfo, random, chunkX, chunkZ, limitedRegion, y, o); - if (o.cont()) { - break; - } - } - } - } + final int worldHeight = Math.min(worldInfo.getMaxHeight(), this.worldDepth); + for (int y = worldInfo.getMinHeight() + 1; y < worldHeight - 1; y++) { + for (Ore o : ORES.get(worldInfo.getEnvironment())) { + if (y > o.minY() && y < o.maxY() && random.nextInt(100) <= o.chance()) { + pasteBlob(worldInfo, random, chunkX, chunkZ, limitedRegion, y, o); + if (o.cont()) { + break; + } + } + } + } } - private void pasteBlob(WorldInfo worldInfo, Random random, int chunkX, int chunkZ, LimitedRegion limitedRegion, int y, Ore o) { - int offset = random.nextInt(16); - for (int x = Math.max(0, offset - BLOB_SIZE); x < Math.min(16, offset + BLOB_SIZE); x++) { - for (int z = Math.max(0, offset - BLOB_SIZE); z < Math.min(16, offset + BLOB_SIZE); z++) { - for (int yy = Math.max(worldInfo.getMinHeight(), y - BLOB_SIZE); yy < Math.min(worldInfo.getMaxHeight(), y + BLOB_SIZE); yy++) { - Location location = Utils.getLocationFromChunkLocation(x, yy, z, chunkX, chunkZ); - if (!limitedRegion.isInRegion(location)) { - continue; - } - if (limitedRegion.getType(location).isSolid() && random.nextBoolean()) { - limitedRegion.setType(location, o.material()); - } - } - } - } + private void pasteBlob(WorldInfo worldInfo, Random random, int chunkX, int chunkZ, LimitedRegion limitedRegion, + int y, Ore o) { + int offset = random.nextInt(16); + for (int x = Math.max(0, offset - BLOB_SIZE); x < Math.min(16, offset + BLOB_SIZE); x++) { + for (int z = Math.max(0, offset - BLOB_SIZE); z < Math.min(16, offset + BLOB_SIZE); z++) { + for (int yy = Math.max(worldInfo.getMinHeight() + 1, y - BLOB_SIZE); yy < Math + .min(worldInfo.getMaxHeight() - 1, y + BLOB_SIZE); yy++) { + Location location = Utils.getLocationFromChunkLocation(x, yy, z, chunkX, chunkZ); + if (!limitedRegion.isInRegion(location)) { + continue; + } + if (limitedRegion.getType(location).isSolid() && random.nextBoolean()) { + limitedRegion.setType(location, o.material()); + } + } + } + } } } From aa6bd08027c26545400cc3feeae1b4291e32a232 Mon Sep 17 00:00:00 2001 From: tastybento Date: Sun, 3 Dec 2023 12:32:40 -0800 Subject: [PATCH 8/8] Update README.md --- README.md | 46 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d754351..80662f1 100644 --- a/README.md +++ b/README.md @@ -3,14 +3,54 @@ [![Discord](https://img.shields.io/discord/272499714048524288.svg?logo=discord)](https://discord.bentobox.world) [![Build Status](https://ci.codemc.org/buildStatus/icon?job=BentoBoxWorld/CaveBlock)](https://ci.codemc.org/job/BentoBoxWorld/job/CaveBlock/) -CaveBlock is an addon for BentoBox, so to run CaveBlock, you must have BentoBox installed. It is not a Bukkit plugin and trying to use it as one will not work. +# Welcome to CaveBlock for BentoBox! -## Translation +🌌 **Embark on a Subterranean Adventure!** + +CaveBlock is an enthralling GameMode addon for BentoBox, designed to take your Minecraft experience to new depths. In this unique underground world, every adventure, challenge, and mystery lies beneath the surface. + + + +## What is CaveBlock? + +CaveBlock transforms the familiar Minecraft landscape into a vast underground realm. As a player, you begin your journey in a modest cave, equipped with only essential items. Your mission is to mine, explore, and expand your subterranean domain. + +### Key Features: + +- **Start Small, Dream Big:** Begin in a small cave and use your mining skills to expand your territory. +- **Treasure Hunting:** Delve deeper to discover hidden treasures and rare resources. +- **Beware of the Dark:** Monsters lurk in the shadows. Prepare for encounters with creatures of the deep. +- **Build and Craft:** Utilize your resources to craft tools, build structures, and create your own underground empire. + +## Getting Started with CaveBlock + +CaveBlock is an addon for BentoBox, a Bukkit plugin for Minecraft. To dive into this underground adventure, you'll need to have BentoBox installed on your Minecraft server. + +### Installation: + +1. **Install BentoBox:** Make sure BentoBox is installed and running on your server. +2. **Download CaveBlock:** Get the CaveBlock addon from the [official download site](https://download.bentobox.world). Or download from the releases in this repo. +3. **Add to BentoBox:** Place the CaveBlock file in your BentoBox addons folder. +4. **Restart Your Server:** Once installed, restart your server to activate CaveBlock. + +### Dive Into the Depths! + +Are you ready to explore the unknown and carve out your own piece of the underground world? Download CaveBlock now and start your subterranean adventure! + +🔍 **Stay Updated:** For the latest updates, follow our [Discord](https://discord.gg/tqQbNA5X9A). + +--- + +*Note: CaveBlock is constantly being updated with new features and improvements. Keep an eye on our release notes for the latest enhancements.* + +**Happy Mining!** 🌐🛠️👾 + +## Translations Like most BentoBox projects, the CaveBlock Addon is translatable into any language. Everyone can contribute, and translate some parts of the addon into their language via [GitLocalize](https://gitlocalize.com/repo/2968). If your language is not in the list, please contact the developers via Discord, and it will be added. -## Installation +## Full Installation Instructions 0. Install BentoBox and run it on the server at least once to create its data folders. 1. Place this jar in the addons folder of the BentoBox plugin.