3
0
Mirror von https://github.com/TheSilentPro/HeadDB.git synchronisiert 2024-12-27 11:20:05 +01:00

Change type from heads count to fetched heads map

Dieser Commit ist enthalten in:
NotStevy 2023-06-29 22:58:59 +02:00
Ursprung 51f3853910
Commit f00f099b24
2 geänderte Dateien mit 11 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -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")

Datei anzeigen

@ -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));
});