Jump to content

OhWhoah

Members
  • Posts

    4
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

OhWhoah's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Hi, I have a custom bush block that I made, and I am able to get it to generate normally in the overworld. I have since made another similar bush block, but I want this one to be able to gen only on soul soil in the soul sand valley biomes. Here is my code, I am not sure why it is not working, it isn't generating in the soul sand valley. //In class BlockInit public static final RegistryObject<BushBlock> SOULBERRY_BUSH = BLOCKS.register("soulberry_bush", () -> new CustomBush(PropertyInit.SOULBERRY_BUSH_PROPERTY)); //In Class PropertyInit public class PropertyInit { private PropertyInit() { } public final static BlockBehaviour.Properties CUSTOM_BUSH_PROPERTY = BlockBehaviour.Properties .of(Material.PLANT, MaterialColor.COLOR_GREEN).randomTicks().noCollission().instabreak() .sound(SoundType.SWEET_BERRY_BUSH); public final static BlockBehaviour.Properties SOULBERRY_BUSH_PROPERTY = BlockBehaviour.Properties .of(Material.REPLACEABLE_FIREPROOF_PLANT, MaterialColor.NETHER).randomTicks().noCollission().instabreak() .sound(SoundType.SOUL_SAND); } //In class PlacedFeatureInit public class PlacedFeatureInit { public static final PlacedFeature CUSTOM_BUSH_PLACED = PlacementUtils.register("custom_bush_placed", ConfigFeatureInit.BERRY_BUSH_CONFIG.placed()); public static final PlacedFeature SOULBERRY_BUSH_PLACED = PlacementUtils.register("soulberry_bush_placed", ConfigFeatureInit.SOULBERRY_BUSH_CONFIG.placed()); } //In class ConfigFeatureInit public static final ConfiguredFeature<RandomPatchConfiguration, ?> SOULBERRY_BUSH_CONFIG = FeatureUtils .register("soulberry_bush_config", Feature.FLOWER.configured(new RandomPatchConfiguration(1, 20, 20, () -> { return Feature.SIMPLE_BLOCK .configured(new SimpleBlockConfiguration(BlockStateProvider.simple( BlockInit.SOULBERRY_BUSH.get().defaultBlockState().setValue(SoulBerryBush.AGE, 3)))) .placed(InSquarePlacement.spread(), PlacementUtils.RANGE_BOTTOM_TO_MAX_TERRAIN_HEIGHT, RarityFilter.onAverageOnceEvery(1), BlockPredicateFilter.forPredicate(BlockPredicate.matchesBlocks( Arrays.asList(Blocks.SOUL_SAND, Blocks.SOUL_SOIL, Blocks.NETHERRACK)))); }))); //In class Bush Generation: public class BushGeneration { public static void generateBushes(final BiomeLoadingEvent event) { @SuppressWarnings("unused") ResourceKey<Biome> key = ResourceKey.create(Registry.BIOME_REGISTRY, event.getName()); ResourceLocation biome = event.getName(); List<Supplier<PlacedFeature>> base = event.getGeneration() .getFeatures(GenerationStep.Decoration.VEGETAL_DECORATION); if (biome.toString().contains("plains")) { base.add(() -> PlacedFeatureInit.CUSTOM_BUSH_PLACED); } else if (biome.toString().contains("soul")) { base.add(() -> PlacedFeatureInit.SOULBERRY_BUSH_PLACED); } } public static void onBiomeLoad(BiomeLoadingEvent event) { generateBushes(event); } }
  2. I was able to figure it out. Thanks for reaching out
  3. I have, but I'm not exactly sure how to adapt/implement them with my own code. Sorry for late reply, I had some work done on my PC.
  4. Can someone help me with block generation using forge? I made a custom berry bush but I am having a hard time figuring out how to get it to generate on the surface.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.