mirror of
https://github.com/EngineHub/WorldEdit.git
synced 2024-11-21 01:13:09 +08:00
Apply update flag on later change (#2037)
* Apply update flag on later change * Checkstyle * Move entry point for UPDATE
This commit is contained in:
parent
eac5b51b0f
commit
30e1601489
@ -153,6 +153,12 @@ public void notifyNeighbors(BlockPos pos, net.minecraft.world.level.block.state.
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateBlock(BlockPos pos, net.minecraft.world.level.block.state.BlockState oldState, net.minecraft.world.level.block.state.BlockState newState) {
|
||||
ServerLevel world = getWorld();
|
||||
newState.onPlace(world, pos, oldState, false);
|
||||
}
|
||||
|
||||
private void fireNeighborChanged(BlockPos pos, ServerLevel world, Block block, BlockPos neighborPos) {
|
||||
world.getBlockState(neighborPos).neighborChanged(world, neighborPos, block, pos, false);
|
||||
}
|
||||
|
@ -153,6 +153,12 @@ public void notifyNeighbors(BlockPos pos, net.minecraft.world.level.block.state.
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateBlock(BlockPos pos, net.minecraft.world.level.block.state.BlockState oldState, net.minecraft.world.level.block.state.BlockState newState) {
|
||||
ServerLevel world = getWorld();
|
||||
newState.onPlace(world, pos, oldState, false);
|
||||
}
|
||||
|
||||
private void fireNeighborChanged(BlockPos pos, ServerLevel world, Block block, BlockPos neighborPos) {
|
||||
world.getBlockState(neighborPos).neighborChanged(world, neighborPos, block, pos, false);
|
||||
}
|
||||
|
@ -97,6 +97,10 @@ default void applySideEffects(BlockVector3 position, BlockState previousType, Si
|
||||
NBS oldData = toNative(previousType);
|
||||
NBS newData = getBlockState(chunk, pos);
|
||||
|
||||
if (sideEffectSet.shouldApply(SideEffect.UPDATE)) {
|
||||
updateBlock(pos, oldData, newData);
|
||||
}
|
||||
|
||||
if (sideEffectSet.getState(SideEffect.LIGHTING) == SideEffect.State.ON) {
|
||||
updateLightingForBlock(pos);
|
||||
}
|
||||
@ -146,6 +150,9 @@ default void setCurrentSideEffectSet(SideEffectSet sideEffectSet) {
|
||||
|
||||
void notifyNeighbors(NP pos, NBS oldState, NBS newState);
|
||||
|
||||
default void updateBlock(NP pos, NBS oldState, NBS newState) {
|
||||
}
|
||||
|
||||
void updateNeighbors(NP pos, NBS oldState, NBS newState, int recursionLimit);
|
||||
|
||||
void onBlockStateChange(NP pos, NBS oldState, NBS newState);
|
||||
|
@ -141,6 +141,12 @@ public void notifyNeighbors(BlockPos pos, BlockState oldState, BlockState newSta
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateBlock(BlockPos pos, BlockState oldState, BlockState newState) {
|
||||
Level world = getWorld();
|
||||
newState.onPlace(world, pos, oldState, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateNeighbors(BlockPos pos, BlockState oldState, BlockState newState, int recursionLimit) {
|
||||
Level world = getWorld();
|
||||
|
@ -145,6 +145,12 @@ public void notifyNeighbors(BlockPos pos, BlockState oldState, BlockState newSta
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateBlock(BlockPos pos, BlockState oldState, BlockState newState) {
|
||||
ServerLevel world = getWorld();
|
||||
newState.onPlace(world, pos, oldState, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateNeighbors(BlockPos pos, BlockState oldState, BlockState newState, int recursionLimit) {
|
||||
ServerLevel world = getWorld();
|
||||
|
@ -137,6 +137,12 @@ public void notifyNeighbors(BlockPos pos, BlockState oldState, BlockState newSta
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateBlock(BlockPos pos, BlockState oldState, BlockState newState) {
|
||||
ServerLevel world = getWorld();
|
||||
newState.onPlace(world, pos, oldState, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateNeighbors(BlockPos pos, BlockState oldState, BlockState newState, int recursionLimit) {
|
||||
ServerLevel world = getWorld();
|
||||
|
Loading…
Reference in New Issue
Block a user