Advertisement
jayhillx

lavender tree/sapling code

Aug 5th, 2020
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. RegistryHandler
  2.  
  3. public static final RegistryObject<Block> LAVENDER_SAPLING = BLOCKS.register("lavender_sapling", () -> new ModSapling(new LavenderTree(), Block.Properties.create(Material.PLANTS).doesNotBlockMovement().tickRandomly().hardnessAndResistance(0).sound(SoundType.PLANT)));
  4.  
  5. public static final RegistryObject<Item> LAVENDER_SAPLING_ITEM = ITEMS.register("lavender_sapling", () -> new BlockItemBase(LAVENDER_SAPLING.get()));
  6.  
  7. =====================================================================================================================
  8. LavenderTree
  9.  
  10. public class LavenderTree extends Tree {
  11.  
  12. public static final TreeFeatureConfig LAVENDER_TREE_CONFIG = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(RegistryHandler.LAVENDER_LOG.get().getDefaultState()), new SimpleBlockStateProvider(RegistryHandler.LAVENDER_LEAVES.get().getDefaultState()), new BlobFoliagePlacer(2, 0))).baseHeight(5).heightRandA(2).foliageHeight(3).ignoreVines().setSapling((net.minecraftforge.common.IPlantable) RegistryHandler.LAVENDER_SAPLING.get().getDefaultState()).build();
  13.  
  14. @Override
  15. protected ConfiguredFeature<TreeFeatureConfig, ?> getTreeFeature(Random randomIn, boolean p_225546_2_) {
  16. return Feature.NORMAL_TREE.withConfiguration(LAVENDER_TREE_CONFIG);
  17. }
  18. }
  19. =====================================================================================================================
  20. LavenderMeadowBiome
  21.  
  22. this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, Feature.NORMAL_TREE.withConfiguration(LavenderTree.LAVENDER_TREE_CONFIG).withPlacement(Placement.COUNT_EXTRA_HEIGHTMAP.configure(new AtSurfaceWithExtraConfig(5, 0.1F, 1))));
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement