use of cc.hyperium.event.network.server.hypixel.JoinMinigameEvent in project Hyperium by HyperiumClient.
the class MinigameListener method onTick.
@InvokeEvent
public void onTick(TickEvent event) {
if (Minecraft.getMinecraft().theWorld != null && Hyperium.INSTANCE.getHandlers().getHypixelDetector().isHypixel() && Minecraft.getMinecraft().theWorld.getScoreboard() != null) {
if (cooldown <= 0) {
cooldown = 3 * 20;
String minigameName = getScoreboardTitle();
Arrays.stream(Minigame.values()).filter(m -> minigameName.equalsIgnoreCase(m.scoreName) && !minigameName.equalsIgnoreCase(currentMinigameName)).forEach(m -> {
currentMinigameName = minigameName;
EventBus.INSTANCE.post(new JoinMinigameEvent(m));
});
} else {
cooldown--;
}
}
}
Aggregations