parent
5dcf7a9bb8
commit
7c67acbbae
|
@ -5,6 +5,9 @@ import net.md_5.bungee.chat.ComponentSerializer;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.network.protocol.game.ClientboundSystemChatPacket;
|
import net.minecraft.network.protocol.game.ClientboundSystemChatPacket;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
@Mixin(ClientboundSystemChatPacket.class)
|
@Mixin(ClientboundSystemChatPacket.class)
|
||||||
public class ClientboundSystemChatPacketMixin {
|
public class ClientboundSystemChatPacketMixin {
|
||||||
|
@ -20,4 +23,15 @@ public class ClientboundSystemChatPacketMixin {
|
||||||
public void arclight$constructor(BaseComponent[] content, boolean overlay) {
|
public void arclight$constructor(BaseComponent[] content, boolean overlay) {
|
||||||
arclight$constructor(ComponentSerializer.toString(content), overlay);
|
arclight$constructor(ComponentSerializer.toString(content), overlay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Inject(method = "<init>(Lnet/minecraft/network/chat/Component;Z)V", at = @At("RETURN"))
|
||||||
|
private void arclight$init(Component content, boolean overlay, CallbackInfo ci) {
|
||||||
|
this.content = Component.Serializer.toJson(content);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
public String content() {
|
||||||
|
return content;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user