Search in sources :

Example 41 with JsonHolder

use of cc.hyperium.utils.JsonHolder in project Hyperium by HyperiumClient.

the class DabKeybind method onRelease.

@Override
public void onRelease() {
    if (Settings.DAB_TOGGLE)
        return;
    Hyperium.INSTANCE.getHandlers().getDabHandler().stopAnimation(UUIDUtil.getClientUUID());
    NettyClient client = NettyClient.getClient();
    if (client != null) {
        client.write(ServerCrossDataPacket.build(new JsonHolder().put("type", "dab_update").put("dabbing", false)));
    }
}
Also used : JsonHolder(cc.hyperium.utils.JsonHolder) NettyClient(cc.hyperium.netty.NettyClient)

Example 42 with JsonHolder

use of cc.hyperium.utils.JsonHolder in project Hyperium by HyperiumClient.

the class FlossKeybind method onRelease.

@Override
public void onRelease() {
    if (Settings.FLOSS_TOGGLE)
        return;
    Hyperium.INSTANCE.getHandlers().getFlossDanceHandler().stopAnimation(UUIDUtil.getClientUUID());
    NettyClient client = NettyClient.getClient();
    if (client != null) {
        client.write(ServerCrossDataPacket.build(new JsonHolder().put("type", "floss_update").put("flossing", false)));
    }
}
Also used : JsonHolder(cc.hyperium.utils.JsonHolder) NettyClient(cc.hyperium.netty.NettyClient)

Example 43 with JsonHolder

use of cc.hyperium.utils.JsonHolder in project Hyperium by HyperiumClient.

the class FlossKeybind method onPress.

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

Example 44 with JsonHolder

use of cc.hyperium.utils.JsonHolder in project Hyperium by HyperiumClient.

the class TwerkDanceKeybind method onPress.

@Override
public void onPress() {
    Hyperium.INSTANCE.getHandlers().getTwerkDance().getStates().put(UUIDUtil.getClientUUID(), System.currentTimeMillis());
    Hyperium.INSTANCE.getHandlers().getTwerkDance().startAnimation(UUIDUtil.getClientUUID());
    NettyClient client = NettyClient.getClient();
    if (client != null) {
        client.write(ServerCrossDataPacket.build(new JsonHolder().put("type", "twerk_dance")));
    }
}
Also used : JsonHolder(cc.hyperium.utils.JsonHolder) NettyClient(cc.hyperium.netty.NettyClient)

Example 45 with JsonHolder

use of cc.hyperium.utils.JsonHolder in project Hyperium by HyperiumClient.

the class TPoseKeybind method onPress.

@Override
public void onPress() {
    TPoseHandler tPoseHandler = Hyperium.INSTANCE.getHandlers().getTPoseHandler();
    UUID uuid = (Minecraft.getMinecraft().getSession()).getProfile().getId();
    AbstractAnimationHandler.AnimationState currentState = tPoseHandler.get(uuid);
    tPoseToggled = !Settings.TPOSE_TOGGLE_MODE || !tPoseToggled;
    NettyClient client = NettyClient.getClient();
    if (Settings.TPOSE_TOGGLE_MODE) {
        currentState.setToggled(tPoseToggled);
        if (tPoseToggled)
            tPoseHandler.startAnimation(uuid);
        else
            tPoseHandler.stopAnimation(uuid);
        if (client != null) {
            client.write(ServerCrossDataPacket.build(new JsonHolder().put("type", "tpose_update").put("posing", tPoseToggled)));
        }
        return;
    }
    if (Settings.TPOSE_TOGGLE && currentState.isAnimating() && !wasPressed()) {
        currentState.setToggled(false);
        tPoseHandler.stopAnimation(uuid);
        if (client != null) {
            client.write(ServerCrossDataPacket.build(new JsonHolder().put("type", "tpose_update").put("posing", false)));
        }
        return;
    }
    if (!wasPressed()) {
        currentState.setToggled(Settings.TPOSE_TOGGLE);
        tPoseHandler.startAnimation(uuid);
    }
    if (client != null) {
        client.write(ServerCrossDataPacket.build(new JsonHolder().put("type", "tpose_update").put("posing", true)));
    }
}
Also used : JsonHolder(cc.hyperium.utils.JsonHolder) NettyClient(cc.hyperium.netty.NettyClient) AbstractAnimationHandler(cc.hyperium.handlers.handlers.animation.AbstractAnimationHandler) TPoseHandler(cc.hyperium.handlers.handlers.animation.TPoseHandler) UUID(java.util.UUID)

Aggregations

JsonHolder (cc.hyperium.utils.JsonHolder)81 DisplayLine (cc.hyperium.handlers.handlers.stats.display.DisplayLine)42 StatsDisplayItem (cc.hyperium.handlers.handlers.stats.display.StatsDisplayItem)42 ArrayList (java.util.ArrayList)34 NettyClient (cc.hyperium.netty.NettyClient)13 DisplayTable (cc.hyperium.handlers.handlers.stats.display.DisplayTable)10 JsonArray (com.google.gson.JsonArray)9 JsonElement (com.google.gson.JsonElement)8 HyperiumPurchase (cc.hyperium.purchases.HyperiumPurchase)5 JsonObject (com.google.gson.JsonObject)5 URL (java.net.URL)5 UUID (java.util.UUID)5 HashMap (java.util.HashMap)4 InvokeEvent (cc.hyperium.event.InvokeEvent)3 PurchaseLoadEvent (cc.hyperium.event.network.PurchaseLoadEvent)3 AbstractAnimationHandler (cc.hyperium.handlers.handlers.animation.AbstractAnimationHandler)3 DisplayItem (cc.hyperium.mods.chromahud.api.DisplayItem)3 IOException (java.io.IOException)3 ExecutionException (java.util.concurrent.ExecutionException)3 GuiButton (net.minecraft.client.gui.GuiButton)3