Examples of MorphInfoClient


Examples of morph.client.morph.MorphInfoClient

                player1.eyeHeight = player1.getDefaultEyeHeight();
                player1.ignoreFrustumCheck = false;
            }
        }

        MorphInfoClient info = Morph.proxy.tickHandlerClient.playerMorphInfo.get(playerName);
        if(info != null)
        {
            for(Ability ability : info.morphAbilities)
            {
                if(ability.inactive)
View Full Code Here

Examples of morph.client.morph.MorphInfoClient

        {
            if(event.phase == TickEvent.Phase.START)
            {
                this.renderTick = event.renderTickTime;

                MorphInfoClient info1 = playerMorphInfo.get(mc.thePlayer.getCommandSenderName());
                if(info1 != null )
                {
                    float prog = info1.morphProgress > 10 ? (((float)info1.morphProgress + renderTick) / 60F) : 0.0F;
                    if(prog > 1.0F)
                    {
                        prog = 1.0F;
                    }

                    prog = (float)Math.pow(prog, 2);

                    float prev = info1.prevState != null && !(info1.prevState.entInstance instanceof EntityPlayer) ? info1.prevState.entInstance.getEyeHeight() : mc.thePlayer.yOffset + mc.thePlayer.getDefaultEyeHeight();
                    float next = info1.nextState != null && !(info1.nextState.entInstance instanceof EntityPlayer) ? info1.nextState.entInstance.getEyeHeight() : mc.thePlayer.yOffset + mc.thePlayer.getDefaultEyeHeight();
                    ySize = mc.thePlayer.yOffset - (prev + (next - prev) * prog) + mc.thePlayer.getDefaultEyeHeight();
                    eyeHeight = mc.thePlayer.eyeHeight;
                    mc.thePlayer.lastTickPosY -= ySize;
                    mc.thePlayer.prevPosY -= ySize;
                    mc.thePlayer.posY -= ySize;
                    mc.thePlayer.eyeHeight = mc.thePlayer.getDefaultEyeHeight();

                    shiftedPosY = true;
                }

                if(radialShow)
                {
                    Mouse.getDX();
                    Mouse.getDY();
                    mc.mouseHelper.deltaX = mc.mouseHelper.deltaY = 0;
                    mc.renderViewEntity.prevRotationYawHead = mc.renderViewEntity.rotationYawHead = radialPlayerYaw;
                    mc.renderViewEntity.prevRotationYaw = mc.renderViewEntity.rotationYaw = radialPlayerYaw;
                    mc.renderViewEntity.prevRotationPitch = mc.renderViewEntity.rotationPitch = radialPlayerPitch;
                }
                //    ySize = 0.0F;

                //    for(Entry<String, MorphInfoClient> e : playerMorphInfo.entrySet())
                //    {
                //      MorphInfoClient info = e.getValue();
                //    }
            }
            else
            {
                MorphInfoClient info = playerMorphInfo.get(mc.thePlayer.getCommandSenderName());
                if(info != null)
                {
                    shiftedPosY = false;

                    mc.thePlayer.lastTickPosY += ySize;
                    mc.thePlayer.prevPosY += ySize;
                    mc.thePlayer.posY += ySize;
                    mc.thePlayer.eyeHeight = eyeHeight;
                }

                float bossHealthScale = BossStatus.healthScale;
                int bossStatusBarTime = BossStatus.statusBarTime;
                String bossName = BossStatus.bossName;
                boolean hasColorModifier = BossStatus.hasColorModifier;

                if((selectorTimer > 0 || selectorShow) && !mc.gameSettings.hideGUI)
                {
                    GL11.glPushMatrix();

                    float progress = (11F - ((float)selectorTimer + (1F - renderTick))) / 11F;

                    if(selectorShow)
                    {
                        progress = 1.0F - progress;
                    }

                    if(selectorShow && selectorTimer == 0)
                    {
                        progress = 0.0F;
                    }

                    progress = (float)Math.pow(progress, 2);

                    GL11.glTranslatef(-52F * progress, 0.0F, 0.0F);

                    ScaledResolution reso = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);

                    int gap = (reso.getScaledHeight() - (42 * 5)) / 2;

                    double size = 42D;
                    double width1 = 0.0D;

                    GL11.glPushMatrix();

                    int maxShowable = (int)Math.ceil((double)reso.getScaledHeight() / size) + 2;

                    if(selectorSelected == 0 && selectorSelectedPrev > 0 || selectorSelectedPrev == 0 && selectorSelected > 0)
                    {
                        maxShowable = 150;
                    }

                    float progressV = (float)(scrollTime - (scrollTimer - renderTick)) / (float)scrollTime;

                    progressV = (float)Math.pow(progressV, 2);

                    if(progressV > 1.0F)
                    {
                        progressV = 1.0F;
                        selectorSelectedPrev = selectorSelected;
                    }

                    float progressH = (float)(scrollTime - (scrollTimerHori - renderTick)) / (float)scrollTime;

                    progressH = (float)Math.pow(progressH, 2);

                    if(progressH > 1.0F)
                    {
                        progressH = 1.0F;
                        selectorSelectedHoriPrev = selectorSelectedHori;
                    }

                    GL11.glTranslatef(0.0F, ((selectorSelected - selectorSelectedPrev) * 42F) * (1.0F - progressV), 0.0F);

                    GL11.glDisable(GL11.GL_DEPTH_TEST);
                    GL11.glDepthMask(false);
                    GL11.glColor4f(1f,1f,1f,1f);
                    GL11.glDisable(GL11.GL_ALPHA_TEST);

                    GL11.glEnable(GL11.GL_BLEND);
                    GL11.glBlendFunc(770, 771);

                    int i = 0;

                    Iterator<Entry<String, ArrayList<MorphState>>> ite = playerMorphCatMap.entrySet().iterator();

                    while(ite.hasNext())
                    {
                        Entry<String, ArrayList<MorphState>> e = ite.next();

                        if(i > selectorSelected + maxShowable || i < selectorSelected - maxShowable)
                        {
                            i++;
                            continue;
                        }

                        double height1 = gap + size * (i - selectorSelected);

                        ArrayList<MorphState> states = e.getValue();
                        if(states == null || states.isEmpty())
                        {
                            ite.remove();
                            i++;
                            break;
                        }

                        Tessellator tessellator = Tessellator.instance;

                        if(i == selectorSelected)
                        {
                            if(selectorSelectedHori < 0)
                            {
                                selectorSelectedHori = states.size() - 1;
                            }
                            if(selectorSelectedHori >= states.size())
                            {
                                selectorSelectedHori = 0;
                            }

                            boolean newSlide = false;

                            if(progressV < 1.0F && selectorSelectedPrev != selectorSelected)
                            {
                                selectorSelectedHoriPrev = states.size() - 1;
                                selectorSelectedHori = 0;
                                newSlide = true;
                            }
                            if(!selectorShow)
                            {
                                selectorSelectedHori = states.size() - 1;
                                newSlide = true;
                            }
                            else if(progress > 0.0F)
                            {
                                selectorSelectedHoriPrev = states.size() - 1;
                                newSlide = true;
                            }

                            for(int j = 0; j < states.size(); j++)
                            {
                                GL11.glPushMatrix();

                                GL11.glTranslated(newSlide && j == 0 ? 0.0D : ((selectorSelectedHori - selectorSelectedHoriPrev) * 42F) * (1.0F - progressH), 0.0D, 0.0D);

                                mc.getTextureManager().bindTexture(states.size() == 1 || j == states.size() - 1 ? rlUnselected : rlUnselectedSide);

                                double dist = size * (j - selectorSelectedHori);

                                tessellator.startDrawingQuads();
                                tessellator.setColorOpaque_F(1f,1f,1f);
                                tessellator.addVertexWithUV(width1 + dist, height1 + size, -90.0D + j, 0.0D, 1.0D);
                                tessellator.addVertexWithUV(width1 + dist + size, height1 + size, -90.0D + j, 1.0D, 1.0D);
                                tessellator.addVertexWithUV(width1 + dist + size, height1, -90.0D + j, 1.0D, 0.0D);
                                tessellator.addVertexWithUV(width1 + dist, height1, -90.0D + j, 0.0D, 0.0D);
                                tessellator.draw();

                                GL11.glPopMatrix();
                            }
                        }
                        else
                        {
                            mc.getTextureManager().bindTexture(rlUnselected);
                            tessellator.startDrawingQuads();
                            tessellator.setColorOpaque_F(1f,1f,1f);
                            tessellator.addVertexWithUV(width1, height1 + size, -90.0D, 0.0D, 1.0D);
                            tessellator.addVertexWithUV(width1 + size, height1 + size, -90.0D, 1.0D, 1.0D);
                            tessellator.addVertexWithUV(width1 + size, height1, -90.0D, 1.0D, 0.0D);
                            tessellator.addVertexWithUV(width1, height1, -90.0D, 0.0D, 0.0D);
                            tessellator.draw();
                        }

                        i++;
                    }

                    GL11.glDisable(GL11.GL_BLEND);

                    int height1 = gap;

                    GL11.glDepthMask(true);
                    GL11.glEnable(GL11.GL_DEPTH_TEST);
                    GL11.glEnable(GL11.GL_ALPHA_TEST);

                    gap += 36;

                    i = 0;

                    ite = playerMorphCatMap.entrySet().iterator();

                    while(ite.hasNext())
                    {
                        Entry<String, ArrayList<MorphState>> e = ite.next();

                        if(i > selectorSelected + maxShowable || i < selectorSelected - maxShowable)
                        {
                            i++;
                            continue;
                        }

                        height1 = gap + (int)size * (i - selectorSelected);

                        ArrayList<MorphState> states = e.getValue();

                        if(i == selectorSelected)
                        {
                            boolean newSlide = false;

                            if(progressV < 1.0F && selectorSelectedPrev != selectorSelected)
                            {
                                selectorSelectedHoriPrev = states.size() - 1;
                                selectorSelectedHori = 0;
                                newSlide = true;
                            }
                            if(!selectorShow)
                            {
                                selectorSelectedHori = states.size() - 1;
                                newSlide = true;
                            }

                            for(int j = 0; j < states.size(); j++)
                            {
                                MorphState state = states.get(j);
                                GL11.glPushMatrix();

                                GL11.glTranslated(newSlide && j == 0 ? 0.0D : ((selectorSelectedHori - selectorSelectedHoriPrev) * 42F) * (1.0F - progressH), 0.0D, 0.0D);

                                double dist = size * (j - selectorSelectedHori);

                                GL11.glTranslated(dist, 0.0D, 0.0D);

                                float entSize = state.entInstance.width > state.entInstance.height ? state.entInstance.width : state.entInstance.height;

                                float prog = j - selectorSelectedHori == 0 ? (!selectorShow ? scrollTimerHori - renderTick : (3F - scrollTimerHori + renderTick)) / 3F : 0.0F;
                                prog = MathHelper.clamp_float(prog, 0.0F, 1.0F);

                                float scaleMag = ((2.5F + (entSize - 2.5F) * prog) / entSize) ;

                                drawEntityOnScreen(state, state.entInstance, 20, height1, entSize > 2.5F ? 16F * scaleMag : 16F, 2, 2, renderTick, true, j == states.size() - 1);

                                GL11.glPopMatrix();
                            }
                        }
                        else
                        {
                            MorphState state = states.get(0);
                            float entSize = state.entInstance.width > state.entInstance.height ? state.entInstance.width : state.entInstance.height;

                            float prog = selectorSelected == i ? (!selectorShow ? scrollTimer - renderTick : (3F - scrollTimer + renderTick)) / 3F : 0.0F;
                            prog = MathHelper.clamp_float(prog, 0.0F, 1.0F);

                            float scaleMag = (2.5F / entSize) ;
                            drawEntityOnScreen(state, state.entInstance, 20, height1, entSize > 2.5F ? 16F * scaleMag : 16F, 2, 2, renderTick, selectorSelected == i, true);
                        }

                        GL11.glTranslatef(0.0F, 0.0F, 20F);
                        i++;
                    }

                    GL11.glPopMatrix();

                    if(selectorShow)
                    {
                        GL11.glEnable(3042 /*GL_BLEND*/);
                        GL11.glBlendFunc(770, 771);

                        gap -= 36;

                        height1 = gap;

                        mc.getTextureManager().bindTexture(rlSelected);
                        Tessellator tessellator = Tessellator.instance;
                        tessellator.startDrawingQuads();
                        tessellator.setColorOpaque_F(1f,1f,1f);
                        tessellator.addVertexWithUV(width1, height1 + size, -90.0D, 0.0D, 1.0D);
                        tessellator.addVertexWithUV(width1 + size, height1 + size, -90.0D, 1.0D, 1.0D);
                        tessellator.addVertexWithUV(width1 + size, height1, -90.0D, 1.0D, 0.0D);
                        tessellator.addVertexWithUV(width1, height1, -90.0D, 0.0D, 0.0D);
                        tessellator.draw();

                        GL11.glDisable(3042 /*GL_BLEND*/);
                    }
                    GL11.glPopMatrix();
                }

                //////////////////////

                if(radialShow && !mc.gameSettings.hideGUI)
                {
                    double mag = Math.sqrt(Morph.proxy.tickHandlerClient.radialDeltaX * Morph.proxy.tickHandlerClient.radialDeltaX + Morph.proxy.tickHandlerClient.radialDeltaY * Morph.proxy.tickHandlerClient.radialDeltaY);
                    double magAcceptance = 0.8D;

                    ScaledResolution reso = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);

                    float prog = (3F - radialTime + renderTick) / 3F;
                    if(prog > 1.0F)
                    {
                        prog = 1.0F;
                    }

                    float rad = (mag > magAcceptance ? 0.85F : 0.82F) * prog;

                    int radius = 80;
                    radius *= Math.pow(prog, 0.5D);

                    if(!mc.gameSettings.hideGUI)
                    {
                        GL11.glEnable(GL11.GL_BLEND);
                        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

                        GL11.glMatrixMode(GL11.GL_MODELVIEW);
                        GL11.glPushMatrix();
                        GL11.glLoadIdentity();

                        GL11.glMatrixMode(GL11.GL_PROJECTION);
                        GL11.glPushMatrix();
                        GL11.glLoadIdentity();

                        int NUM_PIZZA_SLICES = 100;

                        double zLev = 0.05D;

                        GL11.glDisable(GL11.GL_TEXTURE_2D);

                        final int stencilBit = MinecraftForgeClient.reserveStencilBit();

                        if(stencilBit >= 0)
                        {
                            GL11.glEnable(GL11.GL_STENCIL_TEST);
                            GL11.glDepthMask(false);
                            GL11.glColorMask(false, false, false, false);

                            final int stencilMask = 1 << stencilBit;

                            GL11.glStencilMask(stencilMask);
                            GL11.glStencilFunc(GL11.GL_ALWAYS, stencilMask, stencilMask);
                            GL11.glStencilOp(GL11.GL_KEEP, GL11.GL_KEEP, GL11.GL_REPLACE);
                            GL11.glClear(GL11.GL_STENCIL_BUFFER_BIT);

                            rad = (mag > magAcceptance ? 0.85F : 0.82F) * prog * (257F / (float)reso.getScaledHeight());

                            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

                            GL11.glBegin(GL11.GL_TRIANGLE_FAN);
                            GL11.glVertex3d(0, 0, zLev);
                            for(int i = 0; i <= NUM_PIZZA_SLICES; i++){ //NUM_PIZZA_SLICES decides how round the circle looks.
                                double angle = Math.PI * 2 * i / NUM_PIZZA_SLICES;
                                GL11.glVertex3d(Math.cos(angle) * reso.getScaledHeight_double() / reso.getScaledWidth_double() * rad, Math.sin(angle) * rad, zLev);
                            }
                            GL11.glEnd();

                            GL11.glStencilFunc(GL11.GL_ALWAYS, 0, stencilMask);

                            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

                            rad = 0.44F * prog * (257F / (float)reso.getScaledHeight());

                            GL11.glBegin(GL11.GL_TRIANGLE_FAN);
                            GL11.glVertex3d(0, 0, zLev);
                            for(int i = 0; i <= NUM_PIZZA_SLICES; i++){ //NUM_PIZZA_SLICES decides how round the circle looks.
                                double angle = Math.PI * 2 * i / NUM_PIZZA_SLICES;
                                GL11.glVertex3d(Math.cos(angle) * reso.getScaledHeight_double() / reso.getScaledWidth_double() * rad, Math.sin(angle) * rad, zLev);
                            }
                            GL11.glEnd();

                            GL11.glStencilMask(0x00);
                            GL11.glStencilFunc(GL11.GL_EQUAL, stencilMask, stencilMask);

                            GL11.glDepthMask(true);
                            GL11.glColorMask(true, true, true, true);
                        }

                        rad = (mag > magAcceptance ? 0.85F : 0.82F) * prog * (257F / (float)reso.getScaledHeight());

                        GL11.glColor4f(0.0F, 0.0F, 0.0F, mag > magAcceptance ? 0.6F : 0.4F);

                        GL11.glBegin(GL11.GL_TRIANGLE_FAN);
                        GL11.glVertex3d(0, 0, zLev);
                        for(int i = 0; i <= NUM_PIZZA_SLICES; i++){ //NUM_PIZZA_SLICES decides how round the circle looks.
                            double angle = Math.PI * 2 * i / NUM_PIZZA_SLICES;
                            GL11.glVertex3d(Math.cos(angle) * reso.getScaledHeight_double() / reso.getScaledWidth_double() * rad, Math.sin(angle) * rad, zLev);
                        }
                        GL11.glEnd();

                        if(stencilBit >= 0)
                        {
                            GL11.glDisable(GL11.GL_STENCIL_TEST);
                        }

                        MinecraftForgeClient.releaseStencilBit(stencilBit);

                        GL11.glEnable(GL11.GL_TEXTURE_2D);

                        GL11.glPopMatrix();

                        GL11.glMatrixMode(GL11.GL_MODELVIEW);

                        GL11.glPopMatrix();
                    }

                    GL11.glPushMatrix();

                    int showAb = Morph.config.getSessionInt("showAbilitiesInGui");

                    Morph.config.updateSession("showAbilitiesInGui", 0);

                    double radialAngle = -720F;
                    if(mag > magAcceptance)
                    {
                        //is on radial menu
                        double aSin = Math.toDegrees(Math.asin(Morph.proxy.tickHandlerClient.radialDeltaX));

                        if(Morph.proxy.tickHandlerClient.radialDeltaY >= 0 && Morph.proxy.tickHandlerClient.radialDeltaX >= 0)
                        {
                            radialAngle = aSin;
                        }
                        else if(Morph.proxy.tickHandlerClient.radialDeltaY < 0 && Morph.proxy.tickHandlerClient.radialDeltaX >= 0)
                        {
                            radialAngle = 90D + (90D - aSin);
                        }
                        else if(Morph.proxy.tickHandlerClient.radialDeltaY < 0 && Morph.proxy.tickHandlerClient.radialDeltaX < 0)
                        {
                            radialAngle = 180D - aSin;
                        }
                        else if(Morph.proxy.tickHandlerClient.radialDeltaY >= 0 && Morph.proxy.tickHandlerClient.radialDeltaX < 0)
                        {
                            radialAngle = 270D + (90D + aSin);
                        }
                    }

                    if(mag > 0.9999999D)
                    {
                        mag = Math.round(mag);
                    }

                    GL11.glDepthMask(true);
                    GL11.glEnable(GL11.GL_DEPTH_TEST);
                    GL11.glEnable(GL11.GL_ALPHA_TEST);

                    for(int i = 0; i < favouriteStates.size(); i++)
                    {
                        double angle = Math.PI * 2 * i / favouriteStates.size();

                        angle -= Math.toRadians(90D);

                        float leeway = 360F / favouriteStates.size();

                        boolean selected = false;

                        if(mag > magAcceptance * 0.75D && (i == 0 && (radialAngle < (leeway / 2) && radialAngle >= 0F || radialAngle > (360F) - (leeway / 2)) || i != 0 && radialAngle < (leeway * i) + (leeway / 2) && radialAngle > (leeway * i ) - (leeway / 2)))
                        {
                            selected = true;
                        }

                        favouriteStates.get(i).isFavourite = false;

                        float entSize = favouriteStates.get(i).entInstance.width > favouriteStates.get(i).entInstance.height ? favouriteStates.get(i).entInstance.width : favouriteStates.get(i).entInstance.height;

                        float scaleMag = entSize > 2.5F ? (float)((2.5F + (entSize - 2.5F) * (mag > magAcceptance && selected ? ((mag - magAcceptance) / (1.0F - magAcceptance)) : 0.0F)) / entSize) : 1.0F;

                        drawEntityOnScreen(favouriteStates.get(i), favouriteStates.get(i).entInstance, reso.getScaledWidth() / 2 + (int)(radius * Math.cos(angle)), (reso.getScaledHeight() + 32) / 2 + (int)(radius * Math.sin(angle)), 16 * prog * scaleMag + (float)(selected ? 6 * mag : 0), 2, 2, renderTick, selected, true);
                        favouriteStates.get(i).isFavourite = true;
                    }

                    Morph.config.updateSession("showAbilitiesInGui", showAb);

                    GL11.glPopMatrix();
                }


                //////////////////////

                BossStatus.healthScale = bossHealthScale;
                BossStatus.statusBarTime = bossStatusBarTime;
                BossStatus.bossName = bossName;
                BossStatus.hasColorModifier = hasColorModifier;

                GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
                for(Entry<String, MorphInfoClient> e : playerMorphInfo.entrySet())
                {
                    MorphInfoClient morphInfo = e.getValue();
                    for(Ability ability : morphInfo.morphAbilities)
                    {
                        if(ability.inactive)
                        {
                            continue;
View Full Code Here

Examples of morph.client.morph.MorphInfoClient

                selectorTimer--;
                if(selectorTimer == 0 && !selectorShow)
                {
                    selectorSelected = 0;

                    MorphInfoClient info = playerMorphInfo.get(mc.thePlayer.getCommandSenderName());
                    if(info != null)
                    {
                        MorphState state = info.nextState;
                        String entName = state.entInstance.getCommandSenderName();

                        int i = 0;

                        Iterator<Entry<String, ArrayList<MorphState>>> ite = playerMorphCatMap.entrySet().iterator();

                        while(ite.hasNext())
                        {
                            Entry<String, ArrayList<MorphState>> e = ite.next();
                            if(e.getKey().equalsIgnoreCase(entName))
                            {
                                selectorSelected = i;
                                ArrayList<MorphState> states = e.getValue();

                                for(int j = 0; j < states.size(); j++)
                                {
                                    if(states.get(j).identifier.equalsIgnoreCase(state.identifier))
                                    {
                                        selectorSelectedHori = j;
                                        break;
                                    }
                                }

                                break;
                            }
                            i++;
                        }

                    }
                }
            }
            if(scrollTimer > 0)
            {
                scrollTimer--;
            }
            if(scrollTimerHori > 0)
            {
                scrollTimerHori--;
            }
            if(radialTime > 0)
            {
                radialTime--;
            }

            if(clock != world.getWorldTime() || !world.getGameRules().getGameRuleBooleanValue("doDaylightCycle"))
            {
                clock = world.getWorldTime();

                for(Entry<String, MorphInfoClient> e : playerMorphInfo.entrySet())
                {
                    MorphInfoClient info = e.getValue();

                    if(info.getMorphing())
                    {
                        info.morphProgress++;
                        if(info.morphProgress > 80)
                        {
                            info.morphProgress = 80;
                            info.setMorphing(false);
                            if(info.player != null)
                            {
                                info.player.setSize(info.nextState.entInstance.width, info.nextState.entInstance.height);
                                info.player.setPosition(info.player.posX, info.player.posY, info.player.posZ);
                                info.player.eyeHeight = info.nextState.entInstance instanceof EntityPlayer ? ((EntityPlayer)info.nextState.entInstance).getCommandSenderName().equalsIgnoreCase(mc.thePlayer.getCommandSenderName()) || info.player == mc.thePlayer ? mc.thePlayer.getDefaultEyeHeight() : ((EntityPlayer)info.nextState.entInstance).getDefaultEyeHeight() : info.nextState.entInstance.getEyeHeight() - info.player.yOffset;

                                ArrayList<Ability> newAbilities = AbilityHandler.getEntityAbilities(info.nextState.entInstance.getClass());
                                ArrayList<Ability> oldAbilities = info.morphAbilities;
                                info.morphAbilities = new ArrayList<Ability>();
                                for(Ability ability : newAbilities)
                                {
                                    try
                                    {
                                        Ability clone = ability.clone();
                                        clone.setParent(info.player);
                                        info.morphAbilities.add(clone);
                                    }
                                    catch(Exception e1)
                                    {
                                    }
                                }
                                for(Ability ability : oldAbilities)
                                {
                                    if(ability.inactive)
                                    {
                                        continue;
                                    }
                                    boolean isRemoved = true;
                                    for(Ability newAbility : info.morphAbilities)
                                    {
                                        if(newAbility.getType().equalsIgnoreCase(ability.getType()))
                                        {
                                            isRemoved = false;
                                            break;
                                        }
                                    }
                                    if(isRemoved && ability.getParent() != null)
                                    {
                                        ability.kill();
                                    }
                                }
                            }
                        }
                        else if(info.prevState != null && info.player != null)
                        {
                            info.player.setSize(info.prevState.entInstance.width + (info.nextState.entInstance.width - info.prevState.entInstance.width) * ((float)info.morphProgress / 80F), info.prevState.entInstance.height + (info.nextState.entInstance.height - info.prevState.entInstance.height) * ((float)info.morphProgress / 80F));
                            info.player.setPosition(info.player.posX, info.player.posY, info.player.posZ);
                            float prevEyeHeight = info.prevState.entInstance instanceof EntityPlayer ? ((EntityPlayer)info.prevState.entInstance).getCommandSenderName().equalsIgnoreCase(mc.thePlayer.getCommandSenderName()) || info.player == mc.thePlayer ? mc.thePlayer.getDefaultEyeHeight() : ((EntityPlayer)info.prevState.entInstance).getDefaultEyeHeight() : info.prevState.entInstance.getEyeHeight() - info.player.yOffset;
                            float nextEyeHeight = info.nextState.entInstance instanceof EntityPlayer ? ((EntityPlayer)info.nextState.entInstance).getCommandSenderName().equalsIgnoreCase(mc.thePlayer.getCommandSenderName()) || info.player == mc.thePlayer ? mc.thePlayer.getDefaultEyeHeight() : ((EntityPlayer)info.nextState.entInstance).getDefaultEyeHeight() : info.nextState.entInstance.getEyeHeight() - info.player.yOffset;
                            info.player.eyeHeight = prevEyeHeight + (nextEyeHeight - prevEyeHeight) * ((float)info.morphProgress / 80F);
                        }
                    }
                    //TODO make sure that the lack of sleep timer doesn't affect anything.
                    //if(info.player != null && (info.player.dimension != mc.thePlayer.dimension || !info.player.isEntityAlive() || !world.playerEntities.contains(info.player) || !info.player.isPlayerSleeping() && info.player.sleepTimer > 0))
                    if(info.player != null && (info.player.dimension != mc.thePlayer.dimension || !info.player.isEntityAlive() || !world.playerEntities.contains(info.player) || (info.player.isPlayerSleeping() || info.player.getSleepTimer() > 0)))
                    {
                        info.player = null;
                    }
                    if(info.player == null)
                    {
                        info.player = world.getPlayerEntityByName(e.getKey());
                        if(info.player != null)
                        {
                            if(!info.getMorphing())
                            {
                                info.player.setSize(info.nextState.entInstance.width, info.nextState.entInstance.height);
                                info.player.setPosition(info.player.posX, info.player.posY, info.player.posZ);
                                info.player.eyeHeight = info.nextState.entInstance instanceof EntityPlayer ? ((EntityPlayer)info.nextState.entInstance).getCommandSenderName().equalsIgnoreCase(mc.thePlayer.getCommandSenderName()) || info.player == mc.thePlayer ? mc.thePlayer.getDefaultEyeHeight() : ((EntityPlayer)info.nextState.entInstance).getDefaultEyeHeight() : info.nextState.entInstance.getEyeHeight() - info.player.yOffset;

View Full Code Here

Examples of morph.client.morph.MorphInfoClient

            GL11.glTranslatef((float)posX, (float)posY, 50.0F);

            GL11.glEnable(GL11.GL_BLEND);
            GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

            MorphInfoClient info = playerMorphInfo.get(Minecraft.getMinecraft().thePlayer.getCommandSenderName());

            GL11.glTranslatef(0.0F, 0.0F, 100F);
            if(text)
            {
                if(radialShow)
View Full Code Here

Examples of morph.client.morph.MorphInfoClient

            if(mag > magAcceptance * 0.75D && (i == 0 && (radialAngle < (leeway / 2) && radialAngle >= 0F || radialAngle > (360F) - (leeway / 2)) || i != 0 && radialAngle < (leeway * i) + (leeway / 2) && radialAngle > (leeway * i ) - (leeway / 2)))
            {
                favouriteStates.get(i);

                MorphInfoClient info = playerMorphInfo.get(Minecraft.getMinecraft().thePlayer.getCommandSenderName());

                if(info != null && !info.nextState.identifier.equalsIgnoreCase(favouriteStates.get(i).identifier) || info == null && !favouriteStates.get(i).playerMorph.equalsIgnoreCase(Minecraft.getMinecraft().thePlayer.getCommandSenderName()))
                {
                    PacketHandler.sendToServer(Morph.channels, new PacketGuiInput(0, favouriteStates.get(i).identifier, false));
                    break;
View Full Code Here

Examples of morph.client.morph.MorphInfoClient

        }

        //          System.out.println(prevEnt);
        //          System.out.println(nextEnt);

        MorphInfoClient info = new MorphInfoClient(playerName, prevState, nextState);
        info.setMorphing(morphing);
        info.morphProgress = morphProgress;

        MorphInfoClient info1 = Morph.proxy.tickHandlerClient.playerMorphInfo.get(playerName);
        if(info1 != null)
        {
            info.morphAbilities = info1.morphAbilities;
            ArrayList<Ability> newAbilities = AbilityHandler.getEntityAbilities(info.nextState.entInstance.getClass());
            for(Ability ability : newAbilities)
View Full Code Here

Examples of morph.client.morph.MorphInfoClient

        if(ent instanceof EntityLivingBase && ent1 instanceof EntityLivingBase)
        {
            if(ent instanceof EntityPlayer)
            {
                EntityPlayer player1 = (EntityPlayer)ent;
                MorphInfoClient info = Morph.proxy.tickHandlerClient.playerMorphInfo.get(player1.getCommandSenderName());
                if(info != null)
                {
                    if(info.getMorphing())
                    {
                        ent = info.prevState.entInstance;
                    }
                    else
                    {
View Full Code Here

Examples of morph.client.morph.MorphInfoClient

            Minecraft mc = Minecraft.getMinecraft();
            if(Morph.proxy.tickHandlerClient.playerMorphInfo.containsKey(mc.thePlayer.getCommandSenderName()))
            {
                event.setCanceled(true);

                MorphInfoClient info = Morph.proxy.tickHandlerClient.playerMorphInfo.get(mc.thePlayer.getCommandSenderName());

                GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);

                if(info.morphProgress <= 40)
                {
                    if(info.prevModelInfo != null && info.morphProgress < 10)
                    {
                        RenderPlayer rend = (RenderPlayer)RenderManager.instance.getEntityRenderObject(mc.thePlayer);

                        ResourceLocation resourceLoc = ObfHelper.invokeGetEntityTexture(info.prevModelInfo.getRenderer(), info.prevModelInfo.getRenderer().getClass(), info.prevState.entInstance);

                        Morph.proxy.tickHandlerClient.renderHandInstance.progress = 1.0F;
                        Morph.proxy.tickHandlerClient.renderHandInstance.setParent(rend);
                        Morph.proxy.tickHandlerClient.renderHandInstance.resourceLoc = resourceLoc;
                        Morph.proxy.tickHandlerClient.renderHandInstance.replacement = info.prevModelInfo.assumedArm;
                        RenderManager.instance.entityRenderMap.put(mc.thePlayer.getClass(), Morph.proxy.tickHandlerClient.renderHandInstance);

                        mc.entityRenderer.renderHand(Morph.proxy.tickHandlerClient.renderTick, 0);

                        if(info.getMorphing())
                        {
                            float progress = ((float)info.morphProgress + Morph.proxy.tickHandlerClient.renderTick) / 10F;
                            Morph.proxy.tickHandlerClient.renderHandInstance.progress = progress;

                            String resourceDomain = resourceLoc.resourceDomain;
                            String resourcePath = resourceLoc.resourcePath;

                            ReflectionHelper.setPrivateValue(ResourceLocation.class, resourceLoc, "morph", ObfHelper.resourceDomain);
                            ReflectionHelper.setPrivateValue(ResourceLocation.class, resourceLoc, "textures/skin/morphskin.png", ObfHelper.resourcePath);

                            mc.entityRenderer.renderHand(Morph.proxy.tickHandlerClient.renderTick, 0);

                            ReflectionHelper.setPrivateValue(ResourceLocation.class, resourceLoc, resourceDomain, ObfHelper.resourceDomain);
                            ReflectionHelper.setPrivateValue(ResourceLocation.class, resourceLoc, resourcePath, ObfHelper.resourcePath);

                        }
                        RenderManager.instance.entityRenderMap.put(mc.thePlayer.getClass(), rend);
                    }
                }
                else
                {
                    if(info.nextModelInfo != null && info.morphProgress >= 70)
                    {
                        RenderPlayer rend = (RenderPlayer)RenderManager.instance.getEntityRenderObject(mc.thePlayer);

                        ResourceLocation resourceLoc = ObfHelper.invokeGetEntityTexture(info.nextModelInfo.getRenderer(), info.nextModelInfo.getRenderer().getClass(), info.nextState.entInstance);

                        Morph.proxy.tickHandlerClient.renderHandInstance.progress = 1.0F;
                        Morph.proxy.tickHandlerClient.renderHandInstance.setParent(rend);
                        Morph.proxy.tickHandlerClient.renderHandInstance.resourceLoc = resourceLoc;
                        Morph.proxy.tickHandlerClient.renderHandInstance.replacement = info.nextModelInfo.assumedArm;
                        RenderManager.instance.entityRenderMap.put(mc.thePlayer.getClass(), Morph.proxy.tickHandlerClient.renderHandInstance);

                        mc.entityRenderer.renderHand(Morph.proxy.tickHandlerClient.renderTick, 0);

                        if(info.getMorphing())
                        {
                            float progress = ((float)info.morphProgress - 70 + Morph.proxy.tickHandlerClient.renderTick) / 10F;

                            if(progress > 1.0F)
                            {
View Full Code Here

Examples of morph.client.morph.MorphInfoClient

        Morph.proxy.tickHandlerClient.renderingPlayer++;

        if(Morph.proxy.tickHandlerClient.playerMorphInfo.containsKey(event.entityPlayer.getCommandSenderName()))
        {
            MorphInfoClient info = Morph.proxy.tickHandlerClient.playerMorphInfo.get(event.entityPlayer.getCommandSenderName());
            if(!event.entityPlayer.isPlayerSleeping() && event.entityPlayer.worldObj.playerEntities.contains(event.entityPlayer))
            {
                info.player = event.entityPlayer;
            }

            double par2 = Morph.proxy.tickHandlerClient.renderTick;
            int br1 = info.prevState != null ? info.prevState.entInstance.getBrightnessForRender((float)par2) : event.entityPlayer.getBrightnessForRender((float)par2);
            int br2 = info.nextState.entInstance.getBrightnessForRender((float)par2);

            float prog = (float)(info.morphProgress + par2) / 80F;

            if(prog > 1.0F)
            {
                prog = 1.0F;
            }

            try
            {
                float prevShadowSize = Morph.proxy.tickHandlerClient.playerRenderShadowSize;

                if(info.prevState != null && info.prevState.entInstance != null)
                {
                    Render render = RenderManager.instance.getEntityRenderObject(info.prevState.entInstance);
                    if(render != null)
                    {
                        prevShadowSize = render.shadowSize;
                    }
                }

                Render render = RenderManager.instance.getEntityRenderObject(info.nextState.entInstance);
                if(render == event.renderer)
                {
                    shadowSize = Morph.proxy.tickHandlerClient.playerRenderShadowSize;
                }
                else if(render != null)
                {
                    shadowSize = render.shadowSize;
                }

                float shadowProg = prog;
                shadowProg /= 0.8F;
                if(shadowProg < 1.0F)
                {
                    shadowSize = prevShadowSize + (shadowSize - prevShadowSize) * prog;
                }
                render.shadowSize = shadowSize;
            }
            catch(Exception e)
            {
                ObfHelper.obfWarning();
                e.printStackTrace();
            }

            if(Morph.proxy.tickHandlerClient.renderingPlayer != 2)
            {
                event.setCanceled(true);
            }
            else
            {
                Morph.proxy.tickHandlerClient.renderingPlayer--;
                return;
            }

            double d0 = event.entityPlayer.lastTickPosX + (event.entityPlayer.posX - event.entityPlayer.lastTickPosX) * (double)par2;
            double d1 = event.entityPlayer.lastTickPosY + (event.entityPlayer.posY - event.entityPlayer.lastTickPosY) * (double)par2;
            double d2 = event.entityPlayer.lastTickPosZ + (event.entityPlayer.posZ - event.entityPlayer.lastTickPosZ) * (double)par2;
            float f1 = event.entityPlayer.prevRotationYaw + (event.entityPlayer.rotationYaw - event.entityPlayer.prevRotationYaw) * (float)par2;

            int i = br1 + (int)((float)(br2 - br1) * prog);

            if (event.entityPlayer.isBurning())
            {
                i = 15728880;
            }

            int j = i % 65536;
            int k = i / 65536;
            OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

            if(info != null)
            {
                Morph.proxy.tickHandlerClient.renderingMorph = true;
                GL11.glPushMatrix();

                //            ObfuscationReflectionHelper.setPrivateValue(RendererLivingEntity.class, info.prevEntInfo.entRender, info.prevEntModel, ObfHelper.mainModel);

                //            event.entityPlayer.yOffset -= Morph.proxy.tickHandlerClient.ySize;

                GL11.glTranslated(1 * (d0 - RenderManager.renderPosX), 1 * (d1 - RenderManager.renderPosY) + (event.entityPlayer == Minecraft.getMinecraft().thePlayer && !((Minecraft.getMinecraft().currentScreen instanceof GuiInventory || Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) && RenderManager.instance.playerViewY == 180.0F) ? Morph.proxy.tickHandlerClient.ySize : 0D), 1 * (d2 - RenderManager.renderPosZ));

                //            GL11.glScalef(1.0F, -1.0F, -1.0F);

                GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

                float renderTick = Morph.proxy.tickHandlerClient.renderTick;

                float prevEntSize = info.prevState.entInstance != null ? info.prevState.entInstance.width > info.prevState.entInstance.height ? info.prevState.entInstance.width : info.prevState.entInstance.height : 1.0F;
                float nextEntSize = info.nextState.entInstance != null ? info.nextState.entInstance.width > info.nextState.entInstance.height ? info.nextState.entInstance.width : info.nextState.entInstance.height : 1.0F;

                float prevScaleMag = prevEntSize > 2.5F ? (2.5F / prevEntSize) : 1.0F;
                float nextScaleMag = nextEntSize > 2.5F ? (2.5F / nextEntSize) : 1.0F;

                if(info.morphProgress <= 40)
                {
                    if(info.prevModelInfo != null && info.morphProgress < 10)
                    {
                        float ff2 = info.prevState.entInstance.renderYawOffset;
                        float ff3 = info.prevState.entInstance.rotationYaw;
                        float ff4 = info.prevState.entInstance.rotationPitch;
                        float ff5 = info.prevState.entInstance.prevRotationYawHead;
                        float ff6 = info.prevState.entInstance.rotationYawHead;

                        if((Minecraft.getMinecraft().currentScreen instanceof GuiInventory || Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) && RenderManager.instance.playerViewY == 180.0F)
                        {
                            GL11.glScalef(prevScaleMag, prevScaleMag, prevScaleMag);

                            EntityLivingBase renderView = Minecraft.getMinecraft().renderViewEntity;

                            info.prevState.entInstance.renderYawOffset = renderView.renderYawOffset;
                            info.prevState.entInstance.rotationYaw = renderView.rotationYaw;
                            info.prevState.entInstance.rotationPitch = renderView.rotationPitch;
                            info.prevState.entInstance.prevRotationYawHead = renderView.prevRotationYawHead;
                            info.prevState.entInstance.rotationYawHead = renderView.rotationYawHead;
                            renderTick = 1.0F;
                        }

                        info.prevModelInfo.forceRender(info.prevState.entInstance, 0.0D, 0.0D - event.entityPlayer.yOffset, 0.0D, f1, renderTick);

                        if(info.getMorphing())
                        {
                            float progress = ((float)info.morphProgress + Morph.proxy.tickHandlerClient.renderTick) / 10F;

                            GL11.glEnable(GL11.GL_BLEND);
                            GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

                            GL11.glColor4f(1.0F, 1.0F, 1.0F, progress);

                            ResourceLocation resourceLoc = ObfHelper.invokeGetEntityTexture(info.prevModelInfo.getRenderer(), info.prevModelInfo.getRenderer().getClass(), info.prevState.entInstance);
                            String resourceDomain = ReflectionHelper.getPrivateValue(ResourceLocation.class, resourceLoc, ObfHelper.resourceDomain);
                            String resourcePath = ReflectionHelper.getPrivateValue(ResourceLocation.class, resourceLoc, ObfHelper.resourcePath);

                            ReflectionHelper.setPrivateValue(ResourceLocation.class, resourceLoc, "morph", ObfHelper.resourceDomain);
                            ReflectionHelper.setPrivateValue(ResourceLocation.class, resourceLoc, "textures/skin/morphskin.png", ObfHelper.resourcePath);

                            info.prevModelInfo.forceRender(info.prevState.entInstance, 0.0D, 0.0D - event.entityPlayer.yOffset, 0.0D, f1, renderTick);

                            ReflectionHelper.setPrivateValue(ResourceLocation.class, resourceLoc, resourceDomain, ObfHelper.resourceDomain);
                            ReflectionHelper.setPrivateValue(ResourceLocation.class, resourceLoc, resourcePath, ObfHelper.resourcePath);

                            GL11.glDisable(GL11.GL_BLEND);
                            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
                        }

                        info.prevState.entInstance.renderYawOffset = ff2;
                        info.prevState.entInstance.rotationYaw = ff3;
                        info.prevState.entInstance.rotationPitch = ff4;
                        info.prevState.entInstance.prevRotationYawHead = ff5;
                        info.prevState.entInstance.rotationYawHead = ff6;
                    }
                }
                else
                {
                    if(info.nextModelInfo != null && info.morphProgress >= 70)
                    {
                        float ff2 = info.nextState.entInstance.renderYawOffset;
                        float ff3 = info.nextState.entInstance.rotationYaw;
                        float ff4 = info.nextState.entInstance.rotationPitch;
                        float ff5 = info.nextState.entInstance.prevRotationYawHead;
                        float ff6 = info.nextState.entInstance.rotationYawHead;

                        if((Minecraft.getMinecraft().currentScreen instanceof GuiInventory || Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) && RenderManager.instance.playerViewY == 180.0F)
                        {
                            GL11.glScalef(nextScaleMag, nextScaleMag, nextScaleMag);

                            EntityLivingBase renderView = Minecraft.getMinecraft().renderViewEntity;

                            info.nextState.entInstance.prevRenderYawOffset = info.nextState.entInstance.renderYawOffset = renderView.renderYawOffset;
                            info.nextState.entInstance.rotationYaw = renderView.rotationYaw;
                            info.nextState.entInstance.rotationPitch = renderView.rotationPitch;
                            info.nextState.entInstance.prevRotationYawHead = renderView.prevRotationYawHead;
                            info.nextState.entInstance.rotationYawHead = renderView.rotationYawHead;
                            renderTick = 1.0F;
                        }

                        info.nextModelInfo.forceRender(info.nextState.entInstance, 0.0D, 0.0D - event.entityPlayer.yOffset, 0.0D, f1, renderTick);

                        if(info.getMorphing())
                        {
                            float progress = ((float)info.morphProgress - 70 + Morph.proxy.tickHandlerClient.renderTick) / 10F;

                            GL11.glEnable(GL11.GL_BLEND);
                            GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
View Full Code Here

Examples of morph.client.morph.MorphInfoClient

                    Morph.proxy.tickHandlerClient.scrollTimerHori = Morph.proxy.tickHandlerClient.scrollTime;

                    Morph.proxy.tickHandlerClient.selectorSelected = 0;
                    Morph.proxy.tickHandlerClient.selectorSelectedHori = 0;

                    MorphInfoClient info = Morph.proxy.tickHandlerClient.playerMorphInfo.get(mc.thePlayer.getCommandSenderName());
                    if(info != null)
                    {
                        MorphState state = info.nextState;

                        String entName = state.entInstance.getCommandSenderName();

                        int i = 0;

                        Iterator<Entry<String, ArrayList<MorphState>>> ite = Morph.proxy.tickHandlerClient.playerMorphCatMap.entrySet().iterator();

                        while(ite.hasNext())
                        {
                            Entry<String, ArrayList<MorphState>> e = ite.next();
                            if(e.getKey().equalsIgnoreCase(entName))
                            {
                                Morph.proxy.tickHandlerClient.selectorSelected = i;
                                ArrayList<MorphState> states = e.getValue();

                                for(int j = 0; j < states.size(); j++)
                                {
                                    if(states.get(j).identifier.equalsIgnoreCase(state.identifier))
                                    {
                                        Morph.proxy.tickHandlerClient.selectorSelectedHori = j;
                                        break;
                                    }
                                }

                                break;
                            }
                            i++;
                        }
                    }
                }
                else
                {
                    Morph.proxy.tickHandlerClient.selectorSelectedHori = 0;
                    Morph.proxy.tickHandlerClient.selectorSelectedPrev = Morph.proxy.tickHandlerClient.selectorSelected;
                    Morph.proxy.tickHandlerClient.scrollTimerHori = Morph.proxy.tickHandlerClient.scrollTimer = Morph.proxy.tickHandlerClient.scrollTime;

                    if(event.keyBind.equals(Morph.config.getKeyBind("keySelectorUp")))
                    {
                        Morph.proxy.tickHandlerClient.selectorSelected--;
                        if(Morph.proxy.tickHandlerClient.selectorSelected < 0)
                        {
                            Morph.proxy.tickHandlerClient.selectorSelected = Morph.proxy.tickHandlerClient.playerMorphCatMap.size() - 1;
                        }
                    }
                    else
                    {
                        Morph.proxy.tickHandlerClient.selectorSelected++;
                        if(Morph.proxy.tickHandlerClient.selectorSelected > Morph.proxy.tickHandlerClient.playerMorphCatMap.size() - 1)
                        {
                            Morph.proxy.tickHandlerClient.selectorSelected = 0;
                        }
                    }
                }
            }
            else if(event.keyBind.equals(Morph.config.getKeyBind("keySelectorLeft")) || event.keyBind.equals(Morph.config.getKeyBind("keySelectorRight")))
            {
                Morph.proxy.tickHandlerClient.abilityScroll = 0;
                if(!Morph.proxy.tickHandlerClient.selectorShow && mc.currentScreen == null)
                {
                    Morph.proxy.tickHandlerClient.selectorShow = true;
                    Morph.proxy.tickHandlerClient.selectorTimer = Morph.proxy.tickHandlerClient.selectorShowTime - Morph.proxy.tickHandlerClient.selectorTimer;
                    Morph.proxy.tickHandlerClient.scrollTimerHori = Morph.proxy.tickHandlerClient.scrollTime;

                    Morph.proxy.tickHandlerClient.selectorSelected = 0;
                    Morph.proxy.tickHandlerClient.selectorSelectedHori = 0;

                    MorphInfoClient info = Morph.proxy.tickHandlerClient.playerMorphInfo.get(mc.thePlayer.getCommandSenderName());
                    if(info != null)
                    {
                        MorphState state = info.nextState;

                        String entName = state.entInstance.getCommandSenderName();

                        int i = 0;

                        Iterator<Entry<String, ArrayList<MorphState>>> ite = Morph.proxy.tickHandlerClient.playerMorphCatMap.entrySet().iterator();

                        while(ite.hasNext())
                        {
                            Entry<String, ArrayList<MorphState>> e = ite.next();
                            if(e.getKey().equalsIgnoreCase(entName))
                            {
                                Morph.proxy.tickHandlerClient.selectorSelected = i;
                                ArrayList<MorphState> states = e.getValue();

                                for(int j = 0; j < states.size(); j++)
                                {
                                    if(states.get(j).identifier.equalsIgnoreCase(state.identifier))
                                    {
                                        Morph.proxy.tickHandlerClient.selectorSelectedHori = j;
                                        break;
                                    }
                                }

                                break;
                            }
                            i++;
                        }
                    }
                }
                else
                {
                    Morph.proxy.tickHandlerClient.selectorSelectedHoriPrev = Morph.proxy.tickHandlerClient.selectorSelectedHori;
                    Morph.proxy.tickHandlerClient.scrollTimerHori = Morph.proxy.tickHandlerClient.scrollTime;

                    if(event.keyBind.equals(Morph.config.getKeyBind("keySelectorLeft")))
                    {
                        Morph.proxy.tickHandlerClient.selectorSelectedHori--;
                    }
                    else
                    {
                        Morph.proxy.tickHandlerClient.selectorSelectedHori++;
                    }
                }
            }
            else if(event.keyBind.equals(Morph.config.getKeyBind("keySelectorSelect")) || (event.keyBind.keyIndex == mc.gameSettings.keyBindAttack.getKeyCode() && event.keyBind.isMinecraftBind()))
            {
                if(Morph.proxy.tickHandlerClient.selectorShow)
                {
                    Morph.proxy.tickHandlerClient.selectorShow = false;
                    Morph.proxy.tickHandlerClient.selectorTimer = Morph.proxy.tickHandlerClient.selectorShowTime - Morph.proxy.tickHandlerClient.selectorTimer;
                    Morph.proxy.tickHandlerClient.scrollTimerHori = Morph.proxy.tickHandlerClient.scrollTime;

                    MorphInfoClient info = Morph.proxy.tickHandlerClient.playerMorphInfo.get(Minecraft.getMinecraft().thePlayer.getCommandSenderName());

                    MorphState selectedState = null;

                    int i = 0;

                    Iterator<Entry<String, ArrayList<MorphState>>> ite = Morph.proxy.tickHandlerClient.playerMorphCatMap.entrySet().iterator();

                    while(ite.hasNext())
                    {
                        Entry<String, ArrayList<MorphState>> e = ite.next();
                        if(i == Morph.proxy.tickHandlerClient.selectorSelected)
                        {
                            ArrayList<MorphState> states = e.getValue();

                            for(int j = 0; j < states.size(); j++)
                            {
                                if(j == Morph.proxy.tickHandlerClient.selectorSelectedHori)
                                {
                                    selectedState = states.get(j);
                                    break;
                                }
                            }

                            break;
                        }
                        i++;
                    }

                    if(selectedState != null && (info != null && !info.nextState.identifier.equalsIgnoreCase(selectedState.identifier) || info == null && !selectedState.playerMorph.equalsIgnoreCase(mc.thePlayer.getCommandSenderName())))
                    {
                        PacketHandler.sendToServer(Morph.channels, new PacketGuiInput(0, selectedState.identifier, false));
                    }

                }
                else if(Morph.proxy.tickHandlerClient.radialShow)
                {
                    Morph.proxy.tickHandlerClient.selectRadialMenu();
                    Morph.proxy.tickHandlerClient.radialShow = false;
                }
            }
            else if(event.keyBind.equals(Morph.config.getKeyBind("keySelectorCancel")) || (event.keyBind.keyIndex == mc.gameSettings.keyBindUseItem.getKeyCode() && event.keyBind.isMinecraftBind()))
            {
                if(Morph.proxy.tickHandlerClient.selectorShow)
                {
                    if(mc.currentScreen instanceof GuiIngameMenu)
                    {
                        mc.displayGuiScreen(null);
                    }
                    Morph.proxy.tickHandlerClient.selectorShow = false;
                    Morph.proxy.tickHandlerClient.selectorTimer = Morph.proxy.tickHandlerClient.selectorShowTime - Morph.proxy.tickHandlerClient.selectorTimer;
                    Morph.proxy.tickHandlerClient.scrollTimerHori = Morph.proxy.tickHandlerClient.scrollTime;
                }
                if(Morph.proxy.tickHandlerClient.radialShow)
                {
                    Morph.proxy.tickHandlerClient.radialShow = false;
                }
            }
            else if(event.keyBind.equals(Morph.config.getKeyBind("keySelectorRemoveMorph")) || event.keyBind.keyIndex == Keyboard.KEY_DELETE)
            {
                if(Morph.proxy.tickHandlerClient.selectorShow)
                {
                    MorphInfoClient info = Morph.proxy.tickHandlerClient.playerMorphInfo.get(Minecraft.getMinecraft().thePlayer.getCommandSenderName());

                    MorphState selectedState = null;

                    int i = 0;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.