Search in sources :

Example 6 with InvokeEvent

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);
}
Also used : AbstractClientPlayer(net.minecraft.client.entity.AbstractClientPlayer) IMixinModelBiped(cc.hyperium.mixinsimp.client.model.IMixinModelBiped) InvokeEvent(cc.hyperium.event.InvokeEvent)

Example 7 with InvokeEvent

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());
    }
}
Also used : HyperiumPurchase(cc.hyperium.purchases.HyperiumPurchase) EntityPlayer(net.minecraft.entity.player.EntityPlayer) InvokeEvent(cc.hyperium.event.InvokeEvent)

Example 8 with InvokeEvent

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;
}
Also used : IMixinModelPlayer(cc.hyperium.mixinsimp.client.model.IMixinModelPlayer) HyperiumPurchase(cc.hyperium.purchases.HyperiumPurchase) InvokeEvent(cc.hyperium.event.InvokeEvent)

Example 9 with InvokeEvent

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);
}
Also used : UUID(java.util.UUID) InvokeEvent(cc.hyperium.event.InvokeEvent)

Example 10 with InvokeEvent

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();
    }
}
Also used : AbstractClientPlayer(net.minecraft.client.entity.AbstractClientPlayer) HyperiumPurchase(cc.hyperium.purchases.HyperiumPurchase) Minecraft(net.minecraft.client.Minecraft) InvokeEvent(cc.hyperium.event.InvokeEvent)

Aggregations

InvokeEvent (cc.hyperium.event.InvokeEvent)44 HyperiumPurchase (cc.hyperium.purchases.HyperiumPurchase)7 AbstractClientPlayer (net.minecraft.client.entity.AbstractClientPlayer)6 UUID (java.util.UUID)4 EntityPlayerSP (net.minecraft.client.entity.EntityPlayerSP)4 ScaledResolution (net.minecraft.client.gui.ScaledResolution)4 RenderManager (net.minecraft.client.renderer.entity.RenderManager)4 EntityPlayer (net.minecraft.entity.player.EntityPlayer)4 IMixinModelBiped (cc.hyperium.mixinsimp.client.model.IMixinModelBiped)3 ChatComponentText (net.minecraft.util.ChatComponentText)3 EventBus (cc.hyperium.event.EventBus)2 AutoGG (cc.hyperium.mods.autogg.AutoGG)2 ChatColor (cc.hyperium.utils.ChatColor)2 IOException (java.io.IOException)2 Field (java.lang.reflect.Field)2 URI (java.net.URI)2 URISyntaxException (java.net.URISyntaxException)2 Map (java.util.Map)2 Matcher (java.util.regex.Matcher)2 Minecraft (net.minecraft.client.Minecraft)2