The rain start/stop and thunder start/stop packets are sent to all players in any dimension.
This affects the client's display of rain particles due to the current dimension not necessarily raining.
changing dimensions updates this info on the clientside. attempting to clear weather has no effect (due to another bug and the fact that the current dimension may not be registered as raining on the server).
This primary affects custom dimensions at the moment but the issue also affects the end and the nether (though those dimensions cannot rain so the visual indicator of the bug is not present).
Code Analysis by @unknown here
Attachments
Comments 4
no data pack is required to reproduce this. the underlying cause occurs even in the End and Nether dimensions. the rain start/stop and thunder start/stop messages are the only messages sent to all players in every dimension.
The end and nether are not affected due to their dimension properties not allowing rain, so the clientside issue does not occur but the raining and thundering status is still sent to clients in those dimensions
forgive the yarn code, but in ServerWorld tick code the rain and thunder gradients are sent to the specific dimension of the serverworld, but the raining and thundering status is sent to all players in all dimensions:
[media]
The same code in 1.18-rc3, using Mojang mappings:
net.minecraft.server.level.ServerLevel.java
private void advanceWeatherCycle() {
boolean $$0 = this.isRaining();
...
if (this.oRainLevel != this.rainLevel) {
this.server.getPlayerList().broadcastAll(new ClientboundGameEventPacket(ClientboundGameEventPacket.RAIN_LEVEL_CHANGE, this.rainLevel), this.dimension());
}
if (this.oThunderLevel != this.thunderLevel) {
this.server.getPlayerList().broadcastAll(new ClientboundGameEventPacket(ClientboundGameEventPacket.THUNDER_LEVEL_CHANGE, this.thunderLevel), this.dimension());
}
if ($$0 != this.isRaining()) {
if ($$0) {
this.server.getPlayerList().broadcastAll(new ClientboundGameEventPacket(ClientboundGameEventPacket.STOP_RAINING, 0.0f));
} else {
this.server.getPlayerList().broadcastAll(new ClientboundGameEventPacket(ClientboundGameEventPacket.START_RAINING, 0.0f));
}
this.server.getPlayerList().broadcastAll(new ClientboundGameEventPacket(ClientboundGameEventPacket.RAIN_LEVEL_CHANGE, this.rainLevel));
this.server.getPlayerList().broadcastAll(new ClientboundGameEventPacket(ClientboundGameEventPacket.THUNDER_LEVEL_CHANGE, this.thunderLevel));
}
}
Could you please include a data pack with a custom dimension that helps reproduce this issue?