Skip to content

Port to Minecraft 26.2 + admin commands (kick/kill/ban/ban-ip/banlist/broadcast/tpall)#1

Open
Morningstar-Garden wants to merge 9 commits into
HelluPeptic:mainfrom
Morningstar-Garden:feat/minecraft-26.2-port
Open

Port to Minecraft 26.2 + admin commands (kick/kill/ban/ban-ip/banlist/broadcast/tpall)#1
Morningstar-Garden wants to merge 9 commits into
HelluPeptic:mainfrom
Morningstar-Garden:feat/minecraft-26.2-port

Conversation

@Morningstar-Garden

Copy link
Copy Markdown

What & why

Modernizes the Fabric module from Minecraft 1.20.1 (Yarn) to Minecraft 26.2 (Mojang mappings, Java 25) and adds a set of server-admin commands. The mod compiles cleanly and was verified loading on a 26.2 dev server (all mixins apply, 0 errors).

Toolchain changes

  • Minecraft 26.2, Fabric Loader 0.19.3, Fabric API 0.153.0+26.2
  • Fabric Loom 1.17-SNAPSHOT, Gradle 9.5.1, Java 25
  • 26.2 ships de-obfuscated: no mappings declaration, plain implementation deps, no refmap / legacy mixin AP
  • Gradle 9 base { archivesName }; settings.gradle trimmed to Fabric-only (the dead Common/Forge modules were never wired into the Fabric jar and Forge no longer existed on disk)

Source migration (Yarn → Mojang)

All commands, events, mixins and PlayerDataManager were migrated, including the reworked 26.2 APIs:

  • Identifier (not ResourceLocation), sendSystemMessage, level(), teleportTo(... Set<Relative> ...)
  • flattened player inventory (getContainerSize/getItem/setItem)
  • new GameRules get/set, clock & WeatherData subsystems (/day /night /sun /rain /thunderstorm now delegate to vanilla /time and /weather)
  • NameAndId / ban-list profile resolution (services().nameToIdCache())
  • mixin @Inject targets updated to mojmap names (dropAllDeathLoot, handleChat, hurtServer, teleport(TeleportTransition), and a descriptor-qualified teleportTo) — verified at runtime

New commands

  • /kick <player> [reason], /kill [player]
  • /ban <player> [reason], /ban-ip <ip|player> [reason], /banlist [players|ips]
  • /broadcast <message> (alias /bc)
  • /tpall [player] — teleport all online players to you (or a target)
  • /msg now also gates /tell and /w
  • /warp with no args lists warps

Reviewer notes

  • Vanilla-colliding commands (/kick /kill /ban /ban-ip /banlist /msg /tell /w) remove the vanilla node before registering, because Brigadier merges a same-named registration onto the existing vanilla node and drops the mod's requires() predicate — so the fleettools.* permission gates would otherwise never apply. Removal uses a small reflection helper in FleettoolsMod (Brigadier exposes no public remove).
  • New permission nodes: fleettools.kick, fleettools.kill(+.others), fleettools.ban, fleettools.banip, fleettools.banlist, fleettools.broadcast, fleettools.tpall. As with all fabric-permissions-api nodes, they surface in LuckPerms after first use or can be set manually.
  • /ban-ip resolves an online player's IP via getIpAddress(), so the player-name form requires them to be online; raw IPs work regardless.

🤖 Generated with Claude Code

Morningstar-Garden and others added 9 commits June 22, 2026 23:49
Modernize the Fabric module from Minecraft 1.20.1 (Yarn mappings) to
Minecraft 26.2 (Mojang mappings, Java 25), and add several server-admin
commands.

Toolchain:
- minecraft 26.2, Fabric Loader 0.19.3, Fabric API 0.153.0+26.2
- Loom 1.17-SNAPSHOT, Gradle 9.5.1, Java 25
- 26.2 ships de-obfuscated: no mappings declaration, plain `implementation`
  deps, no refmap/legacy mixin AP
- Gradle 9 `base { archivesName }`; trimmed settings.gradle to Fabric-only
  (dead Common/Forge modules removed)

Source migration (Yarn -> Mojang names) across all commands, events,
mixins and PlayerDataManager, including the reworked APIs: Identifier,
sendSystemMessage, level(), teleportTo, flattened inventory, GameRules
get/set, the clock/weather subsystems (time/weather delegate to vanilla),
and the new NameAndId/ban-list profile resolution. Mixin @Inject targets
updated to mojmap method names (verified at runtime on a 26.2 dev server).

New commands:
- /kick, /kill, /ban, /ban-ip, /banlist, /broadcast (+/bc), /tpall
- /msg now also gates /tell and /w
- /warp with no args lists warps

Commands that collide with vanilla (/kick /kill /ban /ban-ip /banlist /msg
/tell /w) remove the vanilla node before registering so the fleettools.*
permission gates actually apply (Brigadier otherwise drops the mod's
requires() when merging onto the existing node).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Teleports to saved locations now restore the saved facing instead of
keeping the player's current view:
- /home, /warp, /spawn and /back store yaw+pitch with each location and
  apply them on teleport
