Posted July 1, 20205 yr Okay, so I registered a treefeature based on the already existing treefeature. I do this so I can specify the block its capable of being placed on. Im using TreeFeature class, but copied to my own class so I can modify the settings. I can get my tree to spawn in my biome just fine, the only problem is every tree that gets placed changes the base block it was formed on back to dirt. I dont want some random dirt blocks in my biome, because I use a different block.Here is the only referrence in TreeFeature to dirt, which ive changed to allow my tree to place on my special dirt. private static boolean func_236418_g_(IWorldGenerationBaseReader p_236418_0_, BlockPos p_236418_1_) { return p_236418_0_.hasBlockState(p_236418_1_, (p_236409_0_) -> { Block block = p_236409_0_.getBlock(); return isDirt(block) || block == Blocks.FARMLAND || block == CinderbaneRegistry.CINDIRT.get() || block == CinderbaneRegistry.CINDIRT_GRASS_BLOCK.get(); }); } Although, because mappings arent this far done yet I cannot find the function that is replacing the base block with dirt. As seen here : Has anybody had any success with changing this?
July 1, 20205 yr That's probably because that wouldn't be in TreeFeature as literally everything about the tree is customizable. You can even see that within the BaseTreeFeatureConfig. There you'll probably notice something called AbstractTrunkPlacer. From there, you'll find AbstractTrunkPlacer#func_236909_a_, a method that calls TreeFeature#func_236408_b_ with DIRT as a parameter. Looking into that method, you'll see that it sets the block state at the position to DIRT. So, you should probably create your own AbstractTrunkPlacer and implement the changes you want.
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.