work on send unicode module

This commit is contained in:
S-B99 2019-10-29 07:56:58 -04:00
parent 23c6e76e56
commit 275d5e51c9
2 changed files with 10 additions and 6 deletions

View File

@ -23,10 +23,14 @@ public class CustomChat extends Module {
public Listener<PacketEvent.Send> listener = new Listener<>(event -> {
if (event.getPacket() instanceof CPacketChatMessage) {
String s = ((CPacketChatMessage) event.getPacket()).getMessage();
if (s.startsWith("/") && !commands.getValue()) return;
else if (s.startsWith(",") && !commands.getValue()) return;
else if (s.startsWith(".") && !commands.getValue()) return;
else if (s.startsWith("-") && !commands.getValue()) return;
if (s.startsWith("/") && !commands.getValue())
return;
else if (s.startsWith(",") && !commands.getValue())
return;
else if (s.startsWith(".") && !commands.getValue())
return;
else if (s.startsWith("-") && !commands.getValue())
return;
s += KAMI_SUFFIX;
if (s.length() >= 256) s = s.substring(0,256);
((CPacketChatMessage) event.getPacket()).message = s;

View File

@ -17,7 +17,7 @@ public class SendUnicodeModule extends Module {
private Setting<Boolean> commands = register(Settings.b("Off on commands", false));
//private final String KAMI_SUFFIX = " \u23d0 \u1d0b\u1d00\u1d0d\u026a \u0299\u029f\u1d1c\u1d07";
private final String KAMI_SUFFIX = "\u23d0 \u0299\u029f\u1d1c\u1d07";
@EventHandler
public Listener<PacketEvent.Send> listener = new Listener<>(event -> {
@ -32,7 +32,7 @@ public class SendUnicodeModule extends Module {
else if (toSend.startsWith("-") && !commands.getValue())
return;
//toSend = toSend;//KAMI_SUFFIX;
toSend = KAMI_SUFFIX;
if (toSend.length() >= 256)
toSend = toSend.substring(0,256);
((CPacketChatMessage) event.getPacket()).message = toSend;