Architect's Palette [FABRIC]

Architect's Palette [FABRIC]

10M Downloads

AP registers two tree features, minecraft:twisted and architects_palette:twisted

reoseah opened this issue ยท 1 comments

commented

So, there are two configured features that ArchitectsPalette registers: minecraft:twisted and architects_palette:twisted.

At

public static final RegistryEntry<ConfiguredFeature<TreeFeatureConfig, ?>> TWISTED_TREE = ConfiguredFeatures.register("twisted", Feature.TREE, twisted().build());
there's the first feature, minecraft:twisted one, later at
Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, new Identifier(ArchitectsPalette.MOD_ID, "twisted"), TWISTED);
the second one, architects_palette:twisted, which is not used anywhere, is being created and registered.

I imagine that happened during updating to 1.18.2, and I think instead you can call BuiltinRegistries.CONFIGURED_FEATURE.getEntry(...) from SaplingGenerator.getTreeFeature, which could look like this (haven't tested, just guessing):

public class TwistedTree extends SaplingGenerator {
    public static final ConfiguredFeature<TreeFeatureConfig, ?> TWISTED_TREE = new ConfiguredFeature<>(Feature.TREE, twisted().build());

    @Nullable
    @Override
    protected RegistryEntry<? extends ConfiguredFeature<?, ?>> getTreeFeature(Random randomIn, boolean largeHive) {
        return BuiltinRegistries.CONFIGURED_FEATURE.getEntry(BuiltinRegistries.CONFIGURED_FEATURE.getKey(TWISTED_TREE).orElseThrow()).orElseThrow();
    }

    public static TreeFeatureConfig.Builder twisted() {
        return new TreeFeatureConfig.Builder(BlockStateProvider.of(APBlocks.TWISTED_LOG),
                new ForkingTrunkPlacer(5, 2, 2),
                BlockStateProvider.of(APBlocks.TWISTED_LEAVES),
                new AcaciaFoliagePlacer(ConstantIntProvider.create(2), ConstantIntProvider.create(0)),
                new TwoLayersFeatureSize(1, 0, 2))
                .ignoreVines();
    }

    public static void registerTreeFeature() {
        Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, new Identifier(ArchitectsPalette.MOD_ID, "twisted"), TWISTED_TREE);
    }
}
commented

indeed,thx!... if you could take a quick look at the latest worldgen that would be great too XD