Search in sources :

Example 1 with OptionsScreen

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

the class ClientPlayerEntityMixin method tick.

@Inject(method = "tick", at = @At("HEAD"), cancellable = true)
public void tick(CallbackInfo ci) {
    for (Mod mod : ModuleManager.INSTANCE.modules) {
        if (mc.player != null) {
            if (mod.isBinding() && mc.currentScreen == null) {
                try {
                    mc.setScreen(new BindingScreen(mod, null));
                } catch (Exception e) {
                }
            }
            if (mod.isEnabled())
                mod.onTick();
            mod.onTickDisabled();
        }
    }
    for (HudModule mod : HudManager.INSTANCE.hudModules) {
        if (mc.player != null) {
            if (mod.isEnabled())
                mod.onTick();
            mod.onTickDisabled();
        }
    }
    RenderUtils.INSTANCE.onTick();
    if (mc.world != null)
        BaritoneAPI.getSettings().chatControl.value = false;
    OptionsScreen options = OptionsScreen.INSTANCE;
    BaritoneAPI.getSettings().allowBreak.value = options.allowBreak.isEnabled();
    BaritoneAPI.getSettings().allowParkour.value = options.allowParkour.isEnabled();
    BaritoneAPI.getSettings().allowParkourAscend.value = options.allowParkour.isEnabled();
    BaritoneAPI.getSettings().allowParkourPlace.value = options.allowParkour.isEnabled();
    BaritoneAPI.getSettings().allowDownward.value = options.allowParkour.isEnabled();
    BaritoneAPI.getSettings().allowDiagonalAscend.value = options.allowParkour.isEnabled();
    BaritoneAPI.getSettings().allowDiagonalDescend.value = options.allowParkour.isEnabled();
    BaritoneAPI.getSettings().chatControl.value = options.chatControl.isEnabled();
    BaritoneAPI.getSettings().allowPlace.value = options.allowPlace.isEnabled();
    BaritoneAPI.getSettings().allowInventory.value = options.allowInventory.isEnabled();
    BaritoneAPI.getSettings().assumeWalkOnWater.value = options.assumeJesus.isEnabled();
    BaritoneAPI.getSettings().assumeWalkOnLava.value = options.assumeJesus.isEnabled();
    BaritoneAPI.getSettings().assumeStep.value = options.assumeStep.isEnabled();
    BaritoneAPI.getSettings().assumeSafeWalk.value = options.assumeSafewalk.isEnabled();
}
Also used : Mod(dev.hypnotic.module.Mod) OptionsScreen(dev.hypnotic.ui.OptionsScreen) BindingScreen(dev.hypnotic.ui.BindingScreen) HudModule(dev.hypnotic.module.hud.HudModule) Inject(org.spongepowered.asm.mixin.injection.Inject)

Aggregations

Mod (dev.hypnotic.module.Mod)1 HudModule (dev.hypnotic.module.hud.HudModule)1 BindingScreen (dev.hypnotic.ui.BindingScreen)1 OptionsScreen (dev.hypnotic.ui.OptionsScreen)1 Inject (org.spongepowered.asm.mixin.injection.Inject)1