Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
e30352a6
Commit
e30352a6
authored
Apr 25, 2022
by
Benjamin Elsdon
Browse files
Forgot to implement levels into GetMailItemRsp
Also added promoteLevels
parent
3f11cc41
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/server/packet/send/PacketGetMailItemRsp.java
View file @
e30352a6
...
@@ -30,12 +30,31 @@ public class PacketGetMailItemRsp extends GenshinPacket {
...
@@ -30,12 +30,31 @@ public class PacketGetMailItemRsp extends GenshinPacket {
for
(
Mail
.
MailItem
mailItem
:
message
.
itemList
)
{
for
(
Mail
.
MailItem
mailItem
:
message
.
itemList
)
{
EquipParamOuterClass
.
EquipParam
.
Builder
item
=
EquipParamOuterClass
.
EquipParam
.
newBuilder
();
EquipParamOuterClass
.
EquipParam
.
Builder
item
=
EquipParamOuterClass
.
EquipParam
.
newBuilder
();
int
promoteLevel
=
0
;
if
(
mailItem
.
itemLevel
>
20
)
{
// 20/40
promoteLevel
=
1
;
}
else
if
(
mailItem
.
itemLevel
>
40
)
{
// 40/50
promoteLevel
=
2
;
}
else
if
(
mailItem
.
itemLevel
>
50
)
{
// 50/60
promoteLevel
=
3
;
}
else
if
(
mailItem
.
itemLevel
>
60
)
{
// 60/70
promoteLevel
=
4
;
}
else
if
(
mailItem
.
itemLevel
>
70
)
{
// 70/80
promoteLevel
=
5
;
}
else
if
(
mailItem
.
itemLevel
>
80
)
{
// 80/90
promoteLevel
=
6
;
}
item
.
setItemId
(
mailItem
.
itemId
);
item
.
setItemId
(
mailItem
.
itemId
);
item
.
setItemNum
(
mailItem
.
itemCount
);
item
.
setItemNum
(
mailItem
.
itemCount
);
item
.
setItemLevel
(
mailItem
.
itemLevel
);
item
.
setPromoteLevel
(
promoteLevel
);
claimedItems
.
add
(
item
.
build
());
claimedItems
.
add
(
item
.
build
());
GenshinItem
genshinItem
=
new
GenshinItem
(
GenshinData
.
getItemDataMap
().
get
(
mailItem
.
itemId
));
GenshinItem
genshinItem
=
new
GenshinItem
(
GenshinData
.
getItemDataMap
().
get
(
mailItem
.
itemId
));
genshinItem
.
setCount
(
mailItem
.
itemCount
);
genshinItem
.
setCount
(
mailItem
.
itemCount
);
genshinItem
.
setLevel
(
mailItem
.
itemLevel
);
genshinItem
.
setPromoteLevel
(
promoteLevel
);
player
.
getInventory
().
addItem
(
genshinItem
);
player
.
getInventory
().
addItem
(
genshinItem
);
player
.
sendPacket
(
new
PacketItemAddHintNotify
(
genshinItem
,
ActionReason
.
MailAttachment
));
player
.
sendPacket
(
new
PacketItemAddHintNotify
(
genshinItem
,
ActionReason
.
MailAttachment
));
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment