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
46d897ac
Commit
46d897ac
authored
Apr 26, 2022
by
KingRainbow44
Browse files
Fix handlers
parent
35ff3503
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/server/event/EventHandler.java
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
;
}
...
...
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