Search in sources :

Example 1 with MainMenu

use of com.tangykiwi.kiwiclient.gui.mainmenu.MainMenu in project KiwiClient by TangyKiwi.

the class CapeRenderer method render.

public void render(MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i, AbstractClientPlayerEntity abstractClientPlayerEntity, float f, float g, float h, float j, float k, float l) {
    if (!(MinecraftClient.getInstance().currentScreen instanceof MainMenu) && KiwiClient.moduleManager.getModule(Cape.class).isEnabled() && !abstractClientPlayerEntity.isInvisible() && abstractClientPlayerEntity.isPartVisible(PlayerModelPart.CAPE) && abstractClientPlayerEntity.getName().equals(MinecraftClient.getInstance().player.getName())) {
        ItemStack itemStack = abstractClientPlayerEntity.getEquippedStack(EquipmentSlot.CHEST);
        if (itemStack.getItem() != Items.ELYTRA) {
            matrixStack.push();
            matrixStack.translate(0.0D, 0.0D, 0.125D);
            double d = MathHelper.lerp(h, abstractClientPlayerEntity.prevCapeX, abstractClientPlayerEntity.capeX) - MathHelper.lerp((double) h, abstractClientPlayerEntity.prevX, abstractClientPlayerEntity.getX());
            double e = MathHelper.lerp(h, abstractClientPlayerEntity.prevCapeY, abstractClientPlayerEntity.capeY) - MathHelper.lerp((double) h, abstractClientPlayerEntity.prevY, abstractClientPlayerEntity.getY());
            double m = MathHelper.lerp(h, abstractClientPlayerEntity.prevCapeZ, abstractClientPlayerEntity.capeZ) - MathHelper.lerp((double) h, abstractClientPlayerEntity.prevZ, abstractClientPlayerEntity.getZ());
            float n = abstractClientPlayerEntity.prevBodyYaw + (abstractClientPlayerEntity.bodyYaw - abstractClientPlayerEntity.prevBodyYaw);
            double o = MathHelper.sin(n * 0.017453292F);
            double p = -MathHelper.cos(n * 0.017453292F);
            float q = (float) e * 10.0F;
            q = MathHelper.clamp(q, -6.0F, 32.0F);
            float r = (float) (d * o + m * p) * 100.0F;
            r = MathHelper.clamp(r, 0.0F, 150.0F);
            float s = (float) (d * p - m * o) * 100.0F;
            s = MathHelper.clamp(s, -20.0F, 20.0F);
            if (r < 0.0F) {
                r = 0.0F;
            }
            float t = MathHelper.lerp(h, abstractClientPlayerEntity.prevStrideDistance, abstractClientPlayerEntity.strideDistance);
            q += MathHelper.sin(MathHelper.lerp(h, abstractClientPlayerEntity.prevHorizontalSpeed, abstractClientPlayerEntity.horizontalSpeed) * 6.0F) * 32.0F * t;
            if (abstractClientPlayerEntity.isInSneakingPose()) {
                q += 25.0F;
            }
            matrixStack.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(6.0F + r / 2.0F + q));
            matrixStack.multiply(Vec3f.POSITIVE_Z.getDegreesQuaternion(s / 2.0F));
            matrixStack.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(180.0F - s / 2.0F));
            VertexConsumer vertexConsumer = ItemRenderer.getArmorGlintConsumer(vertexConsumerProvider, RenderLayer.getArmorCutoutNoCull(((Cape) KiwiClient.moduleManager.getModule(Cape.class)).getCape()), false, KiwiClient.moduleManager.getModule(Cape.class).getSettings().get(1).asToggle().state);
            this.getContextModel().renderCape(matrixStack, vertexConsumer, i, OverlayTexture.DEFAULT_UV);
            matrixStack.pop();
        }
    }
}
Also used : VertexConsumer(net.minecraft.client.render.VertexConsumer) Cape(com.tangykiwi.kiwiclient.modules.other.Cape) ItemStack(net.minecraft.item.ItemStack) MainMenu(com.tangykiwi.kiwiclient.gui.mainmenu.MainMenu)

