Skip to content

Commit 4cbcea8

Browse files
committed
fix(server): fix player crash on login with effects
Fixes: MC-302672 See: https://bugs.mojang.com/browse/MC-302672
1 parent 7efb04b commit 4cbcea8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/mixins/java/org/spongepowered/common/mixin/core/server/level/ServerPlayerMixin.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,4 +1052,15 @@ private boolean isPvpAllowed() {
10521052
private boolean impl$skipUnserializableRootVehicle(final Entity instance) {
10531053
return instance.hasExactlyOnePlayerPassenger() && !((TransientBridge) instance).bridge$isTransient();
10541054
}
1055+
1056+
/**
1057+
* Fixes <a href="https://bugs.mojang.com/browse/MC/issues/MC-302672">MC-302672</a>
1058+
*/
1059+
@WrapOperation(method = "onEffectAdded", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/network/ServerGamePacketListenerImpl;send(Lnet/minecraft/network/protocol/Packet;)V"))
1060+
private void impl$onEffectAdded(ServerGamePacketListenerImpl instance, Packet packet, Operation<Void> original) {
1061+
if (instance == null) {
1062+
return;
1063+
}
1064+
original.call(instance, packet);
1065+
}
10551066
}

0 commit comments

Comments
 (0)