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)));
}
}
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)));
}
}
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)));
}
}
}
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")));
}
}
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)));
}
}
Aggregations