use of cc.hyperium.event.InvokeEvent in project Hyperium by HyperiumClient.
the class ParticleAuraHandler method loadPurchaseEvent.
@InvokeEvent
public void loadPurchaseEvent(PurchaseLoadEvent purchaseLoadEvent) {
HyperiumPurchase purchase = purchaseLoadEvent.getPurchase();
auras.remove(purchase.getPlayerUUID());
JsonHolder purchaseSettings = purchase.getPurchaseSettings();
if (!purchaseSettings.has("particle"))
return;
JsonHolder data = purchaseSettings.optJSONObject("particle");
String particle_animation1 = data.optString("particle_animation");
AbstractAnimation particle_animation = animations.get(particle_animation1);
EnumParticleType type = EnumParticleType.parse(data.optString("type"));
if (particle_animation == null || type == null)
return;
if (!purchase.hasPurchased("PARTICLE_" + type.name()) || !purchase.hasPurchased("ANIMATION_" + (particle_animation1.toUpperCase().replace(" ", "_")))) {
return;
}
boolean rgb = data.optBoolean("rgb");
boolean chroma = data.optBoolean("chroma");
ParticleAura max_age = new ParticleAura(renderEngines.get(type), particle_animation, data.optInt("max_age", 2), chroma, rgb);
max_age.setRgb(data.optInt("red"), data.optInt("green"), data.optInt("blue"));
auras.put(purchase.getPlayerUUID(), max_age);
}
use of cc.hyperium.event.InvokeEvent in project Hyperium by HyperiumClient.
the class VanillaEnhancementsHud method onRenderArmor.
@InvokeEvent
public void onRenderArmor(GuiDrawScreenEvent e) {
if ((Settings.ARMOR_PROT_POTENTIONAL || Settings.ARMOR_PROJ_POTENTIONAL) && (e.getScreen() instanceof GuiInventory || e.getScreen() instanceof GuiContainerCreative)) {
ScaledResolution res = new ScaledResolution(mc);
String message = getArmorString();
mc.currentScreen.drawString(mc.fontRendererObj, message, 10, res.getScaledHeight() - 16, -1);
}
}
use of cc.hyperium.event.InvokeEvent in project Hyperium by HyperiumClient.
the class EventClientConnection method playerLoggedOut.
@InvokeEvent
public void playerLoggedOut(ServerLeaveEvent event) {
TaskManager taskManager = autotip.getTaskManager();
SessionManager manager = autotip.getSessionManager();
manager.setOnHypixel(false);
taskManager.executeTask(TaskType.LOGOUT, manager::logout);
resetHeader();
}
use of cc.hyperium.event.InvokeEvent in project Hyperium by HyperiumClient.
the class HypixelFriendsGui method onRemove.
@InvokeEvent
public void onRemove(FriendRemoveEvent event) {
JsonHolder friends = null;
try {
friends = Hyperium.INSTANCE.getHandlers().getDataHandler().getFriendsForCurrentUser().get().getData();
} catch (InterruptedException | ExecutionException e) {
e.printStackTrace();
}
String key = null;
for (Map.Entry<String, JsonElement> stringJsonElementEntry : friends.getObject().entrySet()) {
if (!(stringJsonElementEntry.getValue() instanceof JsonObject))
continue;
String display = stringJsonElementEntry.getValue().getAsJsonObject().get("display").getAsString();
if (EnumChatFormatting.getTextWithoutFormattingCodes(display).contains(event.getFullName()))
key = stringJsonElementEntry.getKey();
}
if (key != null) {
friends.remove(key);
}
}
use of cc.hyperium.event.InvokeEvent in project Hyperium by HyperiumClient.
the class BroadcastEvents method checkForEvents.
// Raw: "a>> Achievement Unlocked: Rambo <<a"
@InvokeEvent
public void checkForEvents(ServerChatEvent event) {
String raw = EnumChatFormatting.getTextWithoutFormattingCodes(event.getChat().getUnformattedText());
Matcher achMatcher = ACHIEVEMENT_PATTERN.matcher(raw);
if (achMatcher.matches()) {
String ach = achMatcher.group("achievement");
// Check to stop spamming of gchat if achievement is broken and you get it many times.
if (!achievementsGotten.contains(ach)) {
EventBus.INSTANCE.post(new AchievementGetEvent(ach));
achievementsGotten.add(ach);
}
}
}
Aggregations