Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =======================================================================================================================================
- ModBlock (indented to see easier)
- //logs
- public static final RegistryObject<Block> STRAWBERRY_LOGS = BLOCKS.register("strawberry_logs", () -> new LogBlock(MaterialColor.WOOD, Block.Properties.create(Material.WOOD, MaterialColor.PINK).hardnessAndResistance(2.0F).sound(SoundType.WOOD)));
- public static final RegistryObject<Block> SWEET_STRAWBERRY_LOG = BLOCKS.register("sweet_strawberry_log", () -> new LogBlock(MaterialColor.WOOD, Block.Properties.create(Material.WOOD, MaterialColor.PINK).hardnessAndResistance(2.0F).sound(SoundType.WOOD)));
- public static final RegistryObject<Block> LAVENDER_LOG = BLOCKS.register("lavender_log", () -> new LogBlock(MaterialColor.WOOD, Block.Properties.create(Material.WOOD, MaterialColor.PURPLE).hardnessAndResistance(2.0F).sound(SoundType.WOOD)));
- //leaves
- public static final RegistryObject<Block> STRAWBERRY_LEAVES = BLOCKS.register("strawberry_leaves", () -> new LeavesBlock(Block.Properties.create(Material.LEAVES).hardnessAndResistance(0.2F).tickRandomly().sound(SoundType.PLANT).notSolid()));
- public static final RegistryObject<Block> SWEET_STRAWBERRY_LEAVES = BLOCKS.register("sweet_strawberry_leaves", () -> new LeavesBlock(Block.Properties.create(Material.LEAVES).hardnessAndResistance(0.2F).tickRandomly().sound(SoundType.PLANT).notSolid()));
- public static final RegistryObject<Block> LAVENDER_LEAVES = BLOCKS.register("lavender_leaves", () -> new LeavesBlock(Block.Properties.create(Material.LEAVES).hardnessAndResistance(0.2F).tickRandomly().sound(SoundType.PLANT).notSolid()));
- =======================================================================================================================================
- ModItem
- //block item
- public static final RegistryObject<Item> STRAWBERRY_LEAVES_ITEM = ITEMS.register("strawberry_leaves", () -> new
- BlockItemBase(ModBlock.STRAWBERRY_LEAVES.get()));
- public static final RegistryObject<Item> SWEET_STRAWBERRY_LEAVES_ITEM = ITEMS.register("sweet_strawberry_leaves", () -> new BlockItemBase(ModBlock.SWEET_STRAWBERRY_LEAVES.get()));
- public static final RegistryObject<Item> LAVENDER_LEAVES_ITEM = ITEMS.register("lavender_leaves", () -> new BlockItemBase(ModBlock.LAVENDER_LEAVES.get()));
- public static final RegistryObject<Item> STRAWBERRY_LOGS_ITEM = ITEMS.register("strawberry_logs", () -> new BlockItemBase(ModBlock.STRAWBERRY_LOGS.get()));
- public static final RegistryObject<Item> SWEET_STRAWBERRY_LOG_ITEM = ITEMS.register("sweet_strawberry_log", () -> new BlockItemBase(ModBlock.SWEET_STRAWBERRY_LOG.get()));
- public static final RegistryObject<Item> LAVENDER_LOG_ITEM = ITEMS.register("lavender_log", () -> new BlockItemBase(ModBlock.LAVENDER_LOG.get()));
- =======================================================================================================================================
- Trees(same for all trees)
- public class StrawberryTree extends Tree {
- public static final TreeFeatureConfig STRAWBERRY_TREE_CONFIG = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(ModBlock.STRAWBERRY_LOGS.get().getDefaultState()), new SimpleBlockStateProvider(ModBlock.STRAWBERRY_LEAVES.get().getDefaultState()), new BlobFoliagePlacer(2, 0))).baseHeight(4).heightRandA(2).foliageHeight(3).ignoreVines().setSapling((IPlantable) Blocks.OAK_SAPLING).build();
- @Override
- protected ConfiguredFeature<TreeFeatureConfig, ?> getTreeFeature(Random randomIn, boolean p_225546_2_) {
- return Feature.NORMAL_TREE.withConfiguration(STRAWBERRY_TREE_CONFIG);
- }
- }
- =======================================================================================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement