use of net.minecraft.world.level.chunk.LevelChunkSection in project SpongeCommon by SpongePowered.
the class UpdateChunkLightManagerEffect method processSideEffect.
@Override
public EffectResult processSideEffect(final BlockPipeline pipeline, final PipelineCursor oldState, final BlockState newState, final SpongeBlockChangeFlag flag, final int limit) {
final LevelChunkSection chunkSection = pipeline.getAffectedSection();
final boolean wasEmpty = pipeline.wasEmpty();
final boolean isStillEmpty = chunkSection.isEmpty();
if (wasEmpty != isStillEmpty) {
pipeline.getServerWorld().getChunkSource().getLightEngine().updateSectionStatus(oldState.pos, isStillEmpty);
}
return EffectResult.NULL_PASS;
}
use of net.minecraft.world.level.chunk.LevelChunkSection in project SpongeCommon by SpongePowered.
the class SetBlockToChunkSectionEffect method processSideEffect.
@Override
public EffectResult processSideEffect(final BlockPipeline pipeline, final PipelineCursor oldState, final BlockState newState, final SpongeBlockChangeFlag flag, final int limit) {
final LevelChunkSection chunkSection = pipeline.getAffectedSection();
final int x = oldState.pos.getX() & 15;
final int y = oldState.pos.getY() & 15;
final int z = oldState.pos.getZ() & 15;
final BlockState oldStateReturned = chunkSection.setBlockState(x, y, z, newState);
if (oldStateReturned == newState) {
return EffectResult.NULL_RETURN;
}
return EffectResult.NULL_PASS;
}
Aggregations