work on unicode module

This commit is contained in:
S-B99 2019-10-29 09:23:03 -04:00
parent f53f574520
commit 254dc8fe27
1 changed files with 7 additions and 5 deletions

View File

@ -10,19 +10,20 @@ import net.minecraft.network.play.client.CPacketChatMessage;
/**
* @author S-B99
* Updated by S-B99 on 28/10/19
* Updated by S-B99 on 29/10/19
*/
@Module.Info(name = "SendRawUnicode", category = Module.Category.MISC, description = "Converts all text into raw unicode")
@Module.Info(name = "SendRawUnicode", category = Module.Category.EXPERIMENTAL, description = "Converts all text into raw unicode")
public class SendUnicodeModule extends Module {
private Setting<Boolean> commands = register(Settings.b("Off on commands", false));
private Setting<Boolean> commands = register(Settings.b("Use on commands", false));
private final String KAMI_SUFFIX = "\u23d0 \u0299\u029f\u1d1c\u1d07";
//private final String KAMI_CUSTOM_UNICODE = "\u0299\u029f\u1d1c\u1d07";
@EventHandler
public Listener<PacketEvent.Send> listener = new Listener<>(event -> {
if (event.getPacket() instanceof CPacketChatMessage) {
String toSend = ((CPacketChatMessage) event.getPacket()).getMessage();
System.out.println("神 Raw Message is: " + toSend);
if (toSend.startsWith("/") && !commands.getValue())
return;
else if (toSend.startsWith(",") && !commands.getValue())
@ -32,10 +33,11 @@ public class SendUnicodeModule extends Module {
else if (toSend.startsWith("-") && !commands.getValue())
return;
toSend = KAMI_SUFFIX;
//toSend = KAMI_CUSTOM_UNICODE;
if (toSend.length() >= 256)
toSend = toSend.substring(0,256);
((CPacketChatMessage) event.getPacket()).message = toSend;
System.out.println("神 Raw Message was: " + toSend);
}
});