use of cc.hyperium.event.client.TickEvent 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--;
}
}
}
use of cc.hyperium.event.client.TickEvent in project Hyperium by HyperiumClient.
the class HyperiumMinecraft method runTick.
public void runTick(Profiler mcProfiler) {
mcProfiler.startSection("hyperium_tick");
EventBus.INSTANCE.post(new TickEvent());
mcProfiler.endSection();
}
Aggregations