fabric-1.17: restore web chat functionality
This commit is contained in:
parent
2242fd0a26
commit
0e54d23d61
2 changed files with 6 additions and 4 deletions
|
|
@ -1,5 +1,6 @@
|
|||
package org.dynmap.fabric_1_17.mixin;
|
||||
|
||||
import net.minecraft.server.filter.TextStream;
|
||||
import net.minecraft.server.network.ServerPlayNetworkHandler;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import org.dynmap.fabric_1_17.event.ServerChatEvents;
|
||||
|
|
@ -15,14 +16,14 @@ public abstract class ServerPlayNetworkHandlerMixin {
|
|||
public ServerPlayerEntity player;
|
||||
|
||||
@Inject(
|
||||
method = "method_31286",
|
||||
method = "handleMessage",
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/server/PlayerManager;broadcastChatMessage(Lnet/minecraft/text/Text;Lnet/minecraft/network/MessageType;Ljava/util/UUID;)V",
|
||||
target = "Lnet/minecraft/server/PlayerManager;broadcast(Lnet/minecraft/text/Text;Ljava/util/function/Function;Lnet/minecraft/network/MessageType;Ljava/util/UUID;)V",
|
||||
shift = At.Shift.BEFORE
|
||||
)
|
||||
)
|
||||
public void onGameMessage(String string, CallbackInfo info) {
|
||||
ServerChatEvents.EVENT.invoker().onChatMessage(player, string);
|
||||
public void onGameMessage(TextStream.Message message, CallbackInfo info) {
|
||||
ServerChatEvents.EVENT.invoker().onChatMessage(player, message.getRaw());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
"MinecraftServerMixin",
|
||||
"PlayerManagerMixin",
|
||||
"ServerPlayerEntityMixin",
|
||||
"ServerPlayNetworkHandlerMixin",
|
||||
"ThreadedAnvilChunkStorageAccessor",
|
||||
"ThreadedAnvilChunkStorageMixin",
|
||||
"WorldChunkMixin"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue