TrappedChestBlockEntity .java

net.minecraft.world.level.block.entity.TrappedChestBlockEntity (class, 28 lines): members: signalOpenCount. imports: TrappedChestBlock, Orientation, Block.

net.minecraft.world.level.block.entityclass28 linescommonextends ChestBlockEntity1.2 KB

API Surface (1)

void signalOpenCount(final Level level, final BlockPos pos, final BlockState blockState, final int previous, final int current)

Full Source

TrappedChestBlockEntity.java28 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.level.block.entity;
2
3
import net.minecraft.core.BlockPos;
4
import net.minecraft.core.Direction;
5
import net.minecraft.world.level.Level;
6
import net.minecraft.world.level.block.Block;
7
import net.minecraft.world.level.block.TrappedChestBlock;
8
import net.minecraft.world.level.block.state.BlockState;
9
import net.minecraft.world.level.redstone.ExperimentalRedstoneUtils;
10
import net.minecraft.world.level.redstone.Orientation;
11
12
public class TrappedChestBlockEntity extends ChestBlockEntity {
13
	public TrappedChestBlockEntity(final BlockPos worldPosition, final BlockState blockState) {
14
		super(BlockEntityTypes.TRAPPED_CHEST, worldPosition, blockState);
15
	}
16
17
	@Override
18
	protected void signalOpenCount(final Level level, final BlockPos pos, final BlockState blockState, final int previous, final int current) {
19
		super.signalOpenCount(level, pos, blockState, previous, current);
20
		if (previous != current) {
21
			Orientation orientation = ExperimentalRedstoneUtils.initialOrientation(level, blockState.getValue(TrappedChestBlock.FACING).getOpposite(), Direction.UP);
22
			Block block = blockState.getBlock();
23
			level.updateNeighborsAt(pos, block, orientation);
24
			level.updateNeighborsAt(pos.below(), block, orientation);
25
		}
26
	}
27
}
28

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