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
46d897ac
Commit
46d897ac
authored
3 years ago
by
KingRainbow44
Browse files
Options
Downloads
Patches
Plain Diff
Fix handlers
parent
35ff3503
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/emu/grasscutter/server/event/EventHandler.java
+10
-6
10 additions, 6 deletions
src/main/java/emu/grasscutter/server/event/EventHandler.java
with
10 additions
and
6 deletions
src/main/java/emu/grasscutter/server/event/EventHandler.java
+
10
−
6
View file @
46d897ac
...
...
@@ -4,8 +4,12 @@ import emu.grasscutter.Grasscutter;
import
java.util.function.Consumer
;
public
final
class
EventHandler
<
E
extends
Event
>
{
private
E
event
;
public
final
class
EventHandler
{
private
final
Class
<
Event
>
event
;
public
EventHandler
(
Class
<
Event
>
event
)
{
this
.
event
=
event
;
}
private
Consumer
<
Event
>
listener
;
private
HandlerPriority
priority
;
...
...
@@ -15,7 +19,7 @@ public final class EventHandler<E extends Event> {
* Gets which event this handler is handling.
* @return An event class.
*/
public
Event
handles
()
{
public
Class
<
Event
>
handles
()
{
return
this
.
event
;
}
...
...
@@ -48,7 +52,7 @@ public final class EventHandler<E extends Event> {
* @param listener An event handler method.
* @return Method chaining.
*/
public
EventHandler
<
E
>
listener
(
Consumer
<
Event
>
listener
)
{
public
EventHandler
listener
(
Consumer
<
Event
>
listener
)
{
this
.
listener
=
listener
;
return
this
;
}
...
...
@@ -57,7 +61,7 @@ public final class EventHandler<E extends Event> {
* @param priority The priority of the handler.
* @return Method chaining.
*/
public
EventHandler
<
E
>
priority
(
HandlerPriority
priority
)
{
public
EventHandler
priority
(
HandlerPriority
priority
)
{
this
.
priority
=
priority
;
return
this
;
}
...
...
@@ -66,7 +70,7 @@ public final class EventHandler<E extends Event> {
* @param ignore If the handler should ignore cancelled events.
* @return Method chaining.
*/
public
EventHandler
<
E
>
ignore
(
boolean
ignore
)
{
public
EventHandler
ignore
(
boolean
ignore
)
{
this
.
handleCanceled
=
ignore
;
return
this
;
}
...
...
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