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
0e514b90
Commit
0e514b90
authored
3 years ago
by
KingRainbow44
Browse files
Options
Downloads
Patches
Plain Diff
Fix handler creation
parent
46d897ac
Branches
Branches containing commit
Tags
Tags containing commit
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
+16
-3
16 additions, 3 deletions
src/main/java/emu/grasscutter/server/event/EventHandler.java
with
16 additions
and
3 deletions
src/main/java/emu/grasscutter/server/event/EventHandler.java
+
16
−
3
View file @
0e514b90
...
...
@@ -5,9 +5,22 @@ import emu.grasscutter.Grasscutter;
import
java.util.function.Consumer
;
public
final
class
EventHandler
{
private
final
Class
<
Event
>
event
;
private
final
Class
<?
extends
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
);
}
public
EventHandler
(
Class
<
Event
>
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
;
}
...
...
@@ -19,7 +32,7 @@ public final class EventHandler {
* Gets which event this handler is handling.
* @return An event class.
*/
public
Class
<
Event
>
handles
()
{
public
Class
<
?
extends
Event
>
handles
()
{
return
this
.
event
;
}
...
...
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