Skip to content

Commit d57cc6d

Browse files
committed
fix(docs): use new resource key
1 parent c9580e1 commit d57cc6d

4 files changed

Lines changed: 23 additions & 23 deletions

File tree

docs/src/content/docs/biomes/registered-biomes.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ import SourceLink from "@/components/SourceLink.astro";
1010

1111
In addition to being able to keep references to your <SourceLink path="biome/CustomBiome.java">CustomBiome</SourceLink>s
1212
in your own code, **BiomesAPI** also provides a built-in <SourceLink path="biome/RegisteredBiomes.java">RegisteredBiomes</SourceLink>
13-
that allows you to get a reference to your custom biomes just from a <SourceLink path="keys/ResourceKey.java">BiomeResourceKey</SourceLink>.
13+
that allows you to get a reference to your custom biomes just from a <SourceLink path="keys/ResourceKey.java">ResourceKey</SourceLink>.
1414

1515
**RegisteredBiomes** exposes the following methods. The `*Lazily` variants return a <SourceLink path="util/Lazy.java">Lazy</SourceLink> that defers the lookup until first accessed.
1616

17-
* <SourceLink path="biome/RegisteredBiomes.java" line={35}>get(BiomeResourceKey)</SourceLink>: Returns the custom biome for the given resource key, or `null` if none is registered.
18-
* <SourceLink path="biome/RegisteredBiomes.java" line={52}>getOrThrow(BiomeResourceKey)</SourceLink>: Returns the custom biome for the given resource key, or throws <SourceLink path="exceptions/UnknownBiomeException.java">UnknownBiomeException</SourceLink> if none is registered.
19-
* <SourceLink path="biome/RegisteredBiomes.java" line={67}>getLazily(BiomeResourceKey)</SourceLink>: A lazy version of `get` — the lookup runs on first access and may resolve to `null`.
20-
* <SourceLink path="biome/RegisteredBiomes.java" line={79}>getOrThrowLazily(BiomeResourceKey)</SourceLink>: A lazy version of `getOrThrow`. The `UnknownBiomeException` is thrown on first access if the biome is not registered.
21-
* <SourceLink path="biome/RegisteredBiomes.java" line={90}>isRegistered(BiomeResourceKey)</SourceLink>: Returns `true` if a biome with the given resource key is registered.
22-
* <SourceLink path="biome/RegisteredBiomes.java" line={102}>isRegisteredLazily(BiomeResourceKey)</SourceLink>: A lazy version of `isRegistered`.
17+
* <SourceLink path="biome/RegisteredBiomes.java" line={35}>get(ResourceKey)</SourceLink>: Returns the custom biome for the given resource key, or `null` if none is registered.
18+
* <SourceLink path="biome/RegisteredBiomes.java" line={52}>getOrThrow(ResourceKey)</SourceLink>: Returns the custom biome for the given resource key, or throws <SourceLink path="exceptions/UnknownBiomeException.java">UnknownBiomeException</SourceLink> if none is registered.
19+
* <SourceLink path="biome/RegisteredBiomes.java" line={67}>getLazily(ResourceKey)</SourceLink>: A lazy version of `get` — the lookup runs on first access and may resolve to `null`.
20+
* <SourceLink path="biome/RegisteredBiomes.java" line={79}>getOrThrowLazily(ResourceKey)</SourceLink>: A lazy version of `getOrThrow`. The `UnknownBiomeException` is thrown on first access if the biome is not registered.
21+
* <SourceLink path="biome/RegisteredBiomes.java" line={90}>isRegistered(ResourceKey)</SourceLink>: Returns `true` if a biome with the given resource key is registered.
22+
* <SourceLink path="biome/RegisteredBiomes.java" line={102}>isRegisteredLazily(ResourceKey)</SourceLink>: A lazy version of `isRegistered`.
2323
* <SourceLink path="biome/RegisteredBiomes.java" line={113}>iterator()</SourceLink>: Returns an iterator over all registered custom biomes (`RegisteredBiomes` implements `Iterable<CustomBiome>`).
2424
* <SourceLink path="biome/RegisteredBiomes.java" line={123}>size()</SourceLink>: Returns the number of registered custom biomes.
2525
* <SourceLink path="biome/RegisteredBiomes.java" line={133}>isEmpty()</SourceLink>: Returns `true` if no custom biomes are registered.

docs/src/content/docs/components/biome-resource-key.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ title: Resource Keys
44

55
import SourceLink from "@/components/SourceLink.astro";
66

7-
#### <SourceLink path="keys/ResourceKey.java">BiomeResourceKey</SourceLink>
7+
#### <SourceLink path="keys/ResourceKey.java">ResourceKey</SourceLink>
88

99
Represents a key for a biome resource in the game.
1010
This interface extends Kyori's [`Keyed`](https://jd.advntr.dev/key/4.26.1/net/kyori/adventure/key/Keyed.html) interface, allowing it to be used as a key in various registries and maps.
1111

12-
* <SourceLink path="keys/ResourceKey.java" line={56}>of(String, String)</SourceLink>: Creates a new BiomeResourceKey with the specified namespace and value.
13-
* <SourceLink path="keys/ResourceKey.java" line={81}>fromString(String)</SourceLink>: Creates a new BiomeResourceKey from a string in the format "namespace:value".
14-
* <SourceLink path="keys/ResourceKey.java" line={37}>namespace()</SourceLink>: Returns the namespace of this BiomeResourceKey.
15-
* <SourceLink path="keys/ResourceKey.java" line={41}>path()</SourceLink>: Returns the path of this BiomeResourceKey.
12+
* <SourceLink path="keys/ResourceKey.java" line={56}>of(String, String)</SourceLink>: Creates a new ResourceKey with the specified namespace and value.
13+
* <SourceLink path="keys/ResourceKey.java" line={81}>fromString(String)</SourceLink>: Creates a new ResourceKey from a string in the format "namespace:value".
14+
* <SourceLink path="keys/ResourceKey.java" line={37}>namespace()</SourceLink>: Returns the namespace of this ResourceKey.
15+
* <SourceLink path="keys/ResourceKey.java" line={41}>path()</SourceLink>: Returns the path of this ResourceKey.