- setLastLocation now captures from the player directly (simplifying all
  call sites) with an explicit overload for setting a specific location

Back-on-death: after a player respawns, their death location is recorded
as their /back point (BackOnDeathHandler via ServerPlayerEvents.AFTER_RESPAWN,
reading the dead entity's position so the respawn teleport can't clobber it).
On by default; deny `fleettools.back.ondeath` to opt a player/group out.

Locations saved before this version have no facing and default to yaw 0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Back-on-death: capture the death location at the moment of death
(ServerLivingEntityEvents.AFTER_DEATH) instead of reading the old player's
position during respawn, which returned the respawn point and lost the
death dimension (e.g. dying in the nether sent /back to the overworld).
The captured spot is promoted to the /back point in AFTER_RESPAWN.

Respawn abilities: re-apply stored fly and god-mode state on AFTER_RESPAWN.
The respawned entity starts with default abilities, so previously a player
had to toggle /fly off and on again after dying.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…1.6.3)

Teleport requests (EssentialsX-style, available to all players by default):
- /tpa <player>, /tphere <player>, /tpaccept [player], /tpdeny [player]
- Full multi-request queue: each recipient can hold one pending request per
  requester; a new request from the same player replaces their old one and
  becomes the most recent. /tpaccept and /tpdeny with no argument act on the
  most recent non-expired request, or on a named requester when given. Requests
  expire after 2 minutes.

/coords: split self vs others. /coords (no arg) shows your own coordinates and
is available to everyone (fleettools.coords); /coords <player> requires
fleettools.coords.others (operators).

Keep inventory: now gated by the fleettools.keepinventory permission, granted to
operators by default, with a per-player /keepinv override that takes precedence
so servers without a permissions manager can still grant/revoke it in-game.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…1.7.0)

Teleport / homes:
- Multiple named homes: /home [name], /sethome [name], /delhome [name],
  /homes; default limit 3 (fleettools.homes.unlimited bypasses).
- /tptoggle to block incoming teleport requests.

Communication:
- /reply (/r) replies to the last whisper partner.
- Timed mutes: /mute <player> [time] [reason] (auto-expiring).

AFK:
- /afk plus auto-AFK after 5 min idle, cleared on movement.
- AFK players are excluded from the sleep-percentage check (SleepStatusMixin).
- AFK shows as a grayed name with an [AFK] tag in the player list.

Chat formatting (EssentialsXChat-style, opt-out when StyledChat/StyledPlayerList
present): LuckPerms prefix/suffix on chat and the player list, keeping messages
cryptographically signed by only decorating the ChatType.Bound name
(PlayerListMixin) rather than re-sending. AFK status also flows through
%luckperms:prefix% (transient prefix node) and a %fleettools:afk% placeholder.

Soft integrations (compile-only, isModLoaded-guarded): Text Placeholder API,
LuckPerms, StyledChat, StyledPlayerList.

Abilities: per-tick reconciliation re-applies stored fly/god after gamemode
changes and respawns, preserving active flight across the change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Vanish (/vanish, /v):
- Hide the player's entity (TrackedEntityMixin), tab list
  (PlayerInfoSendMixin filters outgoing player-info packets so relogs
  and StyledPlayerList can't re-add the entry), and locator bar
  (WaypointVanishMixin + waypoint rebuild on toggle).
- Suppress presence broadcasts: AFK, sleep count, join/quit,
  advancements, deaths, /list, server-ping count/sample, and command
  name-completions.
- Vanish persists across relogs (in-memory) for silent quit/rejoin.
- Mobs ignore vanished (and AFK-protected) players via MobTargetMixin.
- Permissions: fleettools.vanish[.others/.see].

Also: AFK-protection feature (AfkProtectCommand + getAfkProtection),
/list override, and README updates.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
When a player vanishes, broadcast a "left the game" message; when they
un-vanish, broadcast "joined the game" - so vanishing looks like a normal
logout/login to players who can't see them (staff who can are skipped to
avoid contradictory lines).

Mirrors vanilla's placeNewPlayer/removePlayerFromWorld wording, color, and
the "(formerly known as X)" renamed-join variant (driven by the same name
cache comparison), so the messages are indistinguishable from real ones -
including Bedrock players via Geyser/Floodgate whose cached name differs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Incoming /tpa and /tphere requests now include clickable [Accept] and
[Deny] buttons in chat that act on that specific requester - handy when
several requests arrive at once.

The buttons use a custom click event (fleettools:tpaccept / tpdeny with the
requester in an NBT payload) rather than run_command, so the client doesn't
show the "run this command?" confirmation prompt. A mixin on the packet
listener handles the action on the server thread and shares the same
accept/deny logic as the typed commands.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant