oh my gawd broken custom chat (for some reason my stupidly long one liner does not work!)
This commit is contained in:
parent
0239619aad
commit
8ad237b932
19 changed files with 50 additions and 0 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,11 +1,17 @@
|
|||
{
|
||||
"mappings": {
|
||||
"com/github/mirko/neoclient/mixin/ChatScreenMixin": {
|
||||
"sendMessage": "Lnet/minecraft/class_408;method_44056(Ljava/lang/String;Z)Z"
|
||||
},
|
||||
"com/github/mirko/neoclient/mixin/ClientPlayerEntityMixin": {
|
||||
"move": "Lnet/minecraft/class_746;method_5784(Lnet/minecraft/class_1313;Lnet/minecraft/class_243;)V"
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"named:intermediary": {
|
||||
"com/github/mirko/neoclient/mixin/ChatScreenMixin": {
|
||||
"sendMessage": "Lnet/minecraft/class_408;method_44056(Ljava/lang/String;Z)Z"
|
||||
},
|
||||
"com/github/mirko/neoclient/mixin/ClientPlayerEntityMixin": {
|
||||
"move": "Lnet/minecraft/class_746;method_5784(Lnet/minecraft/class_1313;Lnet/minecraft/class_243;)V"
|
||||
}
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -6,6 +6,7 @@
|
|||
"mixins": [
|
||||
],
|
||||
"client": [
|
||||
"ChatScreenMixin",
|
||||
"ClientPlayerEntityMixin"
|
||||
],
|
||||
"injectors": {
|
||||
|
|
Binary file not shown.
|
@ -5,6 +5,8 @@ import com.google.gson.Gson;
|
|||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.hud.ChatHud;
|
||||
import net.minecraft.client.gui.screen.ChatScreen;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -24,6 +26,7 @@ public class NeoClient implements ClientModInitializer {
|
|||
|
||||
@Override
|
||||
public void onInitializeClient() {
|
||||
|
||||
l.info("--------------");
|
||||
l.info("neoclient v0.1");
|
||||
l.info("");
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
package com.github.mirko.neoclient.mixin;
|
||||
|
||||
import com.github.mirko.neoclient.feature.Core;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
|
||||
import net.minecraft.client.gui.screen.ChatScreen;
|
||||
import net.minecraft.util.Uuids;
|
||||
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.CallbackInfoReturnable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static com.github.mirko.neoclient.NeoClient.mc;
|
||||
|
||||
@Mixin(ChatScreen.class)
|
||||
public class ChatScreenMixin {
|
||||
@Inject(method = "sendMessage", at = @At("HEAD"), cancellable = true)
|
||||
public void sendMessage(String chatText, boolean addToHistory, CallbackInfoReturnable<Boolean> cir) {
|
||||
ArrayList<Character> list = new ArrayList<>();
|
||||
list.add('/');
|
||||
list.add('*');
|
||||
if (!list.contains(chatText.charAt(0))) {
|
||||
Core.INSTANCE.run("tellraw @a " + GsonComponentSerializer.gson().serialize(Component.translatable("[%s] %s › %s").args(
|
||||
MiniMessage.miniMessage().deserialize("<gradient:#00d2ff:#928DAB>neoclient</gradient>"),
|
||||
Component.text("@a[nbt={\"UUID\": [I; " + Stream.of(Uuids.toIntArray(Objects.requireNonNull(mc.getSession().getUuidOrNull()))).map(Object::toString).collect(Collectors.joining(", ")) + "]}").color(NamedTextColor.RED),
|
||||
Component.text(chatText).color(NamedTextColor.WHITE)
|
||||
)));
|
||||
cir.setReturnValue(false);
|
||||
cir.cancel();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -6,6 +6,7 @@
|
|||
"mixins": [
|
||||
],
|
||||
"client": [
|
||||
"ChatScreenMixin",
|
||||
"ClientPlayerEntityMixin"
|
||||
],
|
||||
"injectors": {
|
||||
|
|
Loading…
Reference in a new issue