docs/src/content/docs/worldgen/configured-features.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import me.outspending.biomesapi.wrapper.worldgen.feature.ConfiguredFeatures;
3434
ConfiguredFeature largeDiamonds = ConfiguredFeatures.ORE_DIAMOND_LARGE;
3535
3636
// or by key
37-
ConfiguredFeature byKey = ConfiguredFeature.reference(BiomeResourceKey.minecraft("ore_diamond_large"));`}
37+
ConfiguredFeature byKey = ConfiguredFeature.reference(ResourceKey.minecraft("ore_diamond_large"));`}
3838
/>
3939

4040

@@ -112,7 +112,7 @@ import org.bukkit.plugin.java.JavaPlugin;
112112
public class ExamplePlugin extends JavaPlugin {
113113
@Override
114114
public void onEnable() {
115-
BiomeResourceKey pillar = ResourceKey.of("example", "pillar");
115+
ResourceKey pillar = ResourceKey.of("example", "pillar");
116116
117117
CustomFeature.register(pillar, new PillarFeature());
118118
ConfiguredFeature tallFeature = ConfiguredFeature.customFeature(pillar, new PillarFeature.PillarConfig(Material.OBSIDIAN, Material.GLOWSTONE, 10, 15));
@@ -141,7 +141,7 @@ public class ExamplePlugin extends JavaPlugin {
141141
.addFeature(GenerationStep.VEGETAL_DECORATION, tallPlaced)
142142
.addFeature(GenerationStep.VEGETAL_DECORATION, shortPlaced)
143143
.build();
144-
BiomeResourceKey myBiomeKey = ResourceKey.of("example", "my_biome");
144+
ResourceKey myBiomeKey = ResourceKey.of("example", "my_biome");
145145
CustomBiome.builder(myBiomeKey)
146146
.fogColor("#DB00FD")
147147
.skyColor("#2F46FF")
@@ -152,8 +152,8 @@ public class ExamplePlugin extends JavaPlugin {
152152
.register();
153153
154154
DimensionEditor dimensionEditor = DimensionEditor.create();
155-
BiomeResourceKey overworldKey = ResourceKey.of("minecraft", "overworld");
156-
BiomeResourceKey plains = ResourceKey.of("minecraft", "plains");
155+
ResourceKey overworldKey = ResourceKey.of("minecraft", "overworld");
156+
ResourceKey plains = ResourceKey.of("minecraft", "plains");
157157
dimensionEditor.replaceInDimension(overworldKey, plains, myBiomeKey);
158158
dimensionEditor.apply(); // Applies to all loaded worlds
159159
}

docs/src/content/docs/worldgen/dimension-biome-editing.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class ExamplePlugin extends JavaPlugin {
4747
.addFeature(GenerationStep.VEGETAL_DECORATION, PlacedFeatures.FALLEN_OAK_TREE)
4848
.build();
4949
50-
BiomeResourceKey myBiomeKey = ResourceKey.of("example", "my_biome");
50+
ResourceKey myBiomeKey = ResourceKey.of("example", "my_biome");
5151
CustomBiome.builder(myBiomeKey)
5252
.fogColor("#DB00FD")
5353
.skyColor("#2F46FF")
@@ -58,8 +58,8 @@ public class ExamplePlugin extends JavaPlugin {
5858
.register();
5959
6060
DimensionEditor dimensionEditor = DimensionEditor.create();
61-
BiomeResourceKey overworldKey = ResourceKey.of("minecraft", "overworld");
62-
BiomeResourceKey plainsKey = ResourceKey.of("minecraft", "plains");
61+
ResourceKey overworldKey = ResourceKey.of("minecraft", "overworld");
62+
ResourceKey plainsKey = ResourceKey.of("minecraft", "plains");
6363
dimensionEditor.replaceInDimension(overworldKey, plainsKey, myBiomeKey);
6464
dimensionEditor.apply(); // Applies to all loaded worlds
6565
}
@@ -102,7 +102,7 @@ public class ExampleBootstrapper implements PluginBootstrap {
102102
.addFeature(GenerationStep.VEGETAL_DECORATION, PlacedFeatures.FALLEN_OAK_TREE)
103103
.build();
104104
105-
BiomeResourceKey myBiomeKey = ResourceKey.of("example", "my_biome");
105+
ResourceKey myBiomeKey = ResourceKey.of("example", "my_biome");
106106
registry.queue(
107107
CustomBiome.builder(myBiomeKey)
108108
.fogColor("#DB00FD")
@@ -114,8 +114,8 @@ public class ExampleBootstrapper implements PluginBootstrap {
114114
.build()
115115
);
116116
117-
BiomeResourceKey overworldKey = ResourceKey.of("minecraft", "overworld");
118-
BiomeResourceKey plainsKey = ResourceKey.of("minecraft", "plains");
117+
ResourceKey overworldKey = ResourceKey.of("minecraft", "overworld");
118+
ResourceKey plainsKey = ResourceKey.of("minecraft", "plains");
119119
registry.replaceInDimension(overworldKey, plainsKey, myBiomeKey); // Adds this to BiomesAPI's generated transient datapack
120120
}
121121
}`

0 commit comments

Comments
 (0)