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
a52eaf9b
Commit
a52eaf9b
authored
Apr 22, 2022
by
memetrollsXD
Browse files
Use count for level for equips
parent
12c6020b
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/command/commands/GiveCommand.java
View file @
a52eaf9b
...
@@ -91,17 +91,16 @@ public final class GiveCommand implements CommandHandler {
...
@@ -91,17 +91,16 @@ public final class GiveCommand implements CommandHandler {
this
.
item
(
targetPlayer
,
itemData
,
amount
);
this
.
item
(
targetPlayer
,
itemData
,
amount
);
CommandHandler
.
sendMessage
(
sender
,
String
.
format
(
"Given %s of %s to %s."
,
amount
,
item
,
target
));
if
(!
itemData
.
isEquip
())
CommandHandler
.
sendMessage
(
sender
,
String
.
format
(
"Given %s of %s to %s."
,
amount
,
item
,
target
));
else
CommandHandler
.
sendMessage
(
sender
,
String
.
format
(
"Given %s with level %s to %s"
,
item
,
amount
,
target
));
}
}
private
void
item
(
GenshinPlayer
player
,
ItemData
itemData
,
int
amount
)
{
private
void
item
(
GenshinPlayer
player
,
ItemData
itemData
,
int
amount
)
{
if
(
itemData
.
isEquip
())
{
if
(
itemData
.
isEquip
())
{
List
<
GenshinItem
>
items
=
new
LinkedList
<>();
GenshinItem
item
=
new
GenshinItem
(
itemData
);
for
(
int
i
=
0
;
i
<
amount
;
i
++)
{
item
.
setLevel
(
amount
);
items
.
add
(
new
GenshinItem
(
itemData
));
player
.
getInventory
().
addItem
(
item
);
}
player
.
sendPacket
(
new
PacketItemAddHintNotify
(
item
,
ActionReason
.
SubfieldDrop
));
player
.
getInventory
().
addItems
(
items
);
player
.
sendPacket
(
new
PacketItemAddHintNotify
(
items
,
ActionReason
.
SubfieldDrop
));
}
else
{
}
else
{
GenshinItem
genshinItem
=
new
GenshinItem
(
itemData
);
GenshinItem
genshinItem
=
new
GenshinItem
(
itemData
);
genshinItem
.
setCount
(
amount
);
genshinItem
.
setCount
(
amount
);
...
...
src/main/java/emu/grasscutter/game/inventory/GenshinItem.java
View file @
a52eaf9b
...
@@ -90,7 +90,7 @@ public class GenshinItem {
...
@@ -90,7 +90,7 @@ public class GenshinItem {
// Equip data
// Equip data
if
(
getItemType
()
==
ItemType
.
ITEM_WEAPON
)
{
if
(
getItemType
()
==
ItemType
.
ITEM_WEAPON
)
{
this
.
level
=
1
;
this
.
level
=
this
.
count
>
1
?
this
.
count
:
1
;
this
.
affixes
=
new
ArrayList
<>(
2
);
this
.
affixes
=
new
ArrayList
<>(
2
);
if
(
getItemData
().
getSkillAffix
()
!=
null
)
{
if
(
getItemData
().
getSkillAffix
()
!=
null
)
{
for
(
int
skillAffix
:
getItemData
().
getSkillAffix
())
{
for
(
int
skillAffix
:
getItemData
().
getSkillAffix
())
{
...
...
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