DryVegetationBlock .java

net.minecraft.world.level.block.DryVegetationBlock (class, 42 lines): members: mayPlaceOn, animateTick, SHAPE, getShape. imports: CollisionContext.

net.minecraft.world.level.blockclass42 linescommonextends VegetationBlock1.5 KB

API Surface (3)

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)
void animateTick(final BlockState state, final Level level, final BlockPos pos, final RandomSource random)

Fields & Constants (1)

SHAPE

Full Source

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

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