diff --git a/src/main/java/emu/grasscutter/Config.java b/src/main/java/emu/grasscutter/Config.java index ce753d80d..03c6fb1f8 100644 --- a/src/main/java/emu/grasscutter/Config.java +++ b/src/main/java/emu/grasscutter/Config.java @@ -1,5 +1,7 @@ package emu.grasscutter; +import emu.grasscutter.game.mail.Mail; + public final class Config { public String DatabaseUrl = "mongodb://localhost:27017"; @@ -76,7 +78,10 @@ public final class Config { public int[] WelcomeEmotes = {2007, 1002, 4010}; public String WelcomeMotd = "Welcome to Grasscutter emu"; public String WelcomeMailContent = "Hi there!\r\nFirst of all, welcome to Grasscutter. If you have any issues, please let us know so that Lawnmower can help you! \r\n\r\nCheck out our:\r\n "; - public int[] WelcomeMailItems = {13509}; + public Mail.MailItem[] WelcomeMailItems = { + new Mail.MailItem(13509, 1, 1), + new Mail.MailItem(201, 10000, 1), + }; public boolean EnableOfficialShop = true; diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerSetPlayerBornDataReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerSetPlayerBornDataReq.java index 52c52c280..9acd4f21b 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerSetPlayerBornDataReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerSetPlayerBornDataReq.java @@ -16,6 +16,8 @@ import emu.grasscutter.net.packet.PacketHandler; import emu.grasscutter.server.game.GameSession; import emu.grasscutter.server.game.GameSession.SessionState; +import java.util.Arrays; + @Opcodes(PacketOpcodes.SetPlayerBornDataReq) public class HandlerSetPlayerBornDataReq extends PacketHandler { @@ -82,9 +84,7 @@ public class HandlerSetPlayerBornDataReq extends PacketHandler { mailBuilder.mail.mailContent.title = String.format("W%sl%som%s to %s%s%s%s%s%s%s%s%s%s%s!", DatabaseHelper.AWJVN, u, DatabaseHelper.AWJVN, d, e, z, GameData.EJWOA, GameData.EJWOA, u, PacketOpcodes.ONLWE, s, s, DatabaseHelper.AWJVN, e); mailBuilder.mail.mailContent.sender = String.format("L%swnmow%s%s @ Gi%sH%sb", z, DatabaseHelper.AWJVN, e, s, PacketOpcodes.ONLWE); mailBuilder.mail.mailContent.content = Grasscutter.getConfig().GameServer.WelcomeMailContent; - for (int itemId : Grasscutter.getConfig().GameServer.WelcomeMailItems) { - mailBuilder.mail.itemList.add(new Mail.MailItem(itemId, 1, 1)); - } + mailBuilder.mail.itemList.addAll(Arrays.asList(Grasscutter.getConfig().GameServer.WelcomeMailItems)); mailBuilder.mail.importance = 1; player.sendMail(mailBuilder.mail); } catch (Exception e) {