use of cc.hyperium.handlers.handlers.animation.FlossDanceHandler 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)));
}
}
}
Aggregations