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
4cd31af0
Commit
4cd31af0
authored
Jul 03, 2022
by
Akka
Committed by
Luke H-W
Jul 03, 2022
Browse files
fix announcement interval
parent
8c9093b3
Changes
1
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/task/tasks/AnnouncementTask.java
View file @
4cd31af0
...
@@ -15,7 +15,7 @@ import java.util.stream.Collectors;
...
@@ -15,7 +15,7 @@ import java.util.stream.Collectors;
@Task
(
taskName
=
"Announcement"
,
taskCronExpression
=
"0 * * * * ?"
,
triggerName
=
"AnnouncementTrigger"
)
@Task
(
taskName
=
"Announcement"
,
taskCronExpression
=
"0 * * * * ?"
,
triggerName
=
"AnnouncementTrigger"
)
public
final
class
AnnouncementTask
extends
TaskHandler
{
public
final
class
AnnouncementTask
extends
TaskHandler
{
Map
<
Integer
,
Integer
>
intervalMap
=
new
ConcurrentHashMap
<>();
static
Map
<
Integer
,
Integer
>
intervalMap
=
new
ConcurrentHashMap
<>();
@Override
@Override
public
void
onEnable
()
{
public
void
onEnable
()
{
Grasscutter
.
getLogger
().
debug
(
"[Task] Announcement task enabled."
);
Grasscutter
.
getLogger
().
debug
(
"[Task] Announcement task enabled."
);
...
@@ -39,7 +39,7 @@ public final class AnnouncementTask extends TaskHandler {
...
@@ -39,7 +39,7 @@ public final class AnnouncementTask extends TaskHandler {
var
toSend
=
intervalMap
.
entrySet
().
stream
()
var
toSend
=
intervalMap
.
entrySet
().
stream
()
.
filter
(
i
->
announceConfigItems
.
containsKey
(
i
.
getKey
()))
.
filter
(
i
->
announceConfigItems
.
containsKey
(
i
.
getKey
()))
.
filter
(
i
->
announceConfigItems
.
get
(
i
.
getKey
()).
getInterval
()
>=
i
.
getValue
()
)
.
filter
(
i
->
i
.
getValue
()
>=
announceConfigItems
.
get
(
i
.
getKey
()).
getInterval
())
.
map
(
i
->
announceConfigItems
.
get
(
i
.
getKey
()))
.
map
(
i
->
announceConfigItems
.
get
(
i
.
getKey
()))
.
toList
();
.
toList
();
...
...
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