-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from Command435-CRM/master
Add AsyncHeadsFetchedEvent
- Loading branch information
Showing
2 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
src/main/java/tsp/headdb/core/api/events/AsyncHeadsFetchedEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package tsp.headdb.core.api.events; | ||
|
||
import org.bukkit.event.Event; | ||
import org.bukkit.event.HandlerList; | ||
import org.jetbrains.annotations.NotNull; | ||
import tsp.headdb.implementation.category.Category; | ||
import tsp.headdb.implementation.head.Head; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class AsyncHeadsFetchedEvent extends Event { | ||
private static final HandlerList HANDLER_LIST = new HandlerList(); | ||
private final Map<Category, List<Head>> heads; | ||
private final String providerName; | ||
private final long timeTook; | ||
|
||
public AsyncHeadsFetchedEvent(Map<Category, List<Head>> heads, String providerName, long timeTook) { | ||
super(true); | ||
this.heads = heads; | ||
this.providerName = providerName; | ||
this.timeTook = timeTook; | ||
} | ||
|
||
@NotNull | ||
public static HandlerList getHandlerList() { | ||
return HANDLER_LIST; | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public HandlerList getHandlers() { | ||
return HANDLER_LIST; | ||
} | ||
|
||
public Map<Category, List<Head>> getHeads() { | ||
return heads; | ||
} | ||
|
||
public String getProviderName() { | ||
return providerName; | ||
} | ||
|
||
public long getTimeTook() { | ||
return timeTook; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters