Перейти к содержимому

KrepAPI (Mod) 1.1.0 для Minecraft 1.21.11 (Fabric)

Альфа4 апреля 2026Minecraft 1.21.4–1.21.11Fabric20 скачиваний на Modrinth
Это не последняя версия. Последняя для 1.21.11 · Fabric — mc1.21-1.3.0Открыть mc1.21-1.3.0 →
Тестовая версия — возможны ошибки.

Файлы · 1

KrepAPI-1.1.0.jarОсновной50,1 КБСкачать
Основной · 50,1 КБ
SHA-184af42120d2c5c595de2a879990a68a1101c3046SHA-512fae2ffdc4b6dc8d18881938366c75a1e8c6f37e07cb9805aa6a64513f22a3e838bbb6aea6f520b6969f358c0a01ef475850ef110348a89d4e2159805bc920d63
Скачать

Что изменилось

What's New

Raw Keyboard Capture (SERVER_RAW_CAPTURE — capability bit 1 << 2)

Servers can now instruct the client to forward raw GLFW keyboard events (key code, scancode, action, modifier mask, monotone sequence number) back to the server via the new c2s_raw_key packet.

The server sends s2c_raw_capture with a RawCaptureConfig that specifies:

  • mode — OFF (0), ALL (1), or WHITELIST (2, only keys in the key list are forwarded)
  • consumeVanilla — whether the client should suppress Minecraft's own handling of captured keys
  • whitelistKeys — list of GLFW key codes (max 256) used when mode is WHITELIST

New Fabric server-side API in KrepapiFabricServerNetworking:

  • sendRawCaptureConfig(ServerPlayerEntity, RawCaptureConfig) — push a capture config to a specific player
  • registerRawKeyListener(RawKeyListener) / unregisterRawKeyListener(RawKeyListener) — subscribe to incoming c2s_raw_key events with per-listener isolation (exceptions are caught and logged per listener)

Client-side state is managed by the new RawCaptureState class. Capture is cleared automatically on disconnect.

Hardcoded-Key Intercept (INTERCEPT_KEYS — capability bit 1 << 3)

Servers can now suppress specific vanilla key behaviors that are not exposed through KeyMapping — keys like Escape, F3, Tab, F1, and F5 that Minecraft handles internally.

The server sends s2c_intercept_keys with a list of InterceptEntry records, each containing a slot ID and a blockVanilla flag:

Slot constantKeyVanilla behaviour blocked
INTERCEPT_SLOT_ESCAPE (0)EscapeOpens game/pause menu
INTERCEPT_SLOT_F3 (1)F3Toggles debug HUD
INTERCEPT_SLOT_TAB (2)TabShows player list
INTERCEPT_SLOT_F1 (3)F1Toggles HUD visibility
INTERCEPT_SLOT_F5 (4)F5Cycles perspective / chunk reload

An empty entry list clears all intercepts. Maximum 32 entries per sync.

Two new mixins implement the Escape suppression specifically: GameMenuScreenMixin cancels the keyPressed handler in GameMenuScreen, and MinecraftClientMixin cancels openGameMenu — both guard behind InterceptKeyState.blockVanillaForSlot. F3/Tab/F1/F5 are handled inside the existing KeyboardMixin path via InterceptKeyState.shouldConsumeVanillaKey.

Client-side state is managed by the new InterceptKeyState class. Intercepts are cleared automatically on disconnect.

Key Release and Repeat Events for Bound Keys

KrepapiKeyPipeline previously only dispatched events for GLFW_PRESS (action == 1). It now also dispatches for GLFW_REPEAT and GLFW_RELEASE on bound keys.

A new OVERRIDE_HELD_KEYS set tracks which keys are currently held with an active binding so that repeat and release events are only forwarded if the press was already consumed — preventing orphaned release events from leaking through. The held-key set is cleared on disconnect and when server overrides are reset.

This is a wire-transparent change (no new packets), but it is a behaviour change for existing listeners: handlers that only expected press events will now also receive repeat and release.

New Protocol Messages and Packet Types

Three new packet channels are registered in KrepapiNetworking and PayloadTypeRegistry:

ChannelDirectionPayload class
s2c_raw_captureS2CKrepapiRawCaptureS2CPayload
s2c_intercept_keysS2CKrepapiInterceptKeysS2CPayload
c2s_raw_keyC2SKrepapiRawKeyC2SPayload

The :protocol module gains four new record types (RawCaptureConfig, RawKeyEvent, InterceptEntry, InterceptKeysSync) and the corresponding encode* / decode* pairs in ProtocolMessages, with explicit size caps and input validation on decode.

Unit Tests for New Protocol Messages

ProtocolMessagesTest gains four new tests covering the new encode/decode pairs:

  • rawCaptureConfigRoundTrip — full roundtrip including whitelist keys
  • rawKeyEventRoundTrip — all five fields preserved
  • interceptKeysSyncRoundTrip — multi-entry list and blockVanilla flag
  • encodeRawCaptureRejectsTooManyKeys — verifies the 256-key hard cap is enforced at encode time

Notes

  • KrepAPI is client-side only and compatible with vanilla servers. A 1.0.x client simply won't advertise the new capability bits — the new features are silently skipped, nothing breaks.
  • Developers building on KrepAPI: check the client-advertised protocolVersion in the handshake before sending s2c_raw_capture or s2c_intercept_keys to ensure the client supports them.
  • Install a Fabric API build that matches the Minecraft version.
KrepAPI (for developers)
  • Build version (Fabric mod release / c2s_client_info.modVersion, gradle.properties → mod_version): 1.1.0
  • Wire protocol version (KrepapiProtocolVersion.CURRENT, protocolVersion in s2c_hello / c2s_client_info): 2 — bumped because two new S2C packet channels and one new C2S packet channel were added. A 1.0.x client simply won't advertise the new capability bits (SERVER_RAW_CAPTURE, INTERCEPT_KEYS) and will not receive the new packets — nothing breaks. For developers building on top of KrepAPI: check the client-advertised protocolVersion before sending 1.1.0-only packets.

Сайт использует cookie: необходимые — для входа и темы, а также счётчики посещений Яндекс Метрика и LiveInternet — по ним мы видим, как пользуются сайтом. Рекламных cookie у нас нет. Подробнее