Search in sources :

Example 11 with NettyClient

use of cc.hyperium.netty.NettyClient in project Hyperium by HyperiumClient.

the class TPoseKeybind method onRelease.

@Override
public void onRelease() {
    if (!Settings.TPOSE_TOGGLE_MODE)
        tPoseToggled = false;
    if (Settings.TPOSE_TOGGLE || Settings.TPOSE_TOGGLE_MODE)
        return;
    Hyperium.INSTANCE.getHandlers().getTPoseHandler().stopAnimation(UUIDUtil.getClientUUID());
    NettyClient client = NettyClient.getClient();
    if (client != null) {
        client.write(ServerCrossDataPacket.build(new JsonHolder().put("type", "tpose_update").put("posing", false)));
    }
}
Also used : JsonHolder(cc.hyperium.utils.JsonHolder) NettyClient(cc.hyperium.netty.NettyClient)

Example 12 with NettyClient

use of cc.hyperium.netty.NettyClient in project Hyperium by HyperiumClient.

the class FlipKeybind method onPress.

@Override
public void onPress() {
    if (!Hyperium.INSTANCE.getCosmetics().getFlipCosmetic().isSelfUnlocked()) {
        return;
    }
    if (Settings.isFlipToggle) {
        inverted = !inverted;
        int state = inverted ? Settings.flipType : 0;
        Hyperium.INSTANCE.getHandlers().getFlipHandler().state(UUIDUtil.getClientUUID(), state);
        NettyClient client = NettyClient.getClient();
        if (client != null) {
            client.write(ServerCrossDataPacket.build(new JsonHolder().put("type", "flip_update").put("flip_state", state)));
        }
        Hyperium.INSTANCE.getHandlers().getFlipHandler().resetTick();
    }
}
Also used : JsonHolder(cc.hyperium.utils.JsonHolder) NettyClient(cc.hyperium.netty.NettyClient)

Example 13 with NettyClient

use of cc.hyperium.netty.NettyClient in project Hyperium by HyperiumClient.

the class FlipKeybind method onRelease.

@Override
public void onRelease() {
    if (!Hyperium.INSTANCE.getCosmetics().getFlipCosmetic().isSelfUnlocked()) {
        return;
    }
    if (!Settings.isFlipToggle) {
        inverted = !inverted;
        int state = inverted ? Settings.flipType : 0;
        Hyperium.INSTANCE.getHandlers().getFlipHandler().state(UUIDUtil.getClientUUID(), state);
        NettyClient client = NettyClient.getClient();
        if (client != null) {
            client.write(ServerCrossDataPacket.build(new JsonHolder().put("type", "flip_update").put("flip_state", state)));
        }
    }
}
Also used : JsonHolder(cc.hyperium.utils.JsonHolder) NettyClient(cc.hyperium.netty.NettyClient)

Example 14 with NettyClient

use of cc.hyperium.netty.NettyClient in project Hyperium by HyperiumClient.

the class DabKeybind method onPress.

@Override
public void onPress() {
    DabHandler dabHandler = Hyperium.INSTANCE.getHandlers().getDabHandler();
    UUID uuid = (Minecraft.getMinecraft().getSession()).getProfile().getId();
    AbstractAnimationHandler.AnimationState currentState = dabHandler.get(uuid);
    NettyClient client = NettyClient.getClient();
    if (Settings.DAB_TOGGLE && currentState.isAnimating() && !wasPressed()) {
        currentState.setToggled(false);
        dabHandler.stopAnimation(uuid);
        if (client != null) {
            client.write(ServerCrossDataPacket.build(new JsonHolder().put("type", "dab_update").put("dabbing", false)));
        }
        return;
    }
    if (!wasPressed()) {
        currentState.setToggled(Settings.DAB_TOGGLE);
        dabHandler.startAnimation(uuid);
    }
    if (client != null) {
        client.write(ServerCrossDataPacket.build(new JsonHolder().put("type", "dab_update").put("dabbing", true)));
    }
}
Also used : JsonHolder(cc.hyperium.utils.JsonHolder) NettyClient(cc.hyperium.netty.NettyClient) DabHandler(cc.hyperium.handlers.handlers.animation.DabHandler) AbstractAnimationHandler(cc.hyperium.handlers.handlers.animation.AbstractAnimationHandler) UUID(java.util.UUID)

Example 15 with NettyClient

use of cc.hyperium.netty.NettyClient in project Hyperium by HyperiumClient.

the class LocationHandler method serverLeaveEvent.

@InvokeEvent
public void serverLeaveEvent(ServerLeaveEvent event) {
    location = "Offline";
    NettyClient client = NettyClient.getClient();
    if (client != null) {
        client.write(UpdateLocationPacket.build("offline"));
    }
}
Also used : NettyClient(cc.hyperium.netty.NettyClient)

Aggregations

NettyClient (cc.hyperium.netty.NettyClient)16 JsonHolder (cc.hyperium.utils.JsonHolder)13 AbstractAnimationHandler (cc.hyperium.handlers.handlers.animation.AbstractAnimationHandler)3 EventBus (cc.hyperium.event.EventBus)2 InvokeEvent (cc.hyperium.event.InvokeEvent)2 Multithreading (cc.hyperium.mods.sk1ercommon.Multithreading)2 HyperiumPurchase (cc.hyperium.purchases.HyperiumPurchase)2 PurchaseApi (cc.hyperium.purchases.PurchaseApi)2 IOException (java.io.IOException)2 UUID (java.util.UUID)2 GuiYesNo (net.minecraft.client.gui.GuiYesNo)2 ScaledResolution (net.minecraft.client.gui.ScaledResolution)2 Hyperium (cc.hyperium.Hyperium)1 InternalAddons (cc.hyperium.addons.InternalAddons)1 HyperiumCommandHandler (cc.hyperium.commands.HyperiumCommandHandler)1 cc.hyperium.commands.defaults (cc.hyperium.commands.defaults)1 DefaultConfig (cc.hyperium.config.DefaultConfig)1 Settings (cc.hyperium.config.Settings)1 HyperiumCosmetics (cc.hyperium.cosmetics.HyperiumCosmetics)1 Priority (cc.hyperium.event.Priority)1