Skip to content

Commit

Permalink
Fix ServerStatus missing vanilla constructor (#1179)
Browse files Browse the repository at this point in the history
  • Loading branch information
IzzelAliz committed Jan 20, 2024
1 parent 1317cbd commit 0be5502
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ public class ArclightMixinPlugin implements IMixinConfigPlugin {
.add("net.minecraft.world.level.storage.LevelStorageSource.LevelStorageAccess")
.add("net.minecraft.network.protocol.game.ClientboundSystemChatPacket")
.add("net.minecraft.network.protocol.game.ClientboundSectionBlocksUpdatePacket")
.add("net.minecraft.network.protocol.status.ServerStatus")
.build();

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"network.protocol.game.CPlayerTryUseItemPacketMixin",
"network.protocol.game.SWorldBorderPacketMixin",
"network.protocol.handshake.CHandshakePacketMixin",
"network.protocol.status.ServerStatusMixin",
"network.rcon.RConConsoleSourceMixin",
"server.BootstrapMixin",
"server.CustomServerBossInfoMixin",
Expand Down

0 comments on commit 0be5502

Please sign in to comment.