Drop mappings declaration for unobfuscated 26.2
Some checks failed
continuous-integration/drone/push Build is failing

Starting with 26.1 Mojang ships Minecraft unobfuscated, and Yarn /
Intermediary are no longer published past 1.21.11. Loom does not need
a mappings dependency in that mode: the Mojang-named source compiles
directly. Remove the mappings line, drop the yarn_mappings property,
revert the client entrypoint to Mojang names (Minecraft, Component,
ChatFormatting, gui.getChat(), getUser().getName()), and rewrite the
README note so it stops claiming Mojang mappings via Loom.
This commit is contained in:
2026-06-21 15:57:22 +06:00
parent 71dc665ef1
commit 8a969bc843
4 changed files with 20 additions and 22 deletions

View File

@@ -30,7 +30,7 @@
Дата релиза `Minecraft 26.2`: `2026-06-16`. Дата релиза `Minecraft 26.2`: `2026-06-16`.
Для этой версии я использую official Mojang mappings через Loom, потому что стандартный Yarn endpoint для `26.2` на момент правки ещё не отдавал mappings. Начиная с `26.1` Mojang перестал обфусцировать клиент, а Yarn и Intermediary перестали публиковаться после `1.21.11`. Поэтому в `build.gradle` нет блока `mappings` вообще: исходники Minecraft уже в человекочитаемых именах Mojang, и Loom собирает мод напрямую против них.
Если в CI стоит старый Loom вроде `1.10.5`, сборка `26.2` упадёт с ошибкой `Unsupported class file major version 69`. Для `26.2` нужен новый Loom из актуальной ветки Fabric. Если в CI стоит старый Loom вроде `1.10.5`, сборка `26.2` упадёт с ошибкой `Unsupported class file major version 69`. Для `26.2` нужен новый Loom из актуальной ветки Fabric.

View File

@@ -30,7 +30,6 @@ repositories {
dependencies { dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}" minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
} }

View File

@@ -4,7 +4,6 @@ org.gradle.configuration-cache=false
# Minecraft 26.2 released on 2026-06-16. # Minecraft 26.2 released on 2026-06-16.
minecraft_version=26.2 minecraft_version=26.2
yarn_mappings=26.2+build.3
loader_version=0.19.3 loader_version=0.19.3
fabric_version=0.152.2+26.2 fabric_version=0.152.2+26.2

View File

