Skip to content

Commit

Permalink
Update to 1.21.3 and CodeMC
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Nov 10, 2024
1 parent da7744b commit 18c6d42
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 75 deletions.
24 changes: 10 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>17</java.version>
<!-- More visible way how to change dependency versions -->
<spigot.version>1.20.4-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>2.0.0-SNAPSHOT</bentobox.version>
<spigot.version>1.21.3-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>2.7.1-SNAPSHOT</bentobox.version>
<level.version>2.5.0</level.version>
<bank.version>1.4.0</bank.version>
<!-- Mocks -->
Expand All @@ -47,7 +47,7 @@
<!-- Revision variable removes warning about dynamic version -->
<revision>${build.version}-SNAPSHOT</revision>
<!-- This allows to change between versions and snapshots. -->
<build.version>2.5.2</build.version>
<build.version>2.6.0</build.version>
<build.number>-LOCAL</build.number>
<!-- Sonar Cloud -->
<sonar.projectKey>BentoBoxWorld_MagicCobblestoneGenerator</sonar.projectKey>
Expand Down Expand Up @@ -87,13 +87,9 @@
</profiles>

<distributionManagement>
<snapshotRepository>
<id>codemc-snapshots</id>
<url>https://repo.codemc.io/repository/maven-snapshots</url>
</snapshotRepository>
<repository>
<id>codemc-releases</id>
<url>https://repo.codemc.io/repository/maven-releases</url>
<id>bentoboxworld</id>
<url>https://repo.codemc.io/repository/bentoboxworld/</url>
</repository>
</distributionManagement>

