File tree Expand file tree Collapse file tree
src/main/java/org/mvplugins/multiverse/core/world/biomeprovider Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package org .mvplugins .multiverse .core .world .biomeprovider ;
22
3+ import org .bukkit .NamespacedKey ;
4+ import org .bukkit .Registry ;
35import org .bukkit .block .Biome ;
46import org .bukkit .generator .BiomeProvider ;
57import org .jetbrains .annotations .NotNull ;
@@ -18,13 +20,16 @@ final class SingleBiomeProviderParser implements BiomeProviderParser {
1820
1921 @ Override
2022 public BiomeProvider parseBiomeProvider (@ NotNull String worldName , @ NotNull String params ) {
21- return new SingleBiomeProvider (Biome .valueOf (params .toUpperCase (Locale .ENGLISH )));
23+ NamespacedKey biomeKey = NamespacedKey .fromString (params .toLowerCase (Locale .ENGLISH ));
24+ return new SingleBiomeProvider (Registry .BIOME .get (biomeKey ));
2225 }
2326
2427 @ Override
2528 public Collection <String > suggestParams (@ NotNull String currentInput ) {
2629 if (biomes == null ) {
27- biomes = Arrays .stream (Biome .values ()).map (biome -> biome .toString ().toLowerCase (Locale .ENGLISH )).toList ();
30+ biomes = Registry .BIOME .stream ()
31+ .map (biome -> biome .getKey ().getKey ().toLowerCase (Locale .ENGLISH ))
32+ .toList ();
2833 }
2934 return biomes ;
3035 }
You can’t perform that action at this time.
0 commit comments