Skip to content

Commit c234a70

Browse files
committed
Update fabric for snapshot 7
1 parent 0128eaf commit c234a70

File tree

7 files changed

+27
-22
lines changed

7 files changed

+27
-22
lines changed

fabric/src/testmod/java/net/kyori/adventure/platform/test/fabric/AdventureFabricTester.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* This file is part of adventure-platform-mod, licensed under the MIT License.
33
*
4-
* Copyright (c) 2020-2025 KyoriPowered
4+
* Copyright (c) 2020-2026 KyoriPowered
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -75,8 +75,8 @@
7575
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
7676
import net.kyori.adventure.translation.GlobalTranslator;
7777
import net.kyori.adventure.translation.TranslationStore;
78-
import net.minecraft.client.GuiMessageTag;
7978
import net.minecraft.client.Minecraft;
79+
import net.minecraft.client.multiplayer.chat.GuiMessageTag;
8080
import net.minecraft.commands.arguments.EntityArgument;
8181
import net.minecraft.commands.synchronization.SuggestionProviders;
8282
import net.minecraft.network.chat.ComponentUtils;
@@ -293,7 +293,7 @@ private void onClient() {
293293
.clickEvent(openFile(path.toString()))
294294
.build();
295295

296-
ctx.getSource().getClient().gui.getChat().addMessage(MinecraftClientAudiences.of().asNative(message), null, kyoriMessage);
296+
ctx.getSource().getClient().gui.getChat().addPlayerMessage(MinecraftClientAudiences.of().asNative(message), null, kyoriMessage);
297297
// ctx.getSource().getPlayer().sendMessage(message); // Works as well!
298298

299299
return Command.SINGLE_SUCCESS;

gradle/libs.versions.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ ansi = "1.1.1"
88
autoService = "1.1.1"
99
checkstyle = "13.0.0"
1010
examination = "1.3.0"
11-
fabricApi = "0.142.1+26.1"
11+
fabricApi = "0.143.4+26.1"
1212
fabricLoader = "0.18.4"
1313
indra = "4.0.0"
1414
mod-publish-plugin = "1.1.0"
1515
junit = "6.0.2"
16-
minecraft = "26.1-snapshot-4"
16+
minecraft = "26.1-snapshot-7"
1717
vineflower = "1.11.2"
1818
spotless = "8.1.0"
1919
neoforge = "26.1.0.0-alpha.8+snapshot-4"
20-
neoform = "26.1-snapshot-4-1"
20+
neoform = "26.1-snapshot-7-1"
2121

2222
[libraries]
2323
adventure-api = { module = "net.kyori:adventure-api", version.ref = "adventure" }

mod-shared/src/accessor/java/net/kyori/adventure/platform/modcommon/impl/accessor/minecraft/world/level/LevelAccess.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* This file is part of adventure-platform-mod, licensed under the MIT License.
33
*
4-
* Copyright (c) 2020-2024 KyoriPowered
4+
* Copyright (c) 2020-2026 KyoriPowered
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -30,6 +30,6 @@
3030

3131
@Mixin(Level.class)
3232
public interface LevelAccess {
33-
@Accessor("threadSafeRandom")
34-
RandomSource accessor$threadSafeRandom();
33+
@Accessor("soundSeedGenerator")
34+
RandomSource accessor$soundSeedGenerator();
3535
}

mod-shared/src/client/java/net/kyori/adventure/platform/modcommon/impl/client/ClientAudience.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* This file is part of adventure-platform-mod, licensed under the MIT License.
33
*
4-
* Copyright (c) 2020-2025 KyoriPowered
4+
* Copyright (c) 2020-2026 KyoriPowered
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -51,9 +51,9 @@
5151
import net.kyori.adventure.text.Component;
5252
import net.kyori.adventure.title.Title;
5353
import net.kyori.adventure.title.TitlePart;
54-
import net.minecraft.client.GuiMessageTag;
5554
import net.minecraft.client.Minecraft;
5655
import net.minecraft.client.gui.screens.inventory.BookViewScreen;
56+
import net.minecraft.client.multiplayer.chat.GuiMessageTag;
5757
import net.minecraft.client.player.LocalPlayer;
5858
import net.minecraft.client.resources.sounds.EntityBoundSoundInstance;
5959
import net.minecraft.client.resources.sounds.SimpleSoundInstance;
@@ -84,7 +84,7 @@ public ClientAudience(final Minecraft client, final MinecraftClientAudiencesImpl
8484

8585
@Override
8686
public void sendMessage(final @NotNull Component message) {
87-
this.client.gui.getChat().addMessage(this.controller.asNative(message));
87+
this.client.gui.getChat().addClientSystemMessage(this.controller.asNative(message));
8888
}
8989

9090
private net.minecraft.network.chat.ChatType.Bound toMc(final ChatType.Bound bound) {
@@ -94,15 +94,19 @@ private net.minecraft.network.chat.ChatType.Bound toMc(final ChatType.Bound boun
9494
@Override
9595
public void sendMessage(final @NotNull Component message, final ChatType.@NotNull Bound boundChatType) {
9696
final net.minecraft.network.chat.ChatType.Bound bound = this.toMc(boundChatType);
97-
this.client.gui.getChat().addMessage(bound.decorate(this.controller.asNative(message)), null, GuiMessageTag.chatNotSecure());
97+
this.client.gui.getChat().addPlayerMessage(bound.decorate(this.controller.asNative(message)), null, GuiMessageTag.chatNotSecure());
9898
}
9999

100100
@Override
101101
public void sendMessage(final @NotNull SignedMessage signedMessage, final ChatType.@NotNull Bound boundChatType) {
102102
final net.minecraft.network.chat.ChatType.Bound bound = this.toMc(boundChatType);
103103
final Component message = Objects.requireNonNullElse(signedMessage.unsignedContent(), Component.text(signedMessage.message()));
104104

105-
this.client.gui.getChat().addMessage(bound.decorate(this.controller.asNative(message)), (MessageSignature) (Object) signedMessage.signature(), this.tag(signedMessage));
105+
this.client.gui.getChat().addPlayerMessage(
106+
bound.decorate(this.controller.asNative(message)),
107+
(MessageSignature) (Object) signedMessage.signature(),
108+
this.tag(signedMessage)
109+
);
106110
}
107111

108112
private GuiMessageTag tag(final SignedMessage message) {
@@ -135,12 +139,12 @@ public void sendMessage(final Identity source, final @NotNull Component message,
135139
if (type == MessageType.CHAT) {
136140
// Add to chat queue (following delay and such)
137141
if (visibility == ChatVisiblity.FULL) {
138-
this.client.gui.getChat().addMessage(this.controller.asNative(message), null, null);
142+
this.client.gui.getChat().addPlayerMessage(this.controller.asNative(message), null, null);
139143
}
140144
} else {
141145
// Add immediately as a system message
142146
if (visibility == ChatVisiblity.FULL || visibility == ChatVisiblity.SYSTEM) {
143-
this.client.gui.getChat().addMessage(this.controller.asNative(message));
147+
this.client.gui.getChat().addClientSystemMessage(this.controller.asNative(message));
144148
}
145149
}
146150
}
@@ -215,7 +219,7 @@ private long seed(final @NotNull Sound sound) {
215219
} else {
216220
final @Nullable LocalPlayer player = this.client.player;
217221
if (player != null) {
218-
return ((LevelAccess) player.level()).accessor$threadSafeRandom().nextLong();
222+
return ((LevelAccess) player.level()).accessor$soundSeedGenerator().nextLong();
219223
} else {
220224
return 0l;
221225
}

mod-shared/src/main/java/net/kyori/adventure/platform/modcommon/impl/server/ServerBossBarListener.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* This file is part of adventure-platform-mod, licensed under the MIT License.
33
*
4-
* Copyright (c) 2020-2024 KyoriPowered
4+
* Copyright (c) 2020-2026 KyoriPowered
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -25,6 +25,7 @@
2525

2626
import java.util.Iterator;
2727
import java.util.Map;
28+
import java.util.UUID;
2829
import net.kyori.adventure.bossbar.BossBar;
2930
import net.kyori.adventure.platform.modcommon.impl.AbstractBossBarListener;
3031
import net.kyori.adventure.platform.modcommon.impl.MinecraftAudiencesInternal;
@@ -129,7 +130,7 @@ protected ServerBossEvent newBar(
129130
final net.minecraft.world.BossEvent.@NotNull BossBarOverlay style,
130131
final float progress
131132
) {
132-
final ServerBossEvent event = new ServerBossEvent(title, color, style);
133+
final ServerBossEvent event = new ServerBossEvent(UUID.randomUUID(), title, color, style);
133134
event.setProgress(progress);
134135
return event;
135136
}

mod-shared/src/main/java/net/kyori/adventure/platform/modcommon/impl/server/ServerPlayerAudience.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* This file is part of adventure-platform-mod, licensed under the MIT License.
33
*
4-
* Copyright (c) 2020-2025 KyoriPowered
4+
* Copyright (c) 2020-2026 KyoriPowered
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -184,7 +184,7 @@ private long seed(final @NotNull Sound sound) {
184184
if (sound.seed().isPresent()) {
185185
return sound.seed().getAsLong();
186186
} else {
187-
return ((LevelAccess) this.player.level()).accessor$threadSafeRandom().nextLong();
187+
return ((LevelAccess) this.player.level()).accessor$soundSeedGenerator().nextLong();
188188
}
189189
}
190190

settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ dependencyResolutionManagement {
4949

5050
versionCatalogs {
5151
create("fabricApiLibs") {
52-
from("net.fabricmc.fabric-api:fabric-api-catalog:0.142.1+26.1")
52+
from("net.fabricmc.fabric-api:fabric-api-catalog:0.143.4+26.1")
5353
}
5454
}
5555
}

0 commit comments

Comments
 (0)