use of cc.hyperium.event.InvokeEvent in project Hyperium by HyperiumClient.
the class EventClientConnection method playerLoggedIn.
@InvokeEvent
public void playerLoggedIn(ServerJoinEvent event) {
TaskManager taskManager = autotip.getTaskManager();
SessionManager manager = autotip.getSessionManager();
autotip.getMessageUtil().clearQueues();
serverIp = UniversalUtil.getRemoteAddress(event).toLowerCase();
lastLogin = System.currentTimeMillis();
taskManager.getExecutor().execute(() -> {
Object header;
int attempts = 0;
while ((header = getHeader()) == null) {
if (attempts > 15)
return;
try {
Thread.sleep(500);
} catch (InterruptedException ignored) {
}
attempts++;
}
if (UniversalUtil.getUnformattedText(header).equals(hypixelHeader)) {
manager.setOnHypixel(true);
if (autotip.getConfig().isEnabled()) {
taskManager.executeTask(TaskType.LOGIN, manager::login);
}
} else {
manager.setOnHypixel(false);
}
});
}
use of cc.hyperium.event.InvokeEvent in project Hyperium by HyperiumClient.
the class ParticleAuraHandler method renderPlayer.
@InvokeEvent
public void renderPlayer(RenderPlayerEvent event) {
if (Minecraft.getMinecraft().isGamePaused())
return;
if (event.getEntity().isInvisible())
return;
if (Minecraft.getMinecraft().currentScreen instanceof GuiHyperiumScreenIngameMenu)
return;
if (Minecraft.getMinecraft().theWorld == null || Minecraft.getMinecraft().thePlayer == null)
return;
if (!Settings.SHOW_PARTICLES)
return;
AbstractClientPlayer entity = event.getEntity();
if (!entity.equals(Minecraft.getMinecraft().thePlayer) && (entity.posX != entity.prevPosZ || entity.posY != entity.prevPosY || entity.posZ != entity.prevPosZ)) {
return;
}
ParticleAura particleAura = auras.get(entity.getUniqueID());
if (particleAura != null && !entity.isInvisible()) {
double x = entity.prevPosX + (entity.posX - entity.prevPosX) * event.getPartialTicks();
double y = entity.posY + (entity.posY - entity.prevPosY) * event.getPartialTicks();
double z = entity.posZ + (entity.posZ - entity.prevPosZ) * event.getPartialTicks();
List<Vec3> render = particleAura.render(entity, x, y, z);
render.forEach(vec3 -> {
IParticle type = particleAura.getType();
if (type != null) {
EntityFX entityFX = type.spawn(entity.worldObj, vec3.xCoord, vec3.yCoord, vec3.zCoord);
int particleMaxAge = particleAura.getParticleMaxAge();
IMixinEntityFX e = (IMixinEntityFX) entityFX;
if (particleAura.isChroma()) {
int i = Color.HSBtoRGB(System.currentTimeMillis() % 1000L / 1000.0f, 0.8f, 0.8f);
Color color = new Color(i);
entityFX.setRBGColorF(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F);
} else if (particleAura.isRgb()) {
entityFX.setRBGColorF(particleAura.getRed() / 255F, particleAura.getBlue() / 255F, particleAura.getBlue() / 255F);
}
e.setParticleGravity(10);
e.setParticleMaxAge(particleMaxAge);
Minecraft.getMinecraft().effectRenderer.addEffect(entityFX);
}
});
}
}
use of cc.hyperium.event.InvokeEvent in project Hyperium by HyperiumClient.
the class VanillaEnhancementsHud method renderEnchantments.
@InvokeEvent
public void renderEnchantments(RenderHUDEvent e) {
if (Settings.ENCHANTMENTS_ABOVE_HOTBAR) {
ItemStack heldItemStack = mc.thePlayer.inventory.getCurrentItem();
if (heldItemStack != null) {
String toDraw = heldItemStack.getItem() instanceof ItemPotion ? getPotionEffectString(heldItemStack) : getEnchantmentString(heldItemStack);
GL11.glPushMatrix();
GL11.glScalef(0.5f, 0.5f, 0.5f);
ScaledResolution res = ResolutionUtil.current();
int y = res.getScaledHeight() - 59;
y += (mc.playerController.shouldDrawHUD() ? -2 : 14);
y = y + mc.fontRendererObj.FONT_HEIGHT;
y <<= 1;
int x = res.getScaledWidth() - (mc.fontRendererObj.getStringWidth(toDraw) >> 1);
mc.fontRendererObj.drawString(toDraw, x, y, 13421772);
GL11.glScalef(2.0f, 2.0f, 2.0f);
GL11.glPopMatrix();
}
}
}
use of cc.hyperium.event.InvokeEvent in project Hyperium by HyperiumClient.
the class VanillaEnhancementsHud method renderDamage.
@InvokeEvent
public void renderDamage(RenderHUDEvent e) {
if (Settings.DAMAGE_ABOVE_HOTBAR) {
ItemStack heldItemStack = mc.thePlayer.inventory.getCurrentItem();
if (heldItemStack != null) {
GL11.glPushMatrix();
GL11.glScalef(0.5f, 0.5f, 0.5f);
ScaledResolution res = ResolutionUtil.current();
String attackDamage = getAttackDamageString(heldItemStack);
int y = res.getScaledHeight() - 59;
y += (mc.playerController.shouldDrawHUD() ? -1 : 14);
y = y + mc.fontRendererObj.FONT_HEIGHT;
y <<= 1;
y += mc.fontRendererObj.FONT_HEIGHT;
int x = res.getScaledWidth() - (mc.fontRendererObj.getStringWidth(attackDamage) >> 1);
mc.fontRendererObj.drawString(attackDamage, x, y, 13421772);
GL11.glScalef(2.0f, 2.0f, 2.0f);
GL11.glPopMatrix();
}
}
}
use of cc.hyperium.event.InvokeEvent in project Hyperium by HyperiumClient.
the class VanillaEnhancementsHud method renderHotbarNumbers.
@InvokeEvent
public void renderHotbarNumbers(RenderHUDEvent event) {
if (Settings.HOTBAR_KEYS) {
ScaledResolution resolution = ResolutionUtil.current();
int x = resolution.getScaledWidth() / 2 - 87;
int y = resolution.getScaledHeight() - 18;
int[] hotbarKeys = getHotbarKeys();
for (int slot = 0; slot < 9; slot++) {
mc.fontRendererObj.drawString(getKeyString(hotbarKeys[slot]), x + slot * 20, y, -1);
}
}
}
Aggregations