InstantNeighborUpdater .java

net.minecraft.world.level.redstone.InstantNeighborUpdater (class, 42 lines): members: shapeUpdate, neighborState, neighborPos, updateFlags, direction, pos.

net.minecraft.world.level.redstoneclass42 linescommon1.3 KB

Implements

API Surface (3)

void shapeUpdate(final Direction direction, final BlockState neighborState, final BlockPos pos, final BlockPos neighborPos, final @Block.UpdateFlags int updateFlags, final int updateLimit)
void neighborChanged(final BlockPos pos, final Block changedBlock, final @Nullable Orientation orientation)
void neighborChanged(final BlockState state, final BlockPos pos, final Block changedBlock, final @Nullable Orientation orientation, final boolean movedByPiston)

Fields & Constants (7)

level
direction
neighborState
pos
neighborPos
updateFlags
orientation

Code Graph: Dependencies (7)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

InstantNeighborUpdater.java42 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.level.redstone;
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.state.BlockState;
8
import org.jspecify.annotations.Nullable;
9
10
public class InstantNeighborUpdater implements NeighborUpdater {
11
	private final Level level;
12
13
	public InstantNeighborUpdater(final Level level) {
14
		this.level = level;
15
	}
16
17
	@Override
18
	public void shapeUpdate(
19
		final Direction direction,
20
		final BlockState neighborState,
21
		final BlockPos pos,
22
		final BlockPos neighborPos,
23
		final @Block.UpdateFlags int updateFlags,
24
		final int updateLimit
25
	) {
26
		NeighborUpdater.executeShapeUpdate(this.level, direction, pos, neighborPos, neighborState, updateFlags, updateLimit - 1);
27
	}
28
29
	@Override
30
	public void neighborChanged(final BlockPos pos, final Block changedBlock, final @Nullable Orientation orientation) {
31
		BlockState state = this.level.getBlockState(pos);
32
		this.neighborChanged(state, pos, changedBlock, orientation, false);
33
	}
34
35
	@Override
36
	public void neighborChanged(
37
		final BlockState state, final BlockPos pos, final Block changedBlock, final @Nullable Orientation orientation, final boolean movedByPiston
38
	) {
39
		NeighborUpdater.executeUpdate(this.level, state, pos, changedBlock, orientation, movedByPiston);
40
	}
41
}
42

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