Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Grasscutter
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
ziqian zhang
Grasscutter
Commits
9869e436
Commit
9869e436
authored
3 years ago
by
ImmuState
Committed by
Melledy
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
-Make the _tier suffix optional.
parent
935bb4b5
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/emu/grasscutter/command/commands/GiveArtifactCommand.java
+17
-5
17 additions, 5 deletions
...emu/grasscutter/command/commands/GiveArtifactCommand.java
with
17 additions
and
5 deletions
src/main/java/emu/grasscutter/command/commands/GiveArtifactCommand.java
+
17
−
5
View file @
9869e436
...
@@ -70,15 +70,27 @@ public final class GiveArtifactCommand implements CommandHandler {
...
@@ -70,15 +70,27 @@ public final class GiveArtifactCommand implements CommandHandler {
// If the argument was not an integer, we try to determine
// If the argument was not an integer, we try to determine
// the append prop ID from the given text + artifact information.
// the append prop ID from the given text + artifact information.
// A substat string has the format `substat_tier`.
// A substat string has the format `substat_tier`, with the
// `_tier` part being optional.
String
[]
substatArgs
=
substatText
.
split
(
"_"
);
String
[]
substatArgs
=
substatText
.
split
(
"_"
);
if
(
substatArgs
.
length
!=
2
)
{
String
substatType
;
int
substatTier
;
if
(
substatArgs
.
length
==
1
)
{
substatType
=
substatArgs
[
0
];
substatTier
=
itemData
.
getRankLevel
()
==
1
?
2
:
itemData
.
getRankLevel
()
==
2
?
3
:
4
;
}
else
if
(
substatArgs
.
length
==
2
)
{
substatType
=
substatArgs
[
0
];
substatTier
=
Integer
.
parseInt
(
substatArgs
[
1
]);
}
else
{
throw
new
IllegalArgumentException
();
throw
new
IllegalArgumentException
();
}
}
String
substatType
=
substatArgs
[
0
];
int
substatTier
=
Integer
.
parseInt
(
substatArgs
[
1
]);
// Check if the specified tier is legal for the artifact rarity.
// Check if the specified tier is legal for the artifact rarity.
if
(
substatTier
<
1
||
substatTier
>
4
)
{
if
(
substatTier
<
1
||
substatTier
>
4
)
{
throw
new
IllegalArgumentException
();
throw
new
IllegalArgumentException
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment