Skip to content

Commit e6e3c97

Browse files
committed
Merge branch 'develop' into master
# Conflicts: # pom.xml # src/main/java/world/bentobox/caveblock/generators/populators/EntitiesPopulator.java
2 parents 1fdf5eb + 7bbcd40 commit e6e3c97

23 files changed

+2652
-1667
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ hs_err_pid*
2626
/.classpath
2727
/.project
2828
/.settings/
29+
/.idea/
30+
/CaveBlock.iml

README.md

+4-7
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,24 @@ CaveBlock is an addon for BentoBox, so to run CaveBlock, you must have BentoBox
77

88
## Translation
99

10-
As most of BentoBox projects, CaveBlock Addon is translatable in any language. Everyone can contribute, and translate some parts of the addon in their language via [GitLocalize](https://gitlocalize.com/repo/2968).
11-
If your language is not in the list, please contact to developers via Discord and it will be added there.
10+
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).
11+
If your language is not in the list, please contact the developers via Discord, and it will be added.
1212

1313
## Installation
1414

1515
0. Install BentoBox and run it on the server at least once to create its data folders.
1616
1. Place this jar in the addons folder of the BentoBox plugin.
1717
2. Restart the server.
1818
3. The addon will create worlds and a data folder and inside the folder will be a config.yml.
19-
4. Stop the server .
19+
4. Stop the server.
2020
5. Edit the config.yml how you want.
2121
6. Delete any worlds that were created by default if you made changes that would affect them.
2222
7. Restart the server.
2323

2424
## Config.yml
2525

2626
The config.yml is similar to BSkyblock and AcidIsalnd but *not the same*. It has some additional or changed parameters, like,
27-
instead of wrold-height it has world-depth.
28-
It also has option to choose main block for each world, and blocks that will be occasionally replace main block, f.e. diamond ore or shulker.
29-
It also allows to specifiy if roof and floor for each world must be generated from bedrock.
30-
27+
instead of world-height it has world-depth.
3128

3229
### Other Add-ons
3330

pom.xml

+11-6
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@
4343
<properties>
4444
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
4545
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
46-
<java.version>1.8</java.version>
46+
<java.version>16</java.version>
4747
<!-- More visible way how to change dependency versions -->
48-
<spigot.version>1.16.4-R0.1-SNAPSHOT</spigot.version>
49-
<bentobox.version>1.16.0</bentobox.version>
48+
<spigot.version>1.18.1-R0.1-SNAPSHOT</spigot.version>
49+
<bentobox.version>1.19.0</bentobox.version>
5050
<!-- Revision variable removes warning about dynamic version -->
5151
<revision>${build.version}-SNAPSHOT</revision>
5252
<!-- This allows to change between versions and snapshots. -->
53-
<build.version>1.14.5</build.version>
53+
<build.version>1.15.0</build.version>
5454
<build.number>-LOCAL</build.number>
5555
<sonar.organization>bentobox-world</sonar.organization>
5656
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
@@ -114,6 +114,12 @@
114114
<version>${spigot.version}</version>
115115
<scope>provided</scope>
116116
</dependency>
117+
<dependency>
118+
<groupId>org.spigotmc</groupId>
119+
<artifactId>plugin-annotations</artifactId>
120+
<version>1.2.3-SNAPSHOT</version>
121+
<scope>provided</scope>
122+
</dependency>
117123
<dependency>
118124
<groupId>world.bentobox</groupId>
119125
<artifactId>bentobox</artifactId>
@@ -170,8 +176,7 @@
170176
<artifactId>maven-compiler-plugin</artifactId>
171177
<version>3.7.0</version>
172178
<configuration>
173-
<source>${java.version}</source>
174-
<target>${java.version}</target>
179+
<release>${java.version}</release>
175180
</configuration>
176181
</plugin>
177182
<plugin>

src/main/java/world/bentobox/caveblock/CaveBlock.java

+3-7
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class CaveBlock extends GameModeAddon
2424

2525
/**
2626
* Executes code when loading the addon. This is called before {@link #onEnable()}. This should preferably
27-
* be used to setup configuration and worlds.
27+
* be used to set up configuration and worlds.
2828
*/
2929
@Override
3030
public void onLoad()
@@ -76,7 +76,6 @@ public void onReload()
7676
{
7777
super.onReload();
7878
this.loadSettings();
79-
this.chunkGenerator.reload();
8079
}
8180

8281

