Search in sources :

Example 1 with RegistryAccess

use of net.minecraft.core.RegistryAccess in project Tropicraft by Tropicraft.

the class TropicraftTrees method create.

private static AbstractTreeGrower create(String id) {
    ResourceKey<ConfiguredFeature<?, ?>> key = ResourceKey.create(Registry.CONFIGURED_FEATURE_REGISTRY, new ResourceLocation(net.tropicraft.Constants.MODID, id));
    return create((server, random, beehive) -> {
        RegistryAccess registries = server.registryAccess();
        Registry<ConfiguredFeature<?, ?>> features = registries.registryOrThrow(Registry.CONFIGURED_FEATURE_REGISTRY);
        return features.get(key);
    });
}
Also used : ConfiguredFeature(net.minecraft.world.level.levelgen.feature.ConfiguredFeature) RegistryAccess(net.minecraft.core.RegistryAccess) ResourceLocation(net.minecraft.resources.ResourceLocation)

Aggregations

RegistryAccess (net.minecraft.core.RegistryAccess)1 ResourceLocation (net.minecraft.resources.ResourceLocation)1 ConfiguredFeature (net.minecraft.world.level.levelgen.feature.ConfiguredFeature)1