leejunyoung5819 mc-paper-plugin-test-mcp-26.3
공개마인크래프트 26.3 Paper 서버의 플러그인 테스트를 하려는 AI 에이전트를 위한 MCP 도구
| 1 | package dev.mctester.bridge.mixin; |
| 2 | |
| 3 | import dev.mctester.bridge.QaBridgeClient; |
| 4 | import net.minecraft.client.multiplayer.ServerData; |
| 5 | import org.spongepowered.asm.mixin.Mixin; |
| 6 | import org.spongepowered.asm.mixin.injection.At; |
| 7 | import org.spongepowered.asm.mixin.injection.Inject; |
| 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; |
| 9 | |
| 10 | /** |
| 11 | * Optional: treat every server as "resource packs: enabled" so a server resource pack loads without the |
| 12 | * confirmation prompt (which would otherwise block automated joins). |
| 13 | */ |
| 14 | @Mixin(ServerData.class) |
| 15 | public class ServerDataMixin { |
| 16 | @Inject(method = "getResourcePackStatus", at = @At("HEAD"), cancellable = true) |
| 17 | private void qa$acceptPacks(CallbackInfoReturnable<ServerData.ServerPackStatus> cir) { |
| 18 | if (QaBridgeClient.ACCEPT_SERVER_PACKS) cir.setReturnValue(ServerData.ServerPackStatus.ENABLED); |
| 19 | } |
| 20 | } |