forked from RepoMirrors/kami-blue
work on unicode module
This commit is contained in:
parent
f53f574520
commit
254dc8fe27
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue