use of cc.hyperium.netty.NettyClient in project Hyperium by HyperiumClient.
the class CapesGui method pack.
@Override
protected void pack() {
reg("RESET", new GuiButton(nextId(), 1, 1, "Disable Hyperium Cape"), guiButton -> {
NettyClient client = NettyClient.getClient();
if (client != null) {
client.write(ServerCrossDataPacket.build(new JsonHolder().put("internal", true).put("set_cape", true).put("value", "default")));
}
HyperiumPurchase self = PurchaseApi.getInstance().getSelf();
if (self == null) {
GeneralChatHandler.instance().sendMessage("Unable to reset your cape: Your profile is not loaded");
return;
}
JsonHolder purchaseSettings = self.getPurchaseSettings();
if (!purchaseSettings.has("cape")) {
purchaseSettings.put("cape", new JsonHolder());
}
purchaseSettings.optJSONObject("cape").put("type", "default");
Hyperium.INSTANCE.getHandlers().getGeneralChatHandler().sendMessage("You may need to switch worlds to update your cape.");
}, guiButton -> {
});
reg("CUSTOM", new GuiButton(nextId(), 1, 22, "Custom Cape"), guiButton -> {
Desktop desktop = Desktop.getDesktop();
if (desktop != null) {
try {
desktop.browse(new URL("https://capes.hyperium.cc").toURI());
} catch (IOException | URISyntaxException e) {
e.printStackTrace();
}
}
}, guiButton -> {
});
}
Aggregations