▶️ ЗАБЕРИ СВОИ 8 ПОДАРКОВ 🎁 ПРИ СОЗДАНИИ СВОЕГО МАЙНКРАФТ СЕРВЕРА
Моды/KrepAPI (Mod)
KrepAPI (Mod)

KrepAPI (Mod)

Fabric client bridge for servers: custom key bindings synced from the host, optional raw-key hooks for addons, and a handshake so Paper/Fabric servers can require this mod. Install only on servers that use KrepAPI. Needs Fabric API.

59
0
Все версииKrepAPI (Mod) mc1.21-1.2.0

KrepAPI (Mod) mc1.21-1.2.0

Alpha1 нед. назад

Список изменений

Added

Server-driven mouse capture (Fabric client + Fabric/Paper server reference)

  • New custom payload / plugin message channels:
    • krepapi:s2c_mouse_capture — enable or configure capture (enabled, flags, consumeVanilla).
    • krepapi:c2s_mouse_action — client reports button presses/releases, scroll deltas, and optionally normalized cursor position on each forwarded event.
  • Flags (combine with bitwise OR): mouse buttons (left/right/middle via GLFW button id), scroll wheel, optional cursor on events (cursor as 0–1 in scaled window coordinates).
  • Capability SERVER_MOUSE_CAPTURE in c2s_client_info. Reference implementations only send s2c_mouse_capture if the client advertised this bit, so older KrepAPI clients without mouse support are not sent an unregistered payload.
  • Wire format is defined in ProtocolMessages (same bytes on Fabric custom play payloads and Paper sendPluginMessage); c2s_mouse_action is self-describing so Paper can decode without remembering prior S2C state.
  • Client: MouseCaptureState, MouseMixin on MouseHandler (onButton with MouseButtonInfo, onScroll), same eligibility gate as raw keyboard capture (in play, network handler present, player or screen open).
  • Server: Fabric — KrepapiFabricServerNetworking.registerMouseActionListener, sendMouseCaptureConfig, getClientCapabilities; handshake entry stores the client capability bitmask after a successful c2s_client_info. Paper — outgoing/incoming channel registration, KrepapiPaperPlugin.sendMouseCaptureConfig, getClientCapabilities, session capability map, debug logging for mouse actions.

Build version requirement expressions (legacy / ranges)

  • KrepapiVersionRequirement parses minimum-mod-version / Fabric minimumModVersion / plugin registrations: bare X.Y.Z remains >= (compatible); also X.Y.Z>, =X.Y.Z, <X.Y.Z, X.Y.x / X.Y.*, two-part X.Y for a minor line; middle wildcards (1.x.2) are rejected.
  • KrepapiVersionPolicy evaluates the intersection of all requirements; KrepapiKickReasons.forVersionCheckFailure formats kicks. s2c_hello.minModVersion is a summary (max floor if all are minima, else joined specs).
  • Paper: invalid minimum-mod-version disables the plugin on enable; invalid combined requirements kick on join with a misconfiguration message. Fabric: logs invalid default settings at register; per-join validation with the same kick text.

Minecraft 26.1 Fabric build (:fabric-26-1)

  • Second Fabric artifact from the same repo: KrepAPI-mc26.1 (mod id still krepapi), targeting 26.1–26.1.1, Loader 0.18.6, Fabric API 0.144.3+26.1, net.fabricmc.fabric-loom 1.15-SNAPSHOT (unobfuscated game; no remapJar), Java 25 toolchain.
  • Source tree is a fork of the 1.21 module with 26.1-specific wiring: PayloadTypeRegistry.clientboundPlay / serverboundPlay, KeyMappingHelper.registerKeyMapping (fabric-key-mapping-api-v1).

Fixed

overrideVanilla server bindings vs. player keybinds

  • Vanilla blocking for overrideVanilla previously compared each key event only to the defaultKey from s2c_bindings. After rebinding in Minecraft’s controls, the wrong key (or no key) could still be consumed or missed.
  • The client now keeps a list of actionIds with overrideVanilla and, on every key event, resolves the current KeyMapping and uses KeyMapping.matches(KeyEvent) so suppression follows the live binding (KrepapiKeyPipeline).
  • ServerBindingManager.applyBindings registers all server KeyMappings before applying the override list, so lookups are always valid when the list is installed.

Changed

  • Two-part requirement strings: A value with exactly two numeric segments (e.g. 1.2) is now a minor line (1.2.x), not a shorthand for >= 1.2.0. Use 1.2.0 or 1.2.0> for a minimum floor.

Gradle layout

  • Fabric mod for 1.21.4–1.21.11 lives in fabric-1-21KrepAPI-mc1.21 JAR (remapped Loom as before). Root project is an aggregator; run gradlew build to produce both Fabric JARs plus protocol and paper-plugin.
  • Gradle Wrapper updated to 9.4.0 (recommended for Loom 1.15 / 26.1).

Build targets (this repository)

  • Fabric fabric-1-21 (KrepAPI-mc1.21): Minecraft 1.21.11, Fabric Loader 0.18.2, Fabric API 0.139.4+1.21.11, net.fabricmc.fabric-loom-remap 1.14-SNAPSHOT, official Mojang mappings (loom.officialMojangMappings()), Java 21. fabric.mod.json range >=1.21.4 <=1.21.11.
  • Networking (Fabric 1.21): play payloads use CustomPacketPayload, CustomPacketPayload.Type, and StreamCodec on RegistryFriendlyByteBuf (Mojang names; not Yarn CustomPayload / PacketCodec / RegistryByteBuf).
  • Paper reference plugin: paper-api 1.21.11-R0.1-SNAPSHOT, plugin.yml api-version: '1.21.11', default minimum mod build tracks the mod (see gradle.properties mod_version).
  • Server-driven keys on 1.21.x use KeyBindingHelper.registerKeyBinding (net.fabricmc.fabric.api.client.keybinding.v1).

Documentation

  • docs/protocol.md — wire format, channels, build requirement expressions, kick reasons, minModVersion summary semantics.
  • docs/client-api.md — mouse capture, intercept keys, handshake fields, Fabric server settings, fabric.mod.json depends, version API examples.
  • docs/paper-plugin.md — config examples, versionGate, capabilities / sendMouseCaptureConfig, Gradle note.

Файлы

KrepAPI-mc1.21-1.2.0.jar(94.67 KiB)
Основной
Скачать
KrepAPI-mc1.21-1.2.0-sources.jar(26.56 KiB)
Скачать

Метаданные

Канал релиза

Alpha

Номер версии

mc1.21-1.2.0

Загрузчики

Fabric

Версии игры

1.21.4–1.21.11

Загрузок

7

Дата публикации

1 нед. назад

Загрузил

ID версии

Главная