Fix ServerStatus missing vanilla constructor (#1179)

This commit is contained in:
IzzelAliz 2024-01-20 22:00:22 +08:00
parent 1317cbd37d
commit 0be5502f8e
3 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,19 @@
package io.izzel.arclight.common.mixin.core.network.protocol.status;
import net.minecraft.network.chat.Component;
import net.minecraft.network.protocol.status.ServerStatus;
import org.spongepowered.asm.mixin.Mixin;
import java.util.Optional;
@Mixin(ServerStatus.class)
public class ServerStatusMixin {
public void arclight$constructor(Component description, Optional<ServerStatus.Players> players, Optional<ServerStatus.Version> version, Optional<ServerStatus.Favicon> favicon, boolean enforcesSecureChat, Optional<net.minecraftforge.network.ServerStatusPing> forgeData) {
throw new RuntimeException();
}
public void arclight$constructor(Component description, Optional<ServerStatus.Players> players, Optional<ServerStatus.Version> version, Optional<ServerStatus.Favicon> favicon, boolean enforcesSecureChat) {
arclight$constructor(description, players, version, favicon, enforcesSecureChat, Optional.empty());
}
}

View File

@ -128,6 +128,7 @@ public class ArclightMixinPlugin implements IMixinConfigPlugin {
.add("net.minecraft.world.level.storage.LevelStorageSource.LevelStorageAccess") .add("net.minecraft.world.level.storage.LevelStorageSource.LevelStorageAccess")
.add("net.minecraft.network.protocol.game.ClientboundSystemChatPacket") .add("net.minecraft.network.protocol.game.ClientboundSystemChatPacket")
.add("net.minecraft.network.protocol.game.ClientboundSectionBlocksUpdatePacket") .add("net.minecraft.network.protocol.game.ClientboundSectionBlocksUpdatePacket")
.add("net.minecraft.network.protocol.status.ServerStatus")
.build(); .build();
@Override @Override

View File

@ -45,6 +45,7 @@
"network.protocol.game.CPlayerTryUseItemPacketMixin", "network.protocol.game.CPlayerTryUseItemPacketMixin",
"network.protocol.game.SWorldBorderPacketMixin", "network.protocol.game.SWorldBorderPacketMixin",
"network.protocol.handshake.CHandshakePacketMixin", "network.protocol.handshake.CHandshakePacketMixin",
"network.protocol.status.ServerStatusMixin",
"network.rcon.RConConsoleSourceMixin", "network.rcon.RConConsoleSourceMixin",
"server.BootstrapMixin", "server.BootstrapMixin",
"server.CustomServerBossInfoMixin", "server.CustomServerBossInfoMixin",