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