-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
18 additions
and
4 deletions.
There are no files selected for viewing
22 changes: 18 additions & 4 deletions
22
src/main/java/spigey/asteroide/mixin/ChatMessageC2SMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,31 @@ | ||
package spigey.asteroide.mixin; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import io.netty.buffer.Unpooled; | ||
import net.minecraft.network.PacketByteBuf; | ||
import net.minecraft.network.message.LastSeenMessageList; | ||
import net.minecraft.network.message.MessageSignatureData; | ||
import net.minecraft.network.packet.c2s.play.ChatMessageC2SPacket; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Unique; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
import java.time.Instant; | ||
|
||
import static meteordevelopment.meteorclient.utils.player.ChatUtils.info; | ||
|
||
@Mixin(ChatMessageC2SPacket.class) | ||
public class ChatMessageC2SMixin { | ||
@Inject(method = "write", at = @At("HEAD")) | ||
private void onWrite(CallbackInfo info) { | ||
info("doen"); | ||
@Unique | ||
private String content; | ||
|
||
@Inject(method = "<init>(Ljava/lang/String;Ljava/time/Instant;JLnet/minecraft/network/message/MessageSignatureData;Lnet/minecraft/network/message/LastSeenMessageList$Acknowledgment;)V", at = @At("TAIL"), cancellable = true) | ||
private void onChatMessagePacketConstructed(String content, Instant timestamp, long salt, MessageSignatureData signature, LastSeenMessageList.Acknowledgment acknowledgment, CallbackInfo ci) { | ||
this.content = "ermm what the sigma"; | ||
System.out.println("ermm what the sigma"); | ||
info("ermm what the flip"); | ||
ci.cancel(); | ||
} | ||
} |