Posted September 30, 20204 yr I'm having trouble registering a feature and using it in json files. I have a "AsteroidFeature" class: public class AsteroidFeature<C extends IFeatureConfig> extends Feature<NoFeatureConfig> { int steps; int check; ArrayList<BlockPos> plannedPos = new ArrayList<>(); ArrayList<BlockPos> plannedPosDone = new ArrayList<>(); public AsteroidFeature(Codec<NoFeatureConfig> codec) { super(codec); } @Override public boolean func_241855_a(ISeedReader reader , ChunkGenerator generator, Random rand, BlockPos pos, NoFeatureConfig config) { if (pos.getY() <= 60) {return false;} // do stuff return true; } } ... and a registering class: public abstract class Feature<FC extends IFeatureConfig> extends net.minecraftforge.registries.ForgeRegistryEntry<Feature<?>> { public static final AsteroidFeature<IFeatureConfig> ASTEROID = register(new ResourceLocation(VanillaSpace.MOD_ID, "asteroid"), new AsteroidFeature<>(NoFeatureConfig.field_236558_a_)); private static <C extends IFeatureConfig, F extends net.minecraft.world.gen.feature.Feature<C>> F register(ResourceLocation key, F value) { return Registry.register(Registry.FEATURE, key, value); } } I've been basing these classes off of the "ForestRock" feature. I am adding the feature to a custom biome I created so I don't think I need to do any of the BiomeLoadingEvent stuff (correct me if I'm wrong about that). However, when I try and create a world, I get this error: [17:14:09] [Render thread/ERROR] [minecraft/BiomeGenerationSettings]: Feature: Not a JSON object: "vspace:asteroid" [17:14:09] [Render thread/ERROR] [minecraft/DynamicRegistries]: Error loading registry data: Unknown registry key: vspace:asteroid Honestly, I'm not sure what to do about this anymore.
September 30, 20204 yr 1 hour ago, jbko6 said: public abstract class Feature<FC extends IFeatureConfig> extends net.minecraftforge.registries.ForgeRegistryEntry<Feature<?>> { public static final AsteroidFeature<IFeatureConfig> ASTEROID = register(new ResourceLocation(VanillaSpace.MOD_ID, "asteroid"), new AsteroidFeature<>(NoFeatureConfig.field_236558_a_)); private static <C extends IFeatureConfig, F extends net.minecraft.world.gen.feature.Feature<C>> F register(ResourceLocation key, F value) { return Registry.register(Registry.FEATURE, key, value); } } You do know how to register something correct?
September 30, 20204 yr Author Welp, that was dumb of me. I've been working on this for ~8 hours so I think my brains a bit melted. Time to take a walk I suppose.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.