use of cc.hyperium.event.InvokeEvent in project Hyperium by HyperiumClient.
the class AbstractPreCopyAnglesAnimationHandler method onPreCopyPlayerModelAngles.
@InvokeEvent
public void onPreCopyPlayerModelAngles(PreCopyPlayerModelAnglesEvent event) {
AbstractClientPlayer entity = event.getEntity();
IMixinModelBiped player = event.getModel();
modify(entity, player, true);
}
use of cc.hyperium.event.InvokeEvent 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.event.InvokeEvent 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.event.InvokeEvent in project Hyperium by HyperiumClient.
the class AbstractCosmetic method worldSwitch.
@InvokeEvent
public void worldSwitch(WorldChangeEvent changeEvent) {
UUID id = UUIDUtil.getClientUUID();
if (id == null) {
return;
}
Boolean aBoolean = purchasedBy.get(id);
purchasedBy.clear();
if (aBoolean != null)
purchasedBy.put(id, aBoolean);
}
use of cc.hyperium.event.InvokeEvent 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();
}
}
Aggregations