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
395da1eb
Commit
395da1eb
authored
3 years ago
by
AnimeGitB
Committed by
Melledy
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix gachadetails
parent
420801b4
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/emu/grasscutter/server/dispatch/http/GachaDetailsHandler.java
+7
-11
7 additions, 11 deletions
...grasscutter/server/dispatch/http/GachaDetailsHandler.java
with
7 additions
and
11 deletions
src/main/java/emu/grasscutter/server/dispatch/http/GachaDetailsHandler.java
+
7
−
11
View file @
395da1eb
...
...
@@ -62,28 +62,24 @@ public final class GachaDetailsHandler implements HttpContextHandler {
// Add 5-star items.
Set
<
String
>
fiveStarItems
=
new
LinkedHashSet
<>();
Arrays
.
stream
(
banner
.
getRateUpItems1
()).
forEach
(
i
->
fiveStarItems
.
add
(
Integer
.
toString
(
i
)));
if
(
banner
.
getBannerType
()
==
BannerType
.
STANDARD
||
banner
.
getBannerType
()
==
BannerType
.
EVENT
)
{
Arrays
.
stream
(
manager
.
getYellowAvatars
()).
forEach
(
i
->
fiveStarItems
.
add
(
Integer
.
toString
(
i
)));
}
if
(
banner
.
getBannerType
()
==
BannerType
.
STANDARD
||
banner
.
getBannerType
()
==
BannerType
.
WEAPON
)
{
Arrays
.
stream
(
manager
.
getYellowWeapons
()).
forEach
(
i
->
fiveStarItems
.
add
(
Integer
.
toString
(
i
)));
}
Arrays
.
stream
(
banner
.
getRateUpItems5
()).
forEach
(
i
->
fiveStarItems
.
add
(
Integer
.
toString
(
i
)));
Arrays
.
stream
(
banner
.
getFallbackItems5Pool1
()).
forEach
(
i
->
fiveStarItems
.
add
(
Integer
.
toString
(
i
)));
Arrays
.
stream
(
banner
.
getFallbackItems5Pool2
()).
forEach
(
i
->
fiveStarItems
.
add
(
Integer
.
toString
(
i
)));
response
=
response
.
replace
(
"{{FIVE_STARS}}"
,
"["
+
String
.
join
(
","
,
fiveStarItems
)
+
"]"
);
// Add 4-star items.
Set
<
String
>
fourStarItems
=
new
LinkedHashSet
<>();
Arrays
.
stream
(
banner
.
getRateUpItems
2
()).
forEach
(
i
->
fourStarItems
.
add
(
Integer
.
toString
(
i
)));
Arrays
.
stream
(
m
an
ag
er
.
get
PurpleAvatars
()).
forEach
(
i
->
fourStarItems
.
add
(
Integer
.
toString
(
i
)));
Arrays
.
stream
(
m
an
ag
er
.
get
PurpleWeapons
()).
forEach
(
i
->
fourStarItems
.
add
(
Integer
.
toString
(
i
)));
Arrays
.
stream
(
banner
.
getRateUpItems
4
()).
forEach
(
i
->
fourStarItems
.
add
(
Integer
.
toString
(
i
)));
Arrays
.
stream
(
b
an
n
er
.
get
FallbackItems4Pool1
()).
forEach
(
i
->
fourStarItems
.
add
(
Integer
.
toString
(
i
)));
Arrays
.
stream
(
b
an
n
er
.
get
FallbackItems4Pool2
()).
forEach
(
i
->
fourStarItems
.
add
(
Integer
.
toString
(
i
)));
response
=
response
.
replace
(
"{{FOUR_STARS}}"
,
"["
+
String
.
join
(
","
,
fourStarItems
)
+
"]"
);
// Add 3-star items.
Set
<
String
>
threeStarItems
=
new
LinkedHashSet
<>();
Arrays
.
stream
(
m
an
ag
er
.
get
BlueWeapons
()).
forEach
(
i
->
threeStarItems
.
add
(
Integer
.
toString
(
i
)));
Arrays
.
stream
(
b
an
n
er
.
get
FallbackItems3
()).
forEach
(
i
->
threeStarItems
.
add
(
Integer
.
toString
(
i
)));
response
=
response
.
replace
(
"{{THREE_STARS}}"
,
"["
+
String
.
join
(
","
,
threeStarItems
)
+
"]"
);
// Done.
...
...
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