NetherRootsBlock .java

net.minecraft.world.level.block.NetherRootsBlock (class, 36 lines): members: supportBlocks, mayPlaceOn, SHAPE, getShape. imports: TagKey.

net.minecraft.world.level.blockclass36 linescommonextends VegetationBlock1.2 KB

API Surface (2)

VoxelShape getShape(final BlockState state, final BlockGetter level, final BlockPos pos, final CollisionContext context)
boolean mayPlaceOn(final BlockState state, final BlockGetter level, final BlockPos pos)

Fields & Constants (2)

SHAPE
supportBlocks

Full Source

NetherRootsBlock.java36 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.level.block;
2
3
import net.minecraft.core.BlockPos;
4
import net.minecraft.tags.TagKey;
5
import net.minecraft.world.level.BlockGetter;
6
import net.minecraft.world.level.block.state.BlockBehaviour;
7
import net.minecraft.world.level.block.state.BlockState;
8
import net.minecraft.world.phys.shapes.CollisionContext;
9
import net.minecraft.world.phys.shapes.VoxelShape;
10
11
/**
12
 * Access widened by fabric-transitive-access-wideners-v1 to accessible
13
 */
14
public class NetherRootsBlock extends VegetationBlock {
15
	private static final VoxelShape SHAPE = Block.column(12.0, 0.0, 13.0);
16
	private final TagKey<Block> supportBlocks;
17
18
	/**
19
	 * Access widened by fabric-transitive-access-wideners-v1 to accessible
20
	 */
21
	public NetherRootsBlock(final TagKey<Block> supportBlocks, final BlockBehaviour.Properties properties) {
22
		super(properties);
23
		this.supportBlocks = supportBlocks;
24
	}
25
26
	@Override
27
	protected VoxelShape getShape(final BlockState state, final BlockGetter level, final BlockPos pos, final CollisionContext context) {
28
		return SHAPE;
29
	}
30
31
	@Override
32
	protected boolean mayPlaceOn(final BlockState state, final BlockGetter level, final BlockPos pos) {
33
		return state.is(this.supportBlocks);
34
	}
35
}
36

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