mirror of https://github.com/kami-blue/client
Basic Autoreply (#429)
Warning: Don't send yourself a message because it will repeatedly reply, leading to a kick. Reply message not configurable so maybe add support in future.
This commit is contained in:
parent
f314dd1fe5
commit
4ec845e14d
|
@ -0,0 +1,24 @@
|
|||
package me.zeroeightsix.kami.module.modules.misc;
|
||||
|
||||
import java.util.function.Predicate;
|
||||
import me.zeroeightsix.kami.util.Wrapper;
|
||||
import net.minecraft.network.play.server.SPacketChat;
|
||||
import me.zero.alpine.listener.EventHandler;
|
||||
import me.zeroeightsix.kami.event.events.PacketEvent;
|
||||
import me.zero.alpine.listener.Listener;
|
||||
import me.zeroeightsix.kami.module.Module;
|
||||
|
||||
@Module.Info(name = "AutoReply", description = "automatically replies to private messages", category = Module.Category.MISC)
|
||||
public class AutoReply extends Module
|
||||
{
|
||||
@EventHandler
|
||||
public Listener<PacketEvent.Receive> receiveListener;
|
||||
|
||||
public AutoReply() {
|
||||
this.receiveListener = new Listener<PacketEvent.Receive>(event -> {
|
||||
if (event.getPacket() instanceof SPacketChat && ((SPacketChat)event.getPacket()).getChatComponent().getUnformattedText().contains("whispers:")) {
|
||||
Wrapper.getPlayer().sendChatMessage("/r Kami Blue On Top");
|
||||
}
|
||||
}, (Predicate<PacketEvent.Receive>[])new Predicate[0]);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue