mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-12 17:25:36 +08:00
69779a0321
Send mail command now works from console (to use it from console change the uuid in the 'SendMailCommand' file
33 lines
1.2 KiB
Java
33 lines
1.2 KiB
Java
package emu.grasscutter.command.commands;
|
|
|
|
import emu.grasscutter.Grasscutter;
|
|
import emu.grasscutter.command.Command;
|
|
import emu.grasscutter.command.CommandHandler;
|
|
import emu.grasscutter.game.GenshinPlayer;
|
|
import emu.grasscutter.game.Mail;
|
|
import emu.grasscutter.server.packet.send.PacketMailChangeNotify;
|
|
|
|
import java.time.Instant;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
@Command(label = "sendmail", usage = "sendmail")
|
|
public class SendMailCommand implements CommandHandler {
|
|
|
|
@Override
|
|
public void execute(GenshinPlayer sender, List<String> args) {
|
|
// This is literally so I can receive mail for some reason.
|
|
if(sender == null) {
|
|
// This is my uuid in my test server. This is just for testing.
|
|
// If someone pulled this please put your uuid to receive mail using /sendmail
|
|
// until I actually make a proper /sendmail command.
|
|
sender = Grasscutter.getGameServer().getPlayerByUid(7006);
|
|
}
|
|
sender.sendMail(new Mail(new Mail.MailContent("Test", "This is a test"),
|
|
new ArrayList<Mail.MailItem>(){{add(new Mail.MailItem(1062));}},
|
|
Instant.now().getEpochSecond() + 4000));
|
|
|
|
sender.dropMessage("Check your inbox");
|
|
}
|
|
}
|