LavaCauldronBlock .java

net.minecraft.world.level.block.LavaCauldronBlock (class): members: FILLED_SHAPE, SHAPE_INSIDE, getContentHeight, getEntityInsideCollisionShape, isFull.

net.minecraft.world.level.blockclass53 linescommonextends AbstractCauldronBlock1.9 KB

API Surface (5)

double getContentHeight(final BlockState state)
boolean isFull(final BlockState state)
VoxelShape getEntityInsideCollisionShape(final BlockState state, final BlockGetter level, final BlockPos pos, final Entity entity)
void entityInside(final BlockState state, final Level level, final BlockPos pos, final Entity entity, final InsideBlockEffectApplier effectApplier, final boolean isPrecise)
int getAnalogOutputSignal(final BlockState state, final Level level, final BlockPos pos, final Direction direction)

Fields & Constants (3)

SHAPE_INSIDE
FILLED_SHAPE
effectApplier

Full Source

LavaCauldronBlock.java53 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.core.cauldron.CauldronInteractions;
6
import net.minecraft.world.entity.Entity;
7
import net.minecraft.world.entity.InsideBlockEffectApplier;
8
import net.minecraft.world.entity.InsideBlockEffectType;
9
import net.minecraft.world.level.BlockGetter;
10
import net.minecraft.world.level.Level;
11
import net.minecraft.world.level.block.state.BlockBehaviour;
12
import net.minecraft.world.level.block.state.BlockState;
13
import net.minecraft.world.phys.shapes.Shapes;
14
import net.minecraft.world.phys.shapes.VoxelShape;
15
16
public class LavaCauldronBlock extends AbstractCauldronBlock {
17
	private static final VoxelShape SHAPE_INSIDE = Block.column(12.0, 4.0, 15.0);
18
	private static final VoxelShape FILLED_SHAPE = Shapes.or(AbstractCauldronBlock.SHAPE, SHAPE_INSIDE);
19
20
	public LavaCauldronBlock(final BlockBehaviour.Properties properties) {
21
		super(properties, CauldronInteractions.LAVA);
22
	}
23
24
	@Override
25
	protected double getContentHeight(final BlockState state) {
26
		return 0.9375;
27
	}
28
29
	@Override
30
	public boolean isFull(final BlockState state) {
31
		return true;
32
	}
33
34
	@Override
35
	protected VoxelShape getEntityInsideCollisionShape(final BlockState state, final BlockGetter level, final BlockPos pos, final Entity entity) {
36
		return FILLED_SHAPE;
37
	}
38
39
	@Override
40
	protected void entityInside(
41
		final BlockState state, final Level level, final BlockPos pos, final Entity entity, final InsideBlockEffectApplier effectApplier, final boolean isPrecise
42
	) {
43
		effectApplier.apply(InsideBlockEffectType.CLEAR_FREEZE);
44
		effectApplier.apply(InsideBlockEffectType.LAVA_IGNITE);
45
		effectApplier.runAfter(InsideBlockEffectType.LAVA_IGNITE, Entity::lavaHurt);
46
	}
47
48
	@Override
49
	protected int getAnalogOutputSignal(final BlockState state, final Level level, final BlockPos pos, final Direction direction) {
50
		return 3;
51
	}
52
}
53

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