Mirror von
https://github.com/TheSilentPro/HeadDB.git
synchronisiert 2024-12-26 19:02:39 +01:00
Change type from heads count to fetched heads map
Dieser Commit ist enthalten in:
Ursprung
51f3853910
Commit
f00f099b24
@ -3,16 +3,21 @@ 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 int headsCount;
|
||||
private final Map<Category, List<Head>> heads;
|
||||
private final String providerName;
|
||||
private final long timeTook;
|
||||
|
||||
public AsyncHeadsFetchedEvent(int headsCount, String providerName, long timeTook) {
|
||||
public AsyncHeadsFetchedEvent(Map<Category, List<Head>> heads, String providerName, long timeTook) {
|
||||
super(true);
|
||||
this.headsCount = headsCount;
|
||||
this.heads = heads;
|
||||
this.providerName = providerName;
|
||||
this.timeTook = timeTook;
|
||||
}
|
||||
@ -30,8 +35,8 @@ public class AsyncHeadsFetchedEvent extends Event {
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public int getHeadsCount() {
|
||||
return headsCount;
|
||||
public Map<Category, List<Head>> getHeads() {
|
||||
return heads;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
|
@ -33,7 +33,7 @@ public class UpdateTask implements Task {
|
||||
HeadDB.getInstance().getLog().debug("Fetched: " + size + " Heads | Provider: " + providerName + " | Time: " + time + "ms (" + TimeUnit.MILLISECONDS.toSeconds(time) + "s)");
|
||||
Bukkit.getPluginManager().callEvent(
|
||||
new AsyncHeadsFetchedEvent(
|
||||
size,
|
||||
heads,
|
||||
providerName,
|
||||
time));
|
||||
});
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren