fabric: Update for Minecraft 1.21.7 (#648)

* fabric: Update for Minecraft 1.21.5

* Fabric 1.21.7
This commit is contained in:
Jason Penilla authored and GitHub committed 2025-07-14 11:12:08 -07:00
1 parent 3e175b89eb
commit 251f505b47
8 files changed
+21 -21

No files matched your search

@@ -84,6 +84,8 @@ publishMods.modrinth {
"1.21.3",
"1.21.4",
"1.21.5",
"1.21.6",
"1.21.7",
)
}
+1 -1
View File
@@ -18,7 +18,7 @@ hangarPublish.publications.register("plugin") {
apiKey = providers.environmentVariable("HANGAR_UPLOAD_KEY")
platforms.paper {
jar = project(":carbonchat-paper").platformJar()
platformVersions.add("1.21.1-1.21.5")
platformVersions.add("1.21.1-1.21.7")
dependencies {
url("LuckPerms", "https://luckperms.net/")
hangar("Essentials") {
-4
View File
@@ -44,10 +44,6 @@ dependencies {
modImplementation(libs.adventurePlatformFabric)
include(libs.adventurePlatformFabric)
// Until we upgrade adventure-platform-fabric
implementation("net.kyori:option:1.1.0")
include("net.kyori:option:1.1.0")
modImplementation(libs.miniplaceholders)
runtimeDownload(libs.mysql)
@@ -29,7 +29,7 @@ import net.draycia.carbon.api.users.UserManager;
import net.draycia.carbon.common.users.ConsoleCarbonPlayer;
import net.kyori.adventure.audience.Audience;
import net.kyori.adventure.audience.ForwardingAudience;
import net.kyori.adventure.platform.fabric.FabricServerAudiences;
import net.kyori.adventure.platform.modcommon.MinecraftServerAudiences;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.framework.qual.DefaultQualifier;
import org.jetbrains.annotations.NotNull;
@@ -49,7 +49,7 @@ public final class CarbonServerFabric implements CarbonServer, ForwardingAudienc
@Override
public @NotNull Audience audience() {
return FabricServerAudiences.of(this.serverHolder.requireServer()).all();
return MinecraftServerAudiences.of(this.serverHolder.requireServer()).all();
}
@Override
@@ -20,7 +20,6 @@
package net.draycia.carbon.fabric.listeners;
import com.google.inject.Inject;
import java.util.Optional;
import net.draycia.carbon.api.users.CarbonPlayer;
import net.draycia.carbon.common.config.ConfigManager;
import net.draycia.carbon.common.event.events.CarbonChatEventImpl;
@@ -29,10 +28,10 @@ import net.draycia.carbon.common.messages.CarbonMessages;
import net.draycia.carbon.fabric.CarbonChatFabric;
import net.draycia.carbon.fabric.users.CarbonPlayerFabric;
import net.fabricmc.fabric.api.message.v1.ServerMessageEvents;
import net.kyori.adventure.platform.fabric.FabricAudiences;
import net.kyori.adventure.platform.modcommon.MinecraftServerAudiences;
import net.kyori.adventure.text.Component;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.core.Registry;
import net.minecraft.core.Holder;
import net.minecraft.core.RegistryAccess;
import net.minecraft.core.registries.Registries;
import net.minecraft.network.chat.ChatType;
@@ -80,12 +79,14 @@ public class FabricChatHandler extends ChatListenerInternal implements ServerMes
for (final var recipient : chatEvent.recipients()) {
final Component finishedMessage = chatEvent.renderFor(recipient);
final net.minecraft.network.chat.Component nativeMessage = FabricAudiences.nonWrappingSerializer().serialize(finishedMessage);
final net.minecraft.network.chat.Component nativeMessage = MinecraftServerAudiences.of(serverPlayer.getServer()).nonWrappingSerializer().serialize(finishedMessage);
final PlayerChatMessage customChatMessage = new PlayerChatMessage(chatMessage.link(), chatMessage.signature(), chatMessage.signedBody(), nativeMessage, FilterMask.FULLY_FILTERED);
final RegistryAccess registryAccess = serverPlayer.level().registryAccess();
if (this.chatTypeResourceKey == null) {
final Registry<ChatType> reg = registryAccess.registryOrThrow(Registries.CHAT_TYPE);
this.chatTypeResourceKey = Optional.ofNullable(reg.get(CHAT_TYPE_KEY)).flatMap(reg::getResourceKey).orElseThrow();
this.chatTypeResourceKey = registryAccess.lookupOrThrow(Registries.CHAT_TYPE)
.get(CHAT_TYPE_KEY)
.flatMap(Holder.Reference::unwrapKey)
.orElseThrow();
}
final ChatType.Bound customBound = ChatType.bind(this.chatTypeResourceKey, registryAccess, nativeMessage);
@@ -36,7 +36,7 @@ import net.draycia.carbon.fabric.MinecraftServerHolder;
import net.kyori.adventure.audience.Audience;
import net.kyori.adventure.audience.ForwardingAudience;
import net.kyori.adventure.identity.Identity;
import net.kyori.adventure.platform.fabric.FabricServerAudiences;
import net.kyori.adventure.platform.modcommon.MinecraftServerAudiences;
import net.kyori.adventure.text.Component;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.EquipmentSlot;
@@ -157,13 +157,13 @@ public class CarbonPlayerFabric extends WrappedCarbonPlayer implements Forwardin
return null;
}
return FabricServerAudiences.of(player.server).toAdventure(item.getDisplayName());
return MinecraftServerAudiences.of(player.getServer()).asAdventure(item.getDisplayName());
}
@Override
public boolean hasPermission(final String permission) {
return this.player()
.map(player -> Permissions.check(player, permission, player.server.getOperatorUserPermissionLevel()))
.map(player -> Permissions.check(player, permission, player.getServer().getOperatorUserPermissionLevel()))
.orElse(false);
}
+4 -4
View File
@@ -36,11 +36,11 @@ registry = "1.0.0-SNAPSHOT"
kyoriMoonshine = "2.0.4"
guice = "7.0.0"
velocityApi = "3.4.0-SNAPSHOT"
minecraft = "1.21.1"
minecraft = "1.21.7"
fabricLoader = "0.16.14"
fabricApi = "0.115.6+1.21.1"
fabricPermissionsApi = "0.3.1"
adventurePlatformFabric = "5.14.2"
fabricApi = "0.129.0+1.21.7"
fabricPermissionsApi = "0.4.1"
adventurePlatformFabric = "6.5.0-SNAPSHOT"
luckPermsApi = "5.4"
essentialsx = "2.20.1"
discordsrv = "1.28.1"
+2 -1
View File
@@ -12,6 +12,7 @@ dependencyResolutionManagement {
includeModule("org.incendo", "cloud-sponge")
includeModule("com.seiama", "registry")
includeModule("com.seiama", "event-api")
includeGroup("net.kyori") // adventure-platform-mod 6.5.0-SNAPSHOT
}
}
maven("https://central.sonatype.com/repository/maven-snapshots/") {
@@ -78,7 +79,7 @@ pluginManagement {
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.10.0"
id("quiet-fabric-loom") version "1.10-SNAPSHOT"
id("quiet-fabric-loom") version "1.11-SNAPSHOT"
}
rootProject.name = "CarbonChat"