Expand All @@ -110,14 +106,14 @@
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>codemc-repo</id>
<url>https://repo.codemc.io/repository/maven-public/</url>
<id>bentoboxworld</id>
<url>https://repo.codemc.io/repository/bentoboxoworld/</url>
</repository>
<!--Vault Repo is down. -->
<repository>
<id>vault-repo</id>
<url>https://nexus.hc.to/content/repositories/pub_releases</url>
<id>codemc-repo</id>
<url>https://repo.codemc.io/repository/maven-public/</url>
</repository>
<!--Vault Repo -->
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ protected void playEffects(Block block)
// This spawns 8 large smoke particles.
for (int counter = 0; counter < 8; ++counter)
{
block.getWorld().spawnParticle(Particle.SMOKE_LARGE,
block.getWorld().spawnParticle(Particle.SMOKE,
blockX + Math.random(),
blockY + 1 + Math.random(),
blockZ + Math.random(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
Expand All @@ -19,6 +18,7 @@

import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.Registry;
import org.bukkit.World;
import org.bukkit.block.Biome;
import org.bukkit.entity.EntityType;
Expand Down Expand Up @@ -295,18 +295,8 @@ public static <T> T getPreviousValue(T[] values, T currentValue)
*
* @return Map that contains relation from biome name to biome.
*/
public static Map<String, Biome> getBiomeNameMap()
{
Biome[] biomes = Biome.values();

Map<String, Biome> returnMap = new HashMap<>(biomes.length);

for (Biome biome : biomes)
{
returnMap.put(biome.name(), biome);
}

return returnMap;
public static Map<String, Biome> getBiomeNameMap() {
return Registry.BIOME.stream().collect(Collectors.toMap(biome -> biome.name(), biome -> biome));
}


Expand Down Expand Up @@ -398,11 +388,8 @@ public static String sanitizeInput(String input)
*/
public static boolean isSnowyBiome(Biome biome)
{
return switch (biome) {
//case SNOWY_SLOPES:
case SNOWY_PLAINS, SNOWY_TAIGA, ICE_SPIKES, FROZEN_RIVER, SNOWY_BEACH -> true;
default -> false;
};
return biome == Biome.SNOWY_PLAINS || biome == Biome.SNOWY_TAIGA || biome == Biome.ICE_SPIKES
|| biome == Biome.FROZEN_RIVER || biome == Biome.SNOWY_BEACH;
}


Expand All @@ -414,10 +401,9 @@ public static boolean isSnowyBiome(Biome biome)
*/
public static boolean isColdBiome(Biome biome)
{
return switch (biome) {
case WINDSWEPT_HILLS, WINDSWEPT_GRAVELLY_HILLS, WINDSWEPT_FOREST, TAIGA, OLD_GROWTH_PINE_TAIGA, OLD_GROWTH_SPRUCE_TAIGA, STONY_SHORE -> true;
default -> false;
};
return biome == Biome.WINDSWEPT_HILLS || biome == Biome.WINDSWEPT_GRAVELLY_HILLS
|| biome == Biome.WINDSWEPT_FOREST || biome == Biome.TAIGA || biome == Biome.OLD_GROWTH_PINE_TAIGA
|| biome == Biome.OLD_GROWTH_SPRUCE_TAIGA || biome == Biome.STONY_SHORE;
}


Expand All @@ -429,10 +415,11 @@ public static boolean isColdBiome(Biome biome)
*/
public static boolean isTemperateBiome(Biome biome)
{
return switch (biome) {
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;
default -> false;
};
return biome == Biome.PLAINS || biome == Biome.SUNFLOWER_PLAINS || biome == Biome.FOREST
|| biome == Biome.FLOWER_FOREST || biome == Biome.BIRCH_FOREST || biome == Biome.OLD_GROWTH_BIRCH_FOREST
|| biome == Biome.DARK_FOREST || biome == Biome.SWAMP || biome == Biome.JUNGLE
|| biome == Biome.SPARSE_JUNGLE || biome == Biome.BAMBOO_JUNGLE || biome == Biome.RIVER
|| biome == Biome.BEACH || biome == Biome.MUSHROOM_FIELDS;
}


Expand All @@ -444,12 +431,9 @@ public static boolean isTemperateBiome(Biome biome)
*/
public static boolean isWarmBiome(Biome biome)
{
return switch (biome) {
case DESERT, SAVANNA, WINDSWEPT_SAVANNA, BADLANDS, ERODED_BADLANDS, WOODED_BADLANDS, SAVANNA_PLATEAU ->
// case BADLANDS_PLATEAU:
true;
default -> false;
};
return biome == Biome.DESERT || biome == Biome.SAVANNA || biome == Biome.WINDSWEPT_SAVANNA
|| biome == Biome.BADLANDS || biome == Biome.ERODED_BADLANDS || biome == Biome.WOODED_BADLANDS
|| biome == Biome.SAVANNA_PLATEAU;
}


Expand All @@ -461,10 +445,9 @@ public static boolean isWarmBiome(Biome biome)
*/
public static boolean isAquaticBiome(Biome biome)
{
return switch (biome) {
case WARM_OCEAN, LUKEWARM_OCEAN, DEEP_LUKEWARM_OCEAN, OCEAN, DEEP_OCEAN, COLD_OCEAN, DEEP_COLD_OCEAN, FROZEN_OCEAN, DEEP_FROZEN_OCEAN -> true;
default -> false;
};
return biome == Biome.WARM_OCEAN || biome == Biome.LUKEWARM_OCEAN || biome == Biome.DEEP_LUKEWARM_OCEAN
|| biome == Biome.OCEAN || biome == Biome.DEEP_OCEAN || biome == Biome.COLD_OCEAN
|| biome == Biome.DEEP_COLD_OCEAN || biome == Biome.FROZEN_OCEAN || biome == Biome.DEEP_FROZEN_OCEAN;
}


Expand All @@ -486,12 +469,8 @@ public static boolean isNeutralBiome(Biome biome)
* @param biome Biome that must be checked.
* @return {@code true} if I think it is cave biome, {@code false} otherwise.
*/
public static boolean isCaveBiome(Biome biome)
{
return switch (biome) {
case LUSH_CAVES, DRIPSTONE_CAVES -> true;
default -> false;
};
public static boolean isCaveBiome(Biome biome) {
return biome == Biome.LUSH_CAVES || biome == Biome.DRIPSTONE_CAVES;
}


Expand All @@ -501,12 +480,9 @@ public static boolean isCaveBiome(Biome biome)
* @param biome Biome that must be checked.
* @return {@code true} if I think it is nether biome, {@code false} otherwise.
*/
public static boolean isNetherBiome(Biome biome)
{
return switch (biome) {
case NETHER_WASTES, SOUL_SAND_VALLEY, CRIMSON_FOREST, WARPED_FOREST, BASALT_DELTAS -> true;
default -> false;
};
public static boolean isNetherBiome(Biome biome) {
return biome == Biome.NETHER_WASTES || biome == Biome.SOUL_SAND_VALLEY || biome == Biome.CRIMSON_FOREST
|| biome == Biome.WARPED_FOREST || biome == Biome.BASALT_DELTAS;
}


Expand All @@ -516,12 +492,9 @@ public static boolean isNetherBiome(Biome biome)
* @param biome Biome that must be checked.
* @return {@code true} if I think it is the end biome, {@code false} otherwise.
*/
public static boolean isTheEndBiome(Biome biome)
{
return switch (biome) {
case THE_END, SMALL_END_ISLANDS, END_MIDLANDS, END_HIGHLANDS, END_BARRENS -> true;
default -> false;
};
public static boolean isTheEndBiome(Biome biome) {
return biome == Biome.THE_END || biome == Biome.SMALL_END_ISLANDS || biome == Biome.END_MIDLANDS
|| biome == Biome.END_HIGHLANDS || biome == Biome.END_BARRENS;
}


Expand Down Expand Up @@ -633,7 +606,7 @@ public static String prettifyObject(Biome biome, User user)
// biomes:
// [biome]:
// name: [name]
String translation = user.getTranslationOrNothing(Constants.BIOMES + biome.name().toLowerCase() + ".name");
String translation = user.getTranslationOrNothing(Constants.BIOMES + biome.getKey().getKey() + ".name");

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

translation = user.getTranslationOrNothing(Constants.BIOMES + biome.name().toLowerCase());
translation = user.getTranslationOrNothing(Constants.BIOMES + biome.getKey().getKey());

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

translation = user.getTranslationOrNothing("biomes." + biome.name().toLowerCase());
translation = user.getTranslationOrNothing("biomes." + biome.getKey().getKey());

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

// Nothing was found. Use just a prettify text function.
return Util.prettifyText(biome.name());
return Util.prettifyText(biome.getKey().getKey());
}


Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: BentoBox-MagicCobblestoneGenerator
main: world.bentobox.magiccobblestonegenerator.StoneGeneratorPladdon
version: ${project.version}${build.number}
api-version: "1.18"
api-version: "1.21"

authors: [BONNe]
authors: [BONNe, tastybento]
contributors: ["The BentoBoxWorld Community"]
website: https://bentobox.world
description: ${project.description}

0 comments on commit 18c6d42

Please sign in to comment.