@@ -5,9 +5,9 @@ import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.message.v1.ClientSendMessageEvents; import net.fabricmc.fabric.api.client.message.v1.ClientSendMessageEvents;
import net.fabricmc.loader.api.FabricLoader; import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.client.MinecraftClient; import net.minecraft.ChatFormatting;
import net.minecraft.text.Text; import net.minecraft.client.Minecraft;
import net.minecraft.util.Formatting; import net.minecraft.network.chat.Component;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -49,8 +49,8 @@ public final class ClientIrcMod implements ClientModInitializer {
ClientTickEvents.END_CLIENT_TICK.register(client -> { ClientTickEvents.END_CLIENT_TICK.register(client -> {
IrcService.DisplayLine line; IrcService.DisplayLine line;
while ((line = service.pollLine()) != null) { while ((line = service.pollLine()) != null) {
Formatting color = line.system() ? Formatting.GRAY : Formatting.AQUA; ChatFormatting color = line.system() ? ChatFormatting.GRAY : ChatFormatting.AQUA;
pushClientChat(client, Text.literal(line.text()).formatted(color)); pushClientChat(client, Component.literal(line.text()).withStyle(color));
} }
}); });
@@ -63,17 +63,17 @@ public final class ClientIrcMod implements ClientModInitializer {
return false; return false;
} }
MinecraftClient client = MinecraftClient.getInstance(); Minecraft client = Minecraft.getInstance();
String argument = trimmed.length() == COMMAND_PREFIX.length() ? "" : trimmed.substring(COMMAND_PREFIX.length()).trim(); String argument = trimmed.length() == COMMAND_PREFIX.length() ? "" : trimmed.substring(COMMAND_PREFIX.length()).trim();
if (argument.isBlank()) { if (argument.isBlank()) {
pushClientChat(client, Text.literal("[IRC] Usage: .irc <message> | .irc status | .irc reconnect | .irc reload").formatted(Formatting.YELLOW)); pushClientChat(client, Component.literal("[IRC] Usage: .irc <message> | .irc status | .irc reconnect | .irc reload").withStyle(ChatFormatting.YELLOW));
return true; return true;
} }
if ("status".equalsIgnoreCase(argument)) { if ("status".equalsIgnoreCase(argument)) {
String status = service.isConnected() ? "connected" : "disconnected"; String status = service.isConnected() ? "connected" : "disconnected";
pushClientChat(client, Text.literal("[IRC] " + status + " | " + config.host + ":" + config.port + " | clientName=" + config.clientName).formatted(Formatting.YELLOW)); pushClientChat(client, Component.literal("[IRC] " + status + " | " + config.host + ":" + config.port + " | clientName=" + config.clientName).withStyle(ChatFormatting.YELLOW));
return true; return true;
} }
@@ -81,8 +81,8 @@ public final class ClientIrcMod implements ClientModInitializer {
String playerName = resolvePlayerName(client); String playerName = resolvePlayerName(client);
IO_EXECUTOR.execute(() -> { IO_EXECUTOR.execute(() -> {
boolean connected = service.reconnect(playerName); boolean connected = service.reconnect(playerName);
Formatting color = connected ? Formatting.GREEN : Formatting.RED; ChatFormatting color = connected ? ChatFormatting.GREEN : ChatFormatting.RED;
pushClientChat(client, Text.literal("[IRC] reconnect " + (connected ? "ok" : "failed")).formatted(color)); pushClientChat(client, Component.literal("[IRC] reconnect " + (connected ? "ok" : "failed")).withStyle(color));
}); });
return true; return true;
} }
@@ -90,40 +90,40 @@ public final class ClientIrcMod implements ClientModInitializer {
if ("reload".equalsIgnoreCase(argument)) { if ("reload".equalsIgnoreCase(argument)) {
config = IrcConfig.load(FabricLoader.getInstance().getConfigDir().resolve("clientirc.json")); config = IrcConfig.load(FabricLoader.getInstance().getConfigDir().resolve("clientirc.json"));
service.updateConfig(config); service.updateConfig(config);
pushClientChat(client, Text.literal("[IRC] config reloaded").formatted(Formatting.YELLOW)); pushClientChat(client, Component.literal("[IRC] config reloaded").withStyle(ChatFormatting.YELLOW));
return true; return true;
} }
String playerName = resolvePlayerName(client); String playerName = resolvePlayerName(client);
IO_EXECUTOR.execute(() -> { IO_EXECUTOR.execute(() -> {
if (!service.ensureConnected(playerName)) { if (!service.ensureConnected(playerName)) {
pushClientChat(client, Text.literal("[IRC] server is offline or config is wrong").formatted(Formatting.RED)); pushClientChat(client, Component.literal("[IRC] server is offline or config is wrong").withStyle(ChatFormatting.RED));
return; return;
} }
if (!service.sendChat(playerName, argument)) { if (!service.sendChat(playerName, argument)) {
pushClientChat(client, Text.literal("[IRC] send failed").formatted(Formatting.RED)); pushClientChat(client, Component.literal("[IRC] send failed").withStyle(ChatFormatting.RED));
} }
}); });
return true; return true;
} }
private static void pushClientChat(MinecraftClient client, Text text) { private static void pushClientChat(Minecraft client, Component text) {
if (client == null) { if (client == null) {
return; return;
} }
client.execute(() -> { client.execute(() -> {
if (client.inGameHud != null && client.inGameHud.getChatHud() != null) { if (client.gui != null && client.gui.getChat() != null) {
client.inGameHud.getChatHud().addMessage(text); client.gui.getChat().addMessage(text);
} }
}); });
} }
private static String resolvePlayerName(MinecraftClient client) { private static String resolvePlayerName(Minecraft client) {
if (client != null && client.player != null) { if (client != null && client.player != null) {
return client.player.getGameProfile().getName(); return client.player.getGameProfile().getName();
} }
if (client != null && client.getSession() != null) { if (client != null && client.getUser() != null) {
return client.getSession().getUsername(); return client.getUser().getName();
} }
return "unknown"; return "unknown";
} }