Search in sources :

Example 1 with HypnoticMainMenu

use of dev.hypnotic.ui.HypnoticMainMenu in project Hypnotic-Client by Hypnotic-Development.

the class MinecraftClientMixin method onPreTick.

@Inject(at = @At("HEAD"), method = "tick")
private void onPreTick(CallbackInfo info) {
    BlockIterator.INSTANCE.onTick();
    EventTick event = new EventTick();
    event.call();
    if (ModuleManager.INSTANCE.getModule(DiscordRPCModule.class).isEnabled()) {
        if (mc.player == null) {
            if (mc.currentScreen instanceof HypnoticMainMenu)
                DiscordRPCModule.status = "In main menu";
            if (mc.currentScreen instanceof SelectWorldScreen)
                DiscordRPCModule.status = "Browsing worlds";
            if (mc.currentScreen instanceof MultiplayerScreen)
                DiscordRPCModule.status = "Browsing servers";
        } else {
            if (mc.isInSingleplayer())
                DiscordRPCModule.status = "Playing singlelplayer";
            if (mc.getCurrentServerEntry() != null && !mc.isInSingleplayer())
                DiscordRPCModule.status = ModuleManager.INSTANCE.getModule(DiscordRPCModule.class).serverpriv.isEnabled() ? "Playing multiplayer." : "Playing multiplayer on " + mc.getCurrentServerEntry().address;
        }
    }
}
Also used : DiscordRPCModule(dev.hypnotic.module.misc.DiscordRPCModule) MultiplayerScreen(net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen) HypnoticMainMenu(dev.hypnotic.ui.HypnoticMainMenu) EventTick(dev.hypnotic.event.events.EventTick) SelectWorldScreen(net.minecraft.client.gui.screen.world.SelectWorldScreen) Inject(org.spongepowered.asm.mixin.injection.Inject)

Aggregations

EventTick (dev.hypnotic.event.events.EventTick)1 DiscordRPCModule (dev.hypnotic.module.misc.DiscordRPCModule)1 HypnoticMainMenu (dev.hypnotic.ui.HypnoticMainMenu)1 MultiplayerScreen (net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen)1 SelectWorldScreen (net.minecraft.client.gui.screen.world.SelectWorldScreen)1 Inject (org.spongepowered.asm.mixin.injection.Inject)1