Example 2 with MainMenu

use of com.tangykiwi.kiwiclient.gui.mainmenu.MainMenu in project KiwiClient by TangyKiwi.

the class Deadmau5EarsRenderer method render.

public void render(MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i, AbstractClientPlayerEntity abstractClientPlayerEntity, float f, float g, float h, float j, float k, float l) {
    if (!(MinecraftClient.getInstance().currentScreen instanceof MainMenu) && KiwiClient.moduleManager.getModule(Deadmau5Ears.class).isEnabled() && !abstractClientPlayerEntity.isInvisible() && abstractClientPlayerEntity.getName().equals(MinecraftClient.getInstance().player.getName())) {
        VertexConsumer vertexConsumer = vertexConsumerProvider.getBuffer(RenderLayer.getEntitySolid(KiwiClient.EARS));
        int m = LivingEntityRenderer.getOverlay(abstractClientPlayerEntity, 0.0F);
        matrixStack.push();
        if (abstractClientPlayerEntity.isInSneakingPose()) {
            matrixStack.translate(0.0D, 0.25D, 0.0D);
        }
        this.getContextModel().renderEars(matrixStack, vertexConsumer, i, m);
        matrixStack.pop();
    }
}
Also used : VertexConsumer(net.minecraft.client.render.VertexConsumer) MainMenu(com.tangykiwi.kiwiclient.gui.mainmenu.MainMenu)

Example 3 with MainMenu

use of com.tangykiwi.kiwiclient.gui.mainmenu.MainMenu in project KiwiClient by TangyKiwi.

the class ScreenMixin method renderBackgroundTexture.

@Inject(method = "renderBackgroundTexture", at = @At("HEAD"), cancellable = true)
public void renderBackgroundTexture(int vOffset, CallbackInfo ci) {
    if (!(this.client.currentScreen instanceof PackScreen) && KiwiClient.moduleManager.getModule(Background.class).isEnabled()) {
        ci.cancel();
        RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
        if (this.client.currentScreen instanceof SocialInteractionsScreen)
            return;
        else if (this.client.currentScreen instanceof OptionsScreen) {
            RenderSystem.setShaderTexture(0, KiwiClient.MENU3);
        } else {
            RenderSystem.setShaderTexture(0, KiwiClient.MENU2);
        }
        Screen.drawTexture(new MatrixStack(), 0, 0, 0, 0, this.width, this.height, this.width, this.height);
        if (!(this.client.currentScreen instanceof MainMenu))
            DrawableHelper.fill(new MatrixStack(), 0, 0, this.width, this.height, new Color(0, 0, 0, 140).getRGB());
    }
}
Also used : SocialInteractionsScreen(net.minecraft.client.gui.screen.multiplayer.SocialInteractionsScreen) OptionsScreen(net.minecraft.client.gui.screen.option.OptionsScreen) MatrixStack(net.minecraft.client.util.math.MatrixStack) PackScreen(net.minecraft.client.gui.screen.pack.PackScreen) MainMenu(com.tangykiwi.kiwiclient.gui.mainmenu.MainMenu) Inject(org.spongepowered.asm.mixin.injection.Inject)

Aggregations

MainMenu (com.tangykiwi.kiwiclient.gui.mainmenu.MainMenu)3 VertexConsumer (net.minecraft.client.render.VertexConsumer)2 Cape (com.tangykiwi.kiwiclient.modules.other.Cape)1 SocialInteractionsScreen (net.minecraft.client.gui.screen.multiplayer.SocialInteractionsScreen)1 OptionsScreen (net.minecraft.client.gui.screen.option.OptionsScreen)1 PackScreen (net.minecraft.client.gui.screen.pack.PackScreen)1 MatrixStack (net.minecraft.client.util.math.MatrixStack)1 ItemStack (net.minecraft.item.ItemStack)1 Inject (org.spongepowered.asm.mixin.injection.Inject)1