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
0e514b90
Commit
0e514b90
authored
Apr 26, 2022
by
KingRainbow44
Browse files
Fix handler creation
parent
46d897ac
Changes
1
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/server/event/EventHandler.java
View file @
0e514b90
...
@@ -5,9 +5,22 @@ import emu.grasscutter.Grasscutter;
...
@@ -5,9 +5,22 @@ import emu.grasscutter.Grasscutter;
import
java.util.function.Consumer
;
import
java.util.function.Consumer
;
public
final
class
EventHandler
{
public
final
class
EventHandler
{
private
final
Class
<
Event
>
event
;
private
final
Class
<
?
extends
Event
>
event
;
public
EventHandler
(
Class
<
Event
>
event
)
{
/**
* Creates an instance of {@link EventHandler} for the specified event.
* @param event The event to handle.
* @return An instance of {@link EventHandler}.
*/
public
static
EventHandler
forEvent
(
Class
<?
extends
Event
>
event
)
{
return
new
EventHandler
(
event
);
}
/**
* @deprecated Will be replaced with a private constructor instead. Use {@link #forEvent(Class)} instead.
*/
@Deprecated
(
forRemoval
=
true
,
since
=
"1.0.1"
)
public
EventHandler
(
Class
<?
extends
Event
>
event
)
{
this
.
event
=
event
;
this
.
event
=
event
;
}
}
...
@@ -19,7 +32,7 @@ public final class EventHandler {
...
@@ -19,7 +32,7 @@ public final class EventHandler {
* Gets which event this handler is handling.
* Gets which event this handler is handling.
* @return An event class.
* @return An event class.
*/
*/
public
Class
<
Event
>
handles
()
{
public
Class
<
?
extends
Event
>
handles
()
{
return
this
.
event
;
return
this
.
event
;
}
}
...
...
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