@@ -122,8 +121,8 @@ public void allLoaded() {
122121

123122
/**
124123
* Make the worlds for this GameMode in this method. BentoBox will call it after onLoad() and before
125-
* onEnable(). {@link #islandWorld} must be created and assigned, {@link #netherWorld} and {@link
126-
* #endWorld} are optional and may be null.
124+
* onEnable(). {@code islandWorld} must be created and assigned, {@code netherWorld} and {@code
125+
* endWorld} are optional and may be null.
127126
*/
128127
@Override
129128
public void createWorlds()
@@ -137,7 +136,6 @@ public void createWorlds()
137136

138137
// Create the world if it does not exist
139138
this.islandWorld = WorldCreator.name(worldName).
140-
type(WorldType.FLAT).
141139
environment(World.Environment.NORMAL).
142140
generator(this.chunkGenerator).
143141
createWorld();
@@ -316,6 +314,4 @@ public void saveWorldSettings()
316314
* String for the end world.
317315
*/
318316
private static final String THE_END = "_the_end";
319-
320-
321317
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package world.bentobox.caveblock;
2+
3+
import org.bukkit.plugin.java.annotation.dependency.Dependency;
4+
import org.bukkit.plugin.java.annotation.plugin.ApiVersion;
5+
import org.bukkit.plugin.java.annotation.plugin.Plugin;
6+
7+
import world.bentobox.bentobox.api.addons.Addon;
8+
import world.bentobox.bentobox.api.addons.Pladdon;
9+
10+
11+
@Plugin(name = "Pladdon", version = "1.0")
12+
@ApiVersion(ApiVersion.Target.v1_18)
13+
@Dependency(value = "BentoBox")
14+
public class CaveBlockPladdon extends Pladdon {
15+
16+
@Override
17+
public Addon getAddon() {
18+
return new CaveBlock();
19+
}
20+
}

src/main/java/world/bentobox/caveblock/Settings.java

+34-21
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,13 @@ public int getIslandHeight()
166166

167167

168168
/**
169-
* This method returns the useOwnGenerator object.
170-
* @return the useOwnGenerator object.
169+
* This is not an option in Caveblock
170+
* @return false
171171
*/
172172
@Override
173173
public boolean isUseOwnGenerator()
174174
{
175-
return useOwnGenerator;
175+
return false;
176176
}
177177

178178

@@ -812,6 +812,15 @@ public int getNumberOfBlockGenerationTries()
812812
return numberOfBlockGenerationTries;
813813
}
814814

815+
/**
816+
* This method returns the newMaterialGenerator value.
817+
* @return the value of newMaterialGenerator.
818+
*/
819+
public boolean isNewMaterialGenerator()
820+
{
821+
return newMaterialGenerator;
822+
}
823+
815824

