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
48aea3f5
Commit
48aea3f5
authored
Apr 29, 2022
by
真心
Committed by
memetrollsXD
Apr 29, 2022
Browse files
Add 'refinement' option to 'give' command
parent
d0ccc486
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/command/commands/GiveCommand.java
View file @
48aea3f5
...
@@ -158,7 +158,7 @@ public final class GiveCommand implements CommandHandler {
...
@@ -158,7 +158,7 @@ public final class GiveCommand implements CommandHandler {
}
}
}
}
private
boolean
item
(
Player
player
,
ItemData
itemData
,
int
amount
,
int
lvl
,
int
refinement
)
{
private
void
item
(
Player
player
,
ItemData
itemData
,
int
amount
,
int
lvl
,
int
refinement
)
{
if
(
itemData
.
isEquip
())
{
if
(
itemData
.
isEquip
())
{
List
<
GameItem
>
items
=
new
LinkedList
<>();
List
<
GameItem
>
items
=
new
LinkedList
<>();
for
(
int
i
=
0
;
i
<
amount
;
i
++)
{
for
(
int
i
=
0
;
i
<
amount
;
i
++)
{
...
@@ -188,12 +188,10 @@ public final class GiveCommand implements CommandHandler {
...
@@ -188,12 +188,10 @@ public final class GiveCommand implements CommandHandler {
items
.
add
(
item
);
items
.
add
(
item
);
}
}
player
.
getInventory
().
addItems
(
items
,
ActionReason
.
SubfieldDrop
);
player
.
getInventory
().
addItems
(
items
,
ActionReason
.
SubfieldDrop
);
return
true
;
}
else
{
}
else
{
GameItem
item
=
new
GameItem
(
itemData
);
GameItem
item
=
new
GameItem
(
itemData
);
item
.
setCount
(
amount
);
item
.
setCount
(
amount
);
player
.
getInventory
().
addItem
(
item
,
ActionReason
.
SubfieldDrop
);
player
.
getInventory
().
addItem
(
item
,
ActionReason
.
SubfieldDrop
);
return
true
;
}
}
}
}
}
}
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