Skip to content

Commit 18c6d42

Browse files
committed
Update to 1.21.3 and CodeMC
1 parent da7744b commit 18c6d42

File tree

4 files changed

+44
-75
lines changed

4 files changed

+44
-75
lines changed

pom.xml

+10-14
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
3535
<java.version>17</java.version>
3636
<!-- More visible way how to change dependency versions -->
37-
<spigot.version>1.20.4-R0.1-SNAPSHOT</spigot.version>
38-
<bentobox.version>2.0.0-SNAPSHOT</bentobox.version>
37+
<spigot.version>1.21.3-R0.1-SNAPSHOT</spigot.version>
38+
<bentobox.version>2.7.1-SNAPSHOT</bentobox.version>
3939
<level.version>2.5.0</level.version>
4040
<bank.version>1.4.0</bank.version>
4141
<!-- Mocks -->
@@ -47,7 +47,7 @@
4747
<!-- Revision variable removes warning about dynamic version -->
4848
<revision>${build.version}-SNAPSHOT</revision>
4949
<!-- This allows to change between versions and snapshots. -->
50-
<build.version>2.5.2</build.version>
50+
<build.version>2.6.0</build.version>
5151
<build.number>-LOCAL</build.number>
5252
<!-- Sonar Cloud -->
5353
<sonar.projectKey>BentoBoxWorld_MagicCobblestoneGenerator</sonar.projectKey>
@@ -87,13 +87,9 @@
8787
</profiles>
8888

8989
<distributionManagement>
90-
<snapshotRepository>
91-
<id>codemc-snapshots</id>
92-
<url>https://repo.codemc.io/repository/maven-snapshots</url>
93-
</snapshotRepository>
9490
<repository>
95-
<id>codemc-releases</id>
96-
<url>https://repo.codemc.io/repository/maven-releases</url>
91+
<id>bentoboxworld</id>
92+
<url>https://repo.codemc.io/repository/bentoboxworld/</url>
9793
</repository>
9894
</distributionManagement>
9995

@@ -110,14 +106,14 @@
110106
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
111107
</repository>
112108
<repository>
113-
<id>codemc-repo</id>
114-
<url>https://repo.codemc.io/repository/maven-public/</url>
109+
<id>bentoboxworld</id>
110+
<url>https://repo.codemc.io/repository/bentoboxoworld/</url>
115111
</repository>
116-
<!--Vault Repo is down. -->
117112
<repository>
118-
<id>vault-repo</id>
119-
<url>https://nexus.hc.to/content/repositories/pub_releases</url>
113+
<id>codemc-repo</id>
114+
<url>https://repo.codemc.io/repository/maven-public/</url>
120115
</repository>
116+
<!--Vault Repo -->
121117
<repository>
122118
<id>jitpack.io</id>
123119
<url>https://jitpack.io</url>