816825
/**
817826
* {@inheritDoc}
@@ -1022,16 +1031,6 @@ public void setIslandHeight(int islandHeight)
10221031
}
10231032

10241033

1025-
/**
1026-
* This method sets the useOwnGenerator object value.
1027-
* @param useOwnGenerator the useOwnGenerator object new value.
1028-
*
1029-
*/
1030-
public void setUseOwnGenerator(boolean useOwnGenerator)
1031-
{
1032-
this.useOwnGenerator = useOwnGenerator;
1033-
}
1034-
10351034
/**
10361035
* This method sets the maxIslands object value.
10371036
* @param maxIslands the maxIslands object new value.
@@ -1647,6 +1646,17 @@ public void setNumberOfBlockGenerationTries(int numberOfBlockGenerationTries)
16471646
}
16481647

16491648

1649+
/**
1650+
* This method sets the newMaterialGenerator value.
1651+
* @param newMaterialGenerator the numberOfBlockGenerationTries new value.
1652+
*
1653+
*/
1654+
public void setNewMaterialGenerator(boolean newMaterialGenerator)
1655+
{
1656+
this.newMaterialGenerator = newMaterialGenerator;
1657+
}
1658+
1659+
16501660
/**
16511661
* @return the debug
16521662
*/
@@ -1687,6 +1697,7 @@ public void setAdminCommandAliases(String adminCommandAliases)
16871697
/**
16881698
* @return the onJoinCommands
16891699
*/
1700+
@NonNull
16901701
@Override
16911702
public List<String> getOnJoinCommands() {
16921703
return onJoinCommands;
@@ -1704,6 +1715,7 @@ public void setOnJoinCommands(List<String> onJoinCommands) {
17041715
/**
17051716
* @return the onLeaveCommands
17061717
*/
1718+
@NonNull
17071719
@Override
17081720
public List<String> getOnLeaveCommands() {
17091721
return onLeaveCommands;
@@ -2163,11 +2175,6 @@ public void setOnRespawnCommands(List<String> onRespawnCommands)
21632175
@ConfigEntry(path = "world.cave-height")
21642176
private int islandHeight = 60;
21652177

2166-
@ConfigComment("Use your own world generator for this world.")
2167-
@ConfigComment("In this case, the plugin will not generate anything.")
2168-
@ConfigEntry(path = "world.use-own-generator", experimental = true)
2169-
private boolean useOwnGenerator = true;
2170-
21712178
@ConfigComment("Maximum number of caves in the world. Set to -1 or 0 for unlimited.")
21722179
@ConfigComment("If the number of caves is greater than this number, it will stop players from creating caves.")
21732180
@ConfigEntry(path = "world.max-caves")
@@ -2180,7 +2187,7 @@ public void setOnRespawnCommands(List<String> onRespawnCommands)
21802187

21812188
@ConfigComment("The default biome for the overworld")
21822189
@ConfigEntry(path = "world.default-biome")
2183-
private Biome defaultBiome = Biome.MOUNTAINS;
2190+
private Biome defaultBiome = Enums.getIfPresent(Biome.class, "DRIPSTONE_CAVES").or(Biome.THE_VOID);
21842191

21852192
@ConfigComment("The maximum number of players a player can ban at any one time in this game mode.")
21862193
@ConfigComment("The permission caveblock.ban.maxlimit.X where X is a number can also be used per player")
@@ -2198,6 +2205,12 @@ public void setOnRespawnCommands(List<String> onRespawnCommands)
21982205
@ConfigEntry(path = "world.generation-tries", needsReset = true)
21992206
private int numberOfBlockGenerationTries = 1;
22002207

2208+
@ConfigComment("Should we use the new material generator ?")
2209+
@ConfigComment("This will generate ores and blocks similar to how vanilla does,")
2210+
@ConfigComment("but it will override the blocks settings of each world.")
2211+
@ConfigEntry(path = "world.use-new-material-generator", needsReset = true)
2212+
private boolean newMaterialGenerator = false;
2213+
22012214
@ConfigComment("")
22022215
@ConfigComment("Make over world roof of bedrock, if false, it will be made from stone")
22032216
@ConfigEntry(path = "world.normal.roof", needsReset = true)
@@ -2238,7 +2251,7 @@ public void setOnRespawnCommands(List<String> onRespawnCommands)
22382251

22392252
@ConfigComment("The default biome for the nether world (this may affect what mobs can spawn)")
22402253
@ConfigEntry(path = "world.nether.biome", since = "1.14.0")
2241-
private Biome defaultNetherBiome = Enums.getIfPresent(Biome.class, "NETHER").or(Enums.getIfPresent(Biome.class, "NETHER_WASTES").or(Biome.BADLANDS));
2254+
private Biome defaultNetherBiome = Enums.getIfPresent(Biome.class, "NETHER_WASTES").or(Biome.THE_VOID);
22422255

22432256
@ConfigComment("Nether spawn protection radius - this is the distance around the nether spawn")
22442257
@ConfigComment("that will be protected from player interaction (breaking blocks, pouring lava etc.)")
@@ -2286,7 +2299,7 @@ public void setOnRespawnCommands(List<String> onRespawnCommands)
22862299

22872300
@ConfigComment("The default biome for the end world (this may affect what mobs can spawn)")
22882301
@ConfigEntry(path = "world.end.biome", since = "1.14.0")
2289-
private Biome defaultTheEndBiome = Biome.THE_END;
2302+
private Biome defaultTheEndBiome = Enums.getIfPresent(Biome.class, "THE_END").or(Biome.THE_VOID);
22902303

22912304
@ConfigEntry(path = "world.end.dragon-spawn", experimental = true)
22922305
private boolean dragonSpawn = false;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package world.bentobox.caveblock;
2+
3+
import org.bukkit.Location;
4+
5+
public class Utils {
6+
7+
/**
8+
* Convert chunk location to world location
9+
*
10+
* @param x the x coordinate of the chunk location
11+
* @param y the y coordinate
12+
* @param z the z coordinate of the chunk location
13+
* @param chunkX the x coordinate of the chunk
14+
* @param chunkZ the z coordinate of the chunk
15+
* @return the world location
16+
*/
17+
public static Location getLocationFromChunkLocation(int x, int y, int z, int chunkX, int chunkZ) {
18+
return new Location(null, x + (chunkX * 16D), y, z + (chunkZ * 16D));
19+
}
20+
}

0 commit comments

Comments
 (0)