Inspired by 2020's April Fools' 20w14infinite Snapshot, this mod brings endless randomly generated dimensions into Minecraft.
1package net.lerariemann.infinity.block.custom;
2
3import net.lerariemann.infinity.registry.core.ModBlocks;
4import net.lerariemann.infinity.util.platform.InfinityPlatform;
5import net.minecraft.world.level.block.Block;
6import net.minecraft.world.level.block.GrowingPlantHeadBlock;
7import net.minecraft.world.level.block.KelpBlock;
8import net.minecraft.world.level.block.KelpPlantBlock;
9import net.minecraft.world.level.block.state.BlockState;
10import net.minecraft.world.level.material.FluidState;
11
12public class IridescentKelpBlock extends KelpBlock {
13 public IridescentKelpBlock(Properties settings) {
14 super(settings);
15 }
16
17 @Override
18 protected boolean canGrowInto(BlockState state) {
19 return state.is(ModBlocks.IRIDESCENCE.get());
20 }
21
22 @Override
23 //? if >1.21 {
24 protected
25 //?} else {
26 /*public
27 *///?}
28 Block getBodyBlock() {
29 return ModBlocks.IRIDESCENT_KELP_PLANT.get();
30 }
31
32 public static class Plant extends KelpPlantBlock {
33 public Plant(Properties settings) {
34 super(settings);
35 }
36
37 @Override
38 //? if >1.21 {
39 protected
40 //?} else {
41 /*public
42 *///?}
43 FluidState getFluidState(BlockState state) {
44 return InfinityPlatform.INSTANCE.getIridescenceStill().get().getSource(false);
45 }
46
47 @Override
48 protected GrowingPlantHeadBlock getHeadBlock() {
49 return ModBlocks.IRIDESCENT_KELP.get();
50 }
51 }
52}