Examples of MorphState


Examples of morph.common.morph.MorphState

            if(state.playerName.equalsIgnoreCase(state.playerMorph))
            {
                return state;
            }
        }
        return new MorphState(world, player.getCommandSenderName(), player.getCommandSenderName(), null, world.isRemote);
    }
View Full Code Here

Examples of morph.common.morph.MorphState

        ArrayList<MorphState> list = playerMorphs.get(name);
        if(list == null)
        {
            list = new ArrayList<MorphState>();
            playerMorphs.put(name, list);
            list.add(0, new MorphState(world, name, name, null, world.isRemote));
        }
        boolean found = false;
        for(MorphState state : list)
        {
            if(state.playerMorph.equals(name))
            {
                found = true;
                break;
            }
        }
        if(!found)
        {
            list.add(0, new MorphState(world, name, name, null, world.isRemote));
        }

        saveList.put(player, list);

        return list;
View Full Code Here

Examples of morph.common.morph.MorphState

                    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;

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

                    boolean multiple = false;
                    boolean decrease = false;

                    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);
                                    if(j == states.size() - 1)
                                    {
                                        decrease = true;
                                    }
                                    break;
                                }
                            }

                            if(states.size() > 1)
                            {
                                multiple = true;
                            }

                            break;
                        }
                        i++;
                    }

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

                        if(!multiple)
                        {
                            Morph.proxy.tickHandlerClient.selectorSelected--;
                            if(Morph.proxy.tickHandlerClient.selectorSelected < 0)
                            {
                                Morph.proxy.tickHandlerClient.selectorSelected = Morph.proxy.tickHandlerClient.playerMorphCatMap.size() - 1;
                            }
                        }
                        else if(decrease)
                        {
                            Morph.proxy.tickHandlerClient.selectorSelectedHori--;
                            if(Morph.proxy.tickHandlerClient.selectorSelected < 0)
                            {
                                Morph.proxy.tickHandlerClient.selectorSelected = 0;
                            }
                        }
                    }
                }
            }
            else if(event.keyBind.equals(Morph.config.getKeyBind("keyFavourite")))
            {
                if(Morph.proxy.tickHandlerClient.selectorShow)
                {
                    MorphState selectedState = null;

                    int i = 0;

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

Examples of morph.common.morph.MorphState

            {
                EntityPlayerMP player = (EntityPlayerMP)event.entityLiving;

                MorphInfo info = Morph.proxy.tickHandlerServer.getPlayerMorphInfo(player);

                MorphState state = Morph.proxy.tickHandlerServer.getSelfState(player.worldObj, player);

                if(Morph.config.getInt("loseMorphsOnDeath") == 1)
                {
                    Morph.proxy.tickHandlerServer.removeAllPlayerMorphsExcludingCurrentMorph(player);
                }
View Full Code Here

Examples of morph.common.morph.MorphState

        ArrayList list = Morph.proxy.tickHandlerServer.getPlayerMorphs(event.player.worldObj, event.player);

        NBTTagCompound tag = Morph.proxy.tickHandlerServer.getMorphDataFromPlayer(event.player);

        MorphHandler.addOrGetMorphState(list, new MorphState(event.player.worldObj, event.player.getCommandSenderName(), event.player.getCommandSenderName(), null, event.player.worldObj.isRemote));

        int count = tag.getInteger("morphStatesCount");
        for(int i = 0; i < count; i++)
        {
            MorphState state = new MorphState(event.player.worldObj, event.player.getCommandSenderName(), event.player.getCommandSenderName(), null, false);
            state.readTag(event.player.worldObj, tag.getCompoundTag("morphState" + i));
            if(!state.identifier.equalsIgnoreCase(""))
            {
                MorphHandler.addOrGetMorphState(list, state);
            }
        }
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.