mirror of
https://github.com/FabricMC/fabric.git
synced 2025-04-21 03:10:54 -04:00
Rename FabricWorldgenProvider to FabricDynamicRegistryProvider (#2638)
* Rename FabricWorldgenProvider * Fix merge
This commit is contained in:
parent
ce46c4cf92
commit
0d6838e783
2 changed files with 10 additions and 9 deletions
fabric-biome-api-v1/src/testmod/java/net/fabricmc/fabric/test/biome
fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/api/datagen/v1/provider
|
@ -40,9 +40,9 @@ import net.minecraft.world.gen.placementmodifier.BiomePlacementModifier;
|
|||
import net.minecraft.world.gen.placementmodifier.SquarePlacementModifier;
|
||||
|
||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricWorldgenProvider;
|
||||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricDynamicRegistryProvider;
|
||||
|
||||
public class WorldgenProvider extends FabricWorldgenProvider {
|
||||
public class WorldgenProvider extends FabricDynamicRegistryProvider {
|
||||
public WorldgenProvider(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> registriesFuture) {
|
||||
super(output, registriesFuture);
|
||||
}
|
||||
|
|
|
@ -53,16 +53,17 @@ import net.minecraft.world.gen.feature.PlacedFeature;
|
|||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||
|
||||
/**
|
||||
* A provider to help with data-generation of worldgen objects.
|
||||
* A provider to help with data-generation of dynamic registry objects,
|
||||
* such as biomes, features, or message types.
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
public abstract class FabricWorldgenProvider implements DataProvider {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(FabricWorldgenProvider.class);
|
||||
public abstract class FabricDynamicRegistryProvider implements DataProvider {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(FabricDynamicRegistryProvider.class);
|
||||
|
||||
private final FabricDataOutput output;
|
||||
private final CompletableFuture<RegistryWrapper.WrapperLookup> registriesFuture;
|
||||
|
||||
public FabricWorldgenProvider(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> registriesFuture) {
|
||||
public FabricDynamicRegistryProvider(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> registriesFuture) {
|
||||
this.output = output;
|
||||
this.registriesFuture = registriesFuture;
|
||||
}
|
||||
|
@ -85,7 +86,7 @@ public abstract class FabricWorldgenProvider implements DataProvider {
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets access to all lookups.
|
||||
* Gets access to all registry lookups.
|
||||
*/
|
||||
public RegistryWrapper.WrapperLookup getLookups() {
|
||||
return registries;
|
||||
|
@ -106,7 +107,7 @@ public abstract class FabricWorldgenProvider implements DataProvider {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns a lookup for configured carvers features. Useful when creating biomes.
|
||||
* Returns a lookup for configured carvers. Useful when creating biomes.
|
||||
*/
|
||||
public RegistryEntryLookup<ConfiguredCarver<?>> configuredCarvers() {
|
||||
return getLookup(RegistryKeys.CONFIGURED_CARVER_WORLDGEN);
|
||||
|
@ -121,7 +122,7 @@ public abstract class FabricWorldgenProvider implements DataProvider {
|
|||
}
|
||||
|
||||
/**
|
||||
* Adds a new object to be data generated and returns a reference to it for use in other worldgen objects.
|
||||
* Adds a new object to be data generated and returns a reference to it for use in other objects.
|
||||
*/
|
||||
public <T> RegistryEntry<T> add(RegistryKey<T> registry, T object) {
|
||||
return getQueuedEntries(registry).add(registry.getValue(), object);
|
Loading…
Add table
Add a link
Reference in a new issue