InfestedRotatedPillarBlock .java

net.minecraft.world.level.block.InfestedRotatedPillarBlock (class, 30 lines): members: rotate, getStateForPlacement. imports: BlockPlaceContext.

net.minecraft.world.level.blockclass30 linescommonextends InfestedBlock1.1 KB

API Surface (3)

BlockState rotate(final BlockState state, final Rotation rotation)
void createBlockStateDefinition(final StateDefinition.Builder<Block, BlockState> builder)
BlockState getStateForPlacement(final BlockPlaceContext context)

Full Source

InfestedRotatedPillarBlock.java30 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.level.block;
2
3
import net.minecraft.core.Direction;
4
import net.minecraft.world.item.context.BlockPlaceContext;
5
import net.minecraft.world.level.block.state.BlockBehaviour;
6
import net.minecraft.world.level.block.state.BlockState;
7
import net.minecraft.world.level.block.state.StateDefinition;
8
9
public class InfestedRotatedPillarBlock extends InfestedBlock {
10
	public InfestedRotatedPillarBlock(final Block hostBlock, final BlockBehaviour.Properties properties) {
11
		super(hostBlock, properties);
12
		this.registerDefaultState(this.defaultBlockState().setValue(RotatedPillarBlock.AXIS, Direction.Axis.Y));
13
	}
14
15
	@Override
16
	protected BlockState rotate(final BlockState state, final Rotation rotation) {
17
		return RotatedPillarBlock.rotatePillar(state, rotation);
18
	}
19
20
	@Override
21
	protected void createBlockStateDefinition(final StateDefinition.Builder<Block, BlockState> builder) {
22
		builder.add(RotatedPillarBlock.AXIS);
23
	}
24
25
	@Override
26
	public BlockState getStateForPlacement(final BlockPlaceContext context) {
27
		return this.defaultBlockState().setValue(RotatedPillarBlock.AXIS, context.getClickedFace().getAxis());
28
	}
29
}
30

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