src/main/java/world/bentobox/magiccobblestonegenerator/listeners/GeneratorListener.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ protected void playEffects(Block block)
136136
// This spawns 8 large smoke particles.
137137
for (int counter = 0; counter < 8; ++counter)
138138
{
139-
block.getWorld().spawnParticle(Particle.SMOKE_LARGE,
139+
block.getWorld().spawnParticle(Particle.SMOKE,
140140
blockX + Math.random(),
141141
blockY + 1 + Math.random(),
142142
blockZ + Math.random(),

src/main/java/world/bentobox/magiccobblestonegenerator/utils/Utils.java

+31-58
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
import java.util.ArrayList;
1111
import java.util.Collection;
12-
import java.util.HashMap;
1312
import java.util.List;
1413
import java.util.Locale;
1514
import java.util.Map;
@@ -19,6 +18,7 @@
1918

2019
import org.bukkit.ChatColor;
2120
import org.bukkit.Material;
21+
import org.bukkit.Registry;
2222
import org.bukkit.World;
2323
import org.bukkit.block.Biome;
2424
import org.bukkit.entity.EntityType;
@@ -295,18 +295,8 @@ public static <T> T getPreviousValue(T[] values, T currentValue)
295295
*
296296
* @return Map that contains relation from biome name to biome.
297297
*/
298-
public static Map<String, Biome> getBiomeNameMap()
299-
{
300-
Biome[] biomes = Biome.values();
301-
302-
Map<String, Biome> returnMap = new HashMap<>(biomes.length);
303-
304-
for (Biome biome : biomes)
305-
{
306-
returnMap.put(biome.name(), biome);
307-
}
308-
309-
return returnMap;
298+
public static Map<String, Biome> getBiomeNameMap() {
299+
return Registry.BIOME.stream().collect(Collectors.toMap(biome -> biome.name(), biome -> biome));
310300
}
311301

312302

@@ -398,11 +388,8 @@ public static String sanitizeInput(String input)
398388
*/
399389
public static boolean isSnowyBiome(Biome biome)
400390
{
401-
return switch (biome) {
402-
//case SNOWY_SLOPES:
403-
case SNOWY_PLAINS, SNOWY_TAIGA, ICE_SPIKES, FROZEN_RIVER, SNOWY_BEACH -> true;
404-
default -> false;
405-
};
391+
return biome == Biome.SNOWY_PLAINS || biome == Biome.SNOWY_TAIGA || biome == Biome.ICE_SPIKES
392+
|| biome == Biome.FROZEN_RIVER || biome == Biome.SNOWY_BEACH;
406393
}
407394

408395

@@ -414,10 +401,9 @@ public static boolean isSnowyBiome(Biome biome)
414401
*/
415402
public static boolean isColdBiome(Biome biome)
416403
{
417-
return switch (biome) {
418-
case WINDSWEPT_HILLS, WINDSWEPT_GRAVELLY_HILLS, WINDSWEPT_FOREST, TAIGA, OLD_GROWTH_PINE_TAIGA, OLD_GROWTH_SPRUCE_TAIGA, STONY_SHORE -> true;
419-
default -> false;
420-
};
404+
return biome == Biome.WINDSWEPT_HILLS || biome == Biome.WINDSWEPT_GRAVELLY_HILLS
405+
|| biome == Biome.WINDSWEPT_FOREST || biome == Biome.TAIGA || biome == Biome.OLD_GROWTH_PINE_TAIGA
406+
|| biome == Biome.OLD_GROWTH_SPRUCE_TAIGA || biome == Biome.STONY_SHORE;
421407
}
422408

423409

@@ -429,10 +415,11 @@ public static boolean isColdBiome(Biome biome)
429415
*/
430416
public static boolean isTemperateBiome(Biome biome)
431417
{
432-
return switch (biome) {
433-
case PLAINS, SUNFLOWER_PLAINS, FOREST, FLOWER_FOREST, BIRCH_FOREST, OLD_GROWTH_BIRCH_FOREST, DARK_FOREST, SWAMP, JUNGLE, SPARSE_JUNGLE, BAMBOO_JUNGLE, RIVER, BEACH, MUSHROOM_FIELDS -> true;
434-
default -> false;
435-
};
418+
return biome == Biome.PLAINS || biome == Biome.SUNFLOWER_PLAINS || biome == Biome.FOREST
419+
|| biome == Biome.FLOWER_FOREST || biome == Biome.BIRCH_FOREST || biome == Biome.OLD_GROWTH_BIRCH_FOREST
420+
|| biome == Biome.DARK_FOREST || biome == Biome.SWAMP || biome == Biome.JUNGLE
421+
|| biome == Biome.SPARSE_JUNGLE || biome == Biome.BAMBOO_JUNGLE || biome == Biome.RIVER
422+
|| biome == Biome.BEACH || biome == Biome.MUSHROOM_FIELDS;
436423
}
437424

438425

@@ -444,12 +431,9 @@ public static boolean isTemperateBiome(Biome biome)
444431
*/
445432
public static boolean isWarmBiome(Biome biome)
446433
{
447-
return switch (biome) {
448-
case DESERT, SAVANNA, WINDSWEPT_SAVANNA, BADLANDS, ERODED_BADLANDS, WOODED_BADLANDS, SAVANNA_PLATEAU ->
449-
// case BADLANDS_PLATEAU:
450-
true;
451-
default -> false;
452-
};
434+
return biome == Biome.DESERT || biome == Biome.SAVANNA || biome == Biome.WINDSWEPT_SAVANNA
435+
|| biome == Biome.BADLANDS || biome == Biome.ERODED_BADLANDS || biome == Biome.WOODED_BADLANDS
436+
|| biome == Biome.SAVANNA_PLATEAU;
453437
}
454438

455439

@@ -461,10 +445,9 @@ public static boolean isWarmBiome(Biome biome)
461445
*/
462446
public static boolean isAquaticBiome(Biome biome)
463447
{
464-
return switch (biome) {
465-
case WARM_OCEAN, LUKEWARM_OCEAN, DEEP_LUKEWARM_OCEAN, OCEAN, DEEP_OCEAN, COLD_OCEAN, DEEP_COLD_OCEAN, FROZEN_OCEAN, DEEP_FROZEN_OCEAN -> true;
466-
default -> false;
467-
};
448+
return biome == Biome.WARM_OCEAN || biome == Biome.LUKEWARM_OCEAN || biome == Biome.DEEP_LUKEWARM_OCEAN
449+
|| biome == Biome.OCEAN || biome == Biome.DEEP_OCEAN || biome == Biome.COLD_OCEAN
450+
|| biome == Biome.DEEP_COLD_OCEAN || biome == Biome.FROZEN_OCEAN || biome == Biome.DEEP_FROZEN_OCEAN;
468451
}
469452

470453

@@ -486,12 +469,8 @@ public static boolean isNeutralBiome(Biome biome)
486469
* @param biome Biome that must be checked.
487470
* @return {@code true} if I think it is cave biome, {@code false} otherwise.
488471
*/
489-
public static boolean isCaveBiome(Biome biome)
490-
{
491-
return switch (biome) {
492-
case LUSH_CAVES, DRIPSTONE_CAVES -> true;
493-
default -> false;
494-
};
472+
public static boolean isCaveBiome(Biome biome) {
473+
return biome == Biome.LUSH_CAVES || biome == Biome.DRIPSTONE_CAVES;
495474
}
496475

497476

@@ -501,12 +480,9 @@ public static boolean isCaveBiome(Biome biome)
501480
* @param biome Biome that must be checked.
502481
* @return {@code true} if I think it is nether biome, {@code false} otherwise.
503482
*/
504-
public static boolean isNetherBiome(Biome biome)
505-
{
506-
return switch (biome) {
507-
case NETHER_WASTES, SOUL_SAND_VALLEY, CRIMSON_FOREST, WARPED_FOREST, BASALT_DELTAS -> true;
508-
default -> false;
509-
};
483+
public static boolean isNetherBiome(Biome biome) {
484+
return biome == Biome.NETHER_WASTES || biome == Biome.SOUL_SAND_VALLEY || biome == Biome.CRIMSON_FOREST
485+
|| biome == Biome.WARPED_FOREST || biome == Biome.BASALT_DELTAS;
510486
}
511487

512488

@@ -516,12 +492,9 @@ public static boolean isNetherBiome(Biome biome)
516492
* @param biome Biome that must be checked.
517493
* @return {@code true} if I think it is the end biome, {@code false} otherwise.
518494
*/
519-
public static boolean isTheEndBiome(Biome biome)
520-
{
521-
return switch (biome) {
522-
case THE_END, SMALL_END_ISLANDS, END_MIDLANDS, END_HIGHLANDS, END_BARRENS -> true;
523-
default -> false;
524-
};
495+
public static boolean isTheEndBiome(Biome biome) {
496+
return biome == Biome.THE_END || biome == Biome.SMALL_END_ISLANDS || biome == Biome.END_MIDLANDS
497+
|| biome == Biome.END_HIGHLANDS || biome == Biome.END_BARRENS;
525498
}
526499

527500

@@ -633,7 +606,7 @@ public static String prettifyObject(Biome biome, User user)
633606
// biomes:
634607
// [biome]:
635608
// name: [name]
636-
String translation = user.getTranslationOrNothing(Constants.BIOMES + biome.name().toLowerCase() + ".name");
609+
String translation = user.getTranslationOrNothing(Constants.BIOMES + biome.getKey().getKey() + ".name");
637610

638611
if (!translation.isEmpty())
639612
{
@@ -646,7 +619,7 @@ public static String prettifyObject(Biome biome, User user)
646619
// biomes:
647620
// [biome]: [name]
648621

649-
translation = user.getTranslationOrNothing(Constants.BIOMES + biome.name().toLowerCase());
622+
translation = user.getTranslationOrNothing(Constants.BIOMES + biome.getKey().getKey());
650623

651624
if (!translation.isEmpty())
652625
{
@@ -658,7 +631,7 @@ public static String prettifyObject(Biome biome, User user)
658631
// biomes:
659632
// [biome]: [name]
660633

661-
translation = user.getTranslationOrNothing("biomes." + biome.name().toLowerCase());
634+
translation = user.getTranslationOrNothing("biomes." + biome.getKey().getKey());
662635

663636
if (!translation.isEmpty())
664637
{
@@ -667,7 +640,7 @@ public static String prettifyObject(Biome biome, User user)
667640
}
668641

669642
// Nothing was found. Use just a prettify text function.
670-
return Util.prettifyText(biome.name());
643+
return Util.prettifyText(biome.getKey().getKey());
671644
}
672645

673646

src/main/resources/plugin.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: BentoBox-MagicCobblestoneGenerator
22
main: world.bentobox.magiccobblestonegenerator.StoneGeneratorPladdon
33
version: ${project.version}${build.number}
4-
api-version: "1.18"
4+
api-version: "1.21"
55

6-
authors: [BONNe]
6+
authors: [BONNe, tastybento]
77
contributors: ["The BentoBoxWorld Community"]
88
website: https://bentobox.world
99
description: ${project.description}

0 commit comments

Comments
 (0)