forked from RepoMirrors/kami-blue
work on send unicode module
This commit is contained in:
parent
23c6e76e56
commit
275d5e51c9
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue