Force-enable NETWORK side effect to ensure blocks are instantly visible (#4558)

This commit is contained in:
Hannes Greule 2024-12-30 21:01:10 +01:00 committed by GitHub
parent 47d1f1e0cb
commit effbacb823
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -62,19 +62,28 @@ public class BukkitQueueCoordinator extends BasicQueueCoordinator {
private static final SideEffectSet EDGE_LIGHTING_SIDE_EFFECT_SET; private static final SideEffectSet EDGE_LIGHTING_SIDE_EFFECT_SET;
static { static {
NO_SIDE_EFFECT_SET = SideEffectSet.none().with(SideEffect.LIGHTING, SideEffect.State.OFF).with( NO_SIDE_EFFECT_SET = enableNetworkIfNeeded()
SideEffect.NEIGHBORS, .with(SideEffect.LIGHTING, SideEffect.State.OFF)
SideEffect.State.OFF .with(SideEffect.NEIGHBORS, SideEffect.State.OFF);
); EDGE_SIDE_EFFECT_SET = NO_SIDE_EFFECT_SET
EDGE_SIDE_EFFECT_SET = SideEffectSet.none().with(SideEffect.UPDATE, SideEffect.State.ON).with( .with(SideEffect.UPDATE, SideEffect.State.ON)
SideEffect.NEIGHBORS, .with(SideEffect.NEIGHBORS, SideEffect.State.ON);
SideEffect.State.ON LIGHTING_SIDE_EFFECT_SET = NO_SIDE_EFFECT_SET
); .with(SideEffect.NEIGHBORS, SideEffect.State.OFF);
LIGHTING_SIDE_EFFECT_SET = SideEffectSet.none().with(SideEffect.NEIGHBORS, SideEffect.State.OFF); EDGE_LIGHTING_SIDE_EFFECT_SET = NO_SIDE_EFFECT_SET
EDGE_LIGHTING_SIDE_EFFECT_SET = SideEffectSet.none().with(SideEffect.UPDATE, SideEffect.State.ON).with( .with(SideEffect.UPDATE, SideEffect.State.ON)
SideEffect.NEIGHBORS, .with(SideEffect.NEIGHBORS, SideEffect.State.ON);
SideEffect.State.ON }
);
// make sure block changes are sent
private static SideEffectSet enableNetworkIfNeeded() {
SideEffect network;
try {
network = SideEffect.valueOf("NETWORK");
} catch (IllegalArgumentException ignored) {
return SideEffectSet.none();
}
return SideEffectSet.none().with(network, SideEffect.State.ON);
} }
private org.bukkit.World bukkitWorld; private org.bukkit.World bukkitWorld;