Compare commits
24 Commits
Author | SHA1 | Date |
---|---|---|
tastybento | aa6bd08027 | |
tastybento | 9e51156f87 | |
tastybento | 772ece5916 | |
tastybento | 1b4c4f86a8 | |
tastybento | 4d8b1c6649 | |
tastybento | 77c058b7fd | |
tastybento | 3bf71e1b98 | |
tastybento | 6e7b235e74 | |
BONNe | c21423accf | |
BONNe | e1121d3dce | |
BONNe | 75148c5e00 | |
tastybento | 4490c4a32d | |
tastybento | 6601875109 | |
BONNe | 276b9cea40 | |
BONNe | d3e3984bc0 | |
BONNe | 9e245431ac | |
gitlocalize-app[bot] | a155eb9600 | |
BONNe | 8ae4fac517 | |
BONNe | 42a9cf9c7e | |
gitlocalize-app[bot] | aab7f8eb7c | |
gitlocalize-app[bot] | 1c04f41257 | |
BONNe | 69b6bc9111 | |
BONNe | 3478c0352a | |
BONNe | 28f1a57838 |
|
@ -11,21 +11,22 @@ 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 16
|
||||
uses: actions/setup-java@v1
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: 16
|
||||
distribution: 'adopt'
|
||||
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') }}
|
||||
|
@ -34,4 +35,4 @@ jobs:
|
|||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=BentoBoxWorld_CaveBlock
|
||||
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=BentoBoxWorld_CaveBlock
|
||||
|
|
46
README.md
46
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.
|
||||
|
||||
<img src=https://github.com/BentoBoxWorld/CaveBlock/assets/4407265/af407f94-1943-4e27-96e1-d3e2ed33330f width="400">
|
||||
|
||||
## 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.
|
||||
|
|
22
pom.xml
22
pom.xml
|
@ -45,12 +45,12 @@
|
|||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>17</java.version>
|
||||
<!-- More visible way how to change dependency versions -->
|
||||
<spigot.version>1.19.2-R0.1-SNAPSHOT</spigot.version>
|
||||
<bentobox.version>1.19.0</bentobox.version>
|
||||
<spigot.version>1.20.2-R0.1-SNAPSHOT</spigot.version>
|
||||
<bentobox.version>2.0.0-SNAPSHOT</bentobox.version>
|
||||
<!-- Revision variable removes warning about dynamic version -->
|
||||
<revision>${build.version}-SNAPSHOT</revision>
|
||||
<!-- This allows to change between versions and snapshots. -->
|
||||
<build.version>1.17.0</build.version>
|
||||
<build.version>1.19.0</build.version>
|
||||
<build.number>-LOCAL</build.number>
|
||||
<sonar.organization>bentobox-world</sonar.organization>
|
||||
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
|
||||
|
@ -114,12 +114,6 @@
|
|||
<version>${spigot.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>plugin-annotations</artifactId>
|
||||
<version>1.2.3-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>world.bentobox</groupId>
|
||||
<artifactId>bentobox</artifactId>
|
||||
|
@ -189,18 +183,20 @@
|
|||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<version>3.3.0</version>
|
||||
<configuration>
|
||||
<show>public</show>
|
||||
<failOnError>false</failOnError>
|
||||
<additionalJOption>-Xdoclint:none</additionalJOption>
|
||||
<!-- To compile with Java 11, this tag may be required -->
|
||||
<javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-javadocs</id>
|
||||
<phase>install</phase>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
|
@ -233,7 +229,7 @@
|
|||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
<version>0.8.3</version>
|
||||
<version>0.8.10</version>
|
||||
<configuration>
|
||||
<append>true</append>
|
||||
<excludes>
|
||||
|
|
|
@ -282,6 +282,16 @@ public class CaveBlock extends GameModeAddon
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* This addon uses the new chunk generation API for the sea bottom
|
||||
*/
|
||||
@Override
|
||||
public boolean isUsesNewChunkGeneration()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
// Section: Variables
|
||||
// ---------------------------------------------------------------------
|
||||
|
|
|
@ -1,16 +1,10 @@
|
|||
package world.bentobox.caveblock;
|
||||
|
||||
import org.bukkit.plugin.java.annotation.dependency.Dependency;
|
||||
import org.bukkit.plugin.java.annotation.plugin.ApiVersion;
|
||||
import org.bukkit.plugin.java.annotation.plugin.Plugin;
|
||||
|
||||
import world.bentobox.bentobox.api.addons.Addon;
|
||||
import world.bentobox.bentobox.api.addons.Pladdon;
|
||||
|
||||
|
||||
@Plugin(name = "Pladdon", version = "1.0")
|
||||
@ApiVersion(ApiVersion.Target.v1_18)
|
||||
@Dependency(value = "BentoBox")
|
||||
public class CaveBlockPladdon extends Pladdon {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,12 +1,7 @@
|
|||
package world.bentobox.caveblock;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
import org.bukkit.Difficulty;
|
||||
import org.bukkit.GameMode;
|
||||
|
@ -333,7 +328,7 @@ public class Settings implements WorldSettings
|
|||
* @return the defaultIslandFlags object.
|
||||
*/
|
||||
@Override
|
||||
public Map<Flag, Integer> getDefaultIslandFlags()
|
||||
public Map<String, Integer> getDefaultIslandFlagNames()
|
||||
{
|
||||
return defaultIslandFlags;
|
||||
}
|
||||
|
@ -344,7 +339,7 @@ public class Settings implements WorldSettings
|
|||
* @return the defaultIslandSettings object.
|
||||
*/
|
||||
@Override
|
||||
public Map<Flag, Integer> getDefaultIslandSettings()
|
||||
public Map<String, Integer> getDefaultIslandSettingNames()
|
||||
{
|
||||
return defaultIslandSettings;
|
||||
}
|
||||
|
@ -1179,7 +1174,7 @@ public class Settings implements WorldSettings
|
|||
* @param defaultIslandFlags the defaultIslandFlags object new value.
|
||||
*
|
||||
*/
|
||||
public void setDefaultIslandFlags(Map<Flag, Integer> defaultIslandFlags)
|
||||
public void setDefaultIslandFlags(Map<String, Integer> defaultIslandFlags)
|
||||
{
|
||||
this.defaultIslandFlags = defaultIslandFlags;
|
||||
}
|
||||
|
@ -1190,7 +1185,7 @@ public class Settings implements WorldSettings
|
|||
* @param defaultIslandSettings the defaultIslandSettings object new value.
|
||||
*
|
||||
*/
|
||||
public void setDefaultIslandSettings(Map<Flag, Integer> defaultIslandSettings)
|
||||
public void setDefaultIslandSettings(Map<String, Integer> defaultIslandSettings)
|
||||
{
|
||||
this.defaultIslandSettings = defaultIslandSettings;
|
||||
}
|
||||
|
@ -2143,6 +2138,20 @@ public class Settings implements WorldSettings
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Map<Flag, Integer> getDefaultIslandFlags()
|
||||
{
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Map<Flag, Integer> getDefaultIslandSettings()
|
||||
{
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
// Section: Variables
|
||||
// ---------------------------------------------------------------------
|
||||
|
@ -2439,13 +2448,11 @@ public class Settings implements WorldSettings
|
|||
@ConfigComment(" SUB-OWNER = 900")
|
||||
@ConfigComment(" OWNER = 1000")
|
||||
@ConfigEntry(path = "world.default-cave-flags")
|
||||
@Adapter(FlagSerializer.class)
|
||||
private Map<Flag, Integer> defaultIslandFlags = new HashMap<>();
|
||||
private Map<String, Integer> defaultIslandFlags = new HashMap<>();
|
||||
|
||||
@ConfigComment("These are the default settings for new caves")
|
||||
@ConfigEntry(path = "world.default-cave-settings")
|
||||
@Adapter(FlagSerializer2.class)
|
||||
private Map<Flag, Integer> defaultIslandSettings = new HashMap<>();
|
||||
private Map<String, Integer> defaultIslandSettings = new HashMap<>();
|
||||
|
||||
@ConfigComment("These settings/flags are hidden from users")
|
||||
@ConfigComment("Ops can toggle hiding in-game using SHIFT-LEFT-CLICK on flags in settings")
|
||||
|
|
|
@ -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<World.Environment, List<Ore>> ORES;
|
||||
|
||||
static {
|
||||
Map<World.Environment, List<Ore>> ores = new EnumMap<>(World.Environment.class);
|
||||
// Source https://minecraft.fandom.com/wiki/Blob
|
||||
List<Ore> 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<Ore> 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<Ore> 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<World.Environment, List<Ore>> ores = new EnumMap<>(World.Environment.class);
|
||||
// Source https://minecraft.fandom.com/wiki/Blob
|
||||
List<Ore> 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<Ore> 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<Ore> 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());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
name: CaveBlock
|
||||
main: world.bentobox.caveblock.CaveBlock
|
||||
version: ${version}${build.number}
|
||||
api-version: 1.19.0
|
||||
api-version: 1.23.0
|
||||
metrics: true
|
||||
repository: "BentoBoxWorld/CaveBlock"
|
||||
icon: "STONE_PICKAXE"
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
name: BentoBox-CaveBlock
|
||||
main: world.bentobox.caveblock.CaveBlockPladdon
|
||||
version: ${project.version}${build.number}
|
||||
api-version: "1.19"
|
||||
|
||||
authors: [tastybento, BONNe]
|
||||
contributors: ["The BentoBoxWorld Community"]
|
||||
website: https://bentobox.world
|
||||
description: ${project.description}
|
Loading…
Reference in New Issue