KelpPlantBlock .java

net.minecraft.world.level.block.KelpPlantBlock (class): members: canAttachTo, getHeadBlock, canPlaceLiquid, placeLiquid, getFluidState. imports: Fluid.

net.minecraft.world.level.blockclass52 linescommonextends GrowingPlantBodyBlock1.7 KB

Implements

API Surface (5)

GrowingPlantHeadBlock getHeadBlock()
FluidState getFluidState(final BlockState state)
boolean canAttachTo(final BlockState state)
boolean canPlaceLiquid(final @Nullable LivingEntity user, final BlockGetter level, final BlockPos pos, final BlockState state, final Fluid type)
boolean placeLiquid(final LevelAccessor level, final BlockPos pos, final BlockState state, final FluidState fluidState)

Full Source

KelpPlantBlock.java52 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.level.block;
2
3
import net.minecraft.core.BlockPos;
4
import net.minecraft.core.Direction;
5
import net.minecraft.world.entity.LivingEntity;
6
import net.minecraft.world.level.BlockGetter;
7
import net.minecraft.world.level.LevelAccessor;
8
import net.minecraft.world.level.block.state.BlockBehaviour;
9
import net.minecraft.world.level.block.state.BlockState;
10
import net.minecraft.world.level.material.Fluid;
11
import net.minecraft.world.level.material.FluidState;
12
import net.minecraft.world.level.material.Fluids;
13
import net.minecraft.world.phys.shapes.Shapes;
14
import org.jspecify.annotations.Nullable;
15
16
/**
17
 * Access widened by fabric-transitive-access-wideners-v1 to accessible
18
 */
19
public class KelpPlantBlock extends GrowingPlantBodyBlock implements LiquidBlockContainer {
20
	/**
21
	 * Access widened by fabric-transitive-access-wideners-v1 to accessible
22
	 */
23
	public KelpPlantBlock(final BlockBehaviour.Properties properties) {
24
		super(properties, Direction.UP, Shapes.block(), true);
25
	}
26
27
	@Override
28
	protected GrowingPlantHeadBlock getHeadBlock() {
29
		return (GrowingPlantHeadBlock)Blocks.KELP;
30
	}
31
32
	@Override
33
	protected FluidState getFluidState(final BlockState state) {
34
		return Fluids.WATER.getSource(false);
35
	}
36
37
	@Override
38
	protected boolean canAttachTo(final BlockState state) {
39
		return this.getHeadBlock().canAttachTo(state);
40
	}
41
42
	@Override
43
	public boolean canPlaceLiquid(final @Nullable LivingEntity user, final BlockGetter level, final BlockPos pos, final BlockState state, final Fluid type) {
44
		return false;
45
	}
46
47
	@Override
48
	public boolean placeLiquid(final LevelAccessor level, final BlockPos pos, final BlockState state, final FluidState fluidState) {
49
		return false;
50
	}
51
}
52

Decompiled Minecraft 26.3 source of KelpPlantBlock (net/minecraft/world/level/block/KelpPlantBlock.java) with Mojang official mappings, stored verbatim on the site.