2022-04-22 19:02:05 +08:00
|
|
|
package emu.grasscutter.command.commands;
|
|
|
|
|
2022-04-23 23:07:18 +08:00
|
|
|
import emu.grasscutter.Grasscutter;
|
2022-04-22 19:02:05 +08:00
|
|
|
import emu.grasscutter.command.Command;
|
|
|
|
import emu.grasscutter.command.CommandHandler;
|
|
|
|
import emu.grasscutter.game.GenshinPlayer;
|
2022-04-23 23:07:18 +08:00
|
|
|
import emu.grasscutter.game.Mail;
|
2022-04-22 19:02:05 +08:00
|
|
|
import emu.grasscutter.server.packet.send.PacketMailChangeNotify;
|
|
|
|
|
2022-04-23 23:07:18 +08:00
|
|
|
import java.time.Instant;
|
|
|
|
import java.util.ArrayList;
|
2022-04-22 19:02:05 +08:00
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
@Command(label = "sendmail", usage = "sendmail")
|
|
|
|
public class SendMailCommand implements CommandHandler {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void execute(GenshinPlayer sender, List<String> args) {
|
2022-04-23 23:07:18 +08:00
|
|
|
// 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));
|
|
|
|
|
2022-04-22 19:02:05 +08:00
|
|
|
sender.dropMessage("Check your inbox");
|
|
|
|
}
|
|
|
|
}
|