use of cc.hyperium.purchases.HyperiumPurchase in project Hyperium by HyperiumClient.
the class WingsRenderer method onRenderPlayer.
@InvokeEvent
public void onRenderPlayer(RenderPlayerEvent event) {
if (CosmeticsUtil.shouldHide(EnumPurchaseType.WING_COSMETIC))
return;
EntityPlayer player = event.getEntity();
if (wingsCosmetic.isPurchasedBy(event.getEntity().getUniqueID()) && !player.isInvisible()) {
HyperiumPurchase packageIfReady = PurchaseApi.getInstance().getPackageIfReady(event.getEntity().getUniqueID());
if (packageIfReady == null || packageIfReady.getCachedSettings().isWingsDisabled())
return;
renderWings(player, event.getPartialTicks(), event.getX(), event.getY(), event.getZ());
}
}
use of cc.hyperium.purchases.HyperiumPurchase in project Hyperium by HyperiumClient.
the class ButtCosmetic method preCopy.
@InvokeEvent(priority = Priority.HIGH)
public void preCopy(PreCopyPlayerModelAnglesEvent event) {
if (!(event.getModel() instanceof IMixinModelPlayer))
return;
if (!isPurchasedBy(event.getEntity().getUniqueID())) {
((IMixinModelPlayer) event.getModel()).getButt().showModel = false;
return;
}
HyperiumPurchase packageIfReady = PurchaseApi.getInstance().getPackageIfReady(event.getEntity().getUniqueID());
if (packageIfReady == null)
return;
((IMixinModelPlayer) event.getModel()).getButt().showModel = !packageIfReady.getCachedSettings().isButtDisabled();
((IMixinModelPlayer) event.getModel()).getButt().offsetY = event.getEntity().isSneaking() ? -.45F : -.4F;
((IMixinModelPlayer) event.getModel()).getButt().offsetZ = event.getEntity().isSneaking() ? .3F : 0F;
}
use of cc.hyperium.purchases.HyperiumPurchase in project Hyperium by HyperiumClient.
the class HamsterCompanion method renderPlayer.
@InvokeEvent
public void renderPlayer(RenderPlayerEvent e) {
if (Minecraft.getMinecraft().theWorld == null)
return;
UUID uuid = e.getEntity().getUniqueID();
if (!isPurchasedBy(uuid) || hamsters.containsKey(uuid) || toAdd.contains(e.getEntity()))
return;
HyperiumPurchase packageIfReady = PurchaseApi.getInstance().getPackageIfReady(uuid);
if (packageIfReady == null || packageIfReady.getCachedSettings().getCurrentCompanion() != EnumPurchaseType.HAMSTER_COMPANION) {
return;
}
toAdd.add(e.getEntity());
}
use of cc.hyperium.purchases.HyperiumPurchase in project Hyperium by HyperiumClient.
the class CosmeticHat method onPlayerRender.
@InvokeEvent
public void onPlayerRender(RenderPlayerEvent e) {
Minecraft mc = Minecraft.getMinecraft();
AbstractClientPlayer player = e.getEntity();
if (CosmeticsUtil.shouldHide(getPurchaseType()))
return;
if (isPurchasedBy(player.getUniqueID()) && !player.isInvisible()) {
HyperiumPurchase packageIfReady = PurchaseApi.getInstance().getPackageIfReady(player.getUniqueID());
if (packageIfReady.getCachedSettings().getCurrentHatType() != getPurchaseType())
return;
GlStateManager.pushMatrix();
GlStateManager.translate(e.getX(), e.getY(), e.getZ());
double scale = 1.0F;
double rotate = interpolate(player.prevRotationYawHead, player.rotationYawHead, e.getPartialTicks());
double rotate1 = interpolate(player.prevRotationPitch, player.rotationPitch, e.getPartialTicks());
GL11.glScaled(-scale, -scale, scale);
GL11.glTranslated(0.0, -((player.height - (player.isSneaking() ? .25 : 0)) - .38) / scale, 0.0);
GL11.glRotated(180.0 + rotate, 0.0, 1.0, 0.0);
GL11.glRotated(rotate1, 1.0D, 0.0D, 0.0D);
GlStateManager.translate(0, -.45, 0);
/* Bind the hat texture and render the model */
mc.getTextureManager().bindTexture(hatTexture);
hatModel.render(player, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
GlStateManager.popMatrix();
}
}
use of cc.hyperium.purchases.HyperiumPurchase in project Hyperium by HyperiumClient.
the class ParticleGui method drawScreen.
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
if (queueBuild) {
queueBuild = false;
rebuild();
}
GlStateManager.scale(2.0, 2.0, 2.0);
HyperiumPurchase self = PurchaseApi.getInstance().getSelf();
if (self != null)
credits = self.getResponse().optInt("remaining_credits");
String s = I18n.format("gui.cosmetics.credits") + ": " + credits;
fontRendererObj.drawString(s, (ResolutionUtil.current().getScaledWidth() >> 2) - (fontRendererObj.getStringWidth(s) >> 1), 15, Color.MAGENTA.getRGB(), true);
GlStateManager.scale(.5, .5, .5);
s = I18n.format("gui.cosmetics.line1");
fontRendererObj.drawString(s, (ResolutionUtil.current().getScaledWidth() >> 1) - (fontRendererObj.getStringWidth(s) >> 1), 50, Color.MAGENTA.getRGB(), true);
s = I18n.format("gui.cosmetics.line2");
fontRendererObj.drawString(s, (ResolutionUtil.current().getScaledWidth() >> 1) - (fontRendererObj.getStringWidth(s) >> 1), 61, Color.MAGENTA.getRGB(), true);
s = I18n.format("gui.cosmetics.preview");
GlStateManager.scale(2.0, 2.0, 2.0);
int stringWidth = fontRendererObj.getStringWidth(s);
int x1 = ResolutionUtil.current().getScaledWidth() / 4 - stringWidth / 4;
int y1 = ResolutionUtil.current().getScaledHeight() / 4;
fontRendererObj.drawString(s, x1, y1, Color.MAGENTA.getRGB(), true);
GlStateManager.scale(.5, .5, .5);
previewBlock = new GuiBlock(x1 * 2, x1 * 2 + stringWidth * 2, y1 * 2, y1 * 2 + 20);
super.drawScreen(mouseX, mouseY, partialTicks);
ScaledResolution current = ResolutionUtil.current();
particleType.render(current.getScaledWidth() / 5, current.getScaledHeight() / 2, mouseX, mouseY);
particleAnimation.render(current.getScaledWidth() * 4 / 5, current.getScaledHeight() / 2, mouseX, mouseY);
if (overlay != null)
overlay.render(mouseX, mouseY, width, height);
}
Aggregations