Package morph.api

Examples of morph.api.Ability


                                        try
                                        {
                                            Class abilityClass = AbilityHandler.stringToClassMap.get(ability);
                                            if(abilityClass != null)
                                            {
                                                Ability ab = ((Ability)abilityClass.getConstructor().newInstance());
                                                try
                                                {
                                                    ab.parse(argVars.toArray(new String[0]));
                                                }
                                                catch(Exception e2)
                                                {
                                                    Morph.console("Mappings are erroring! These mappings are probably invalid or outdated: "  + abilityClass.getName() + ", "+ ability + ", args: " + args, true);
                                                }
                                                abilityObjs.add(ab);
                                            }
                                            else
                                            {
                                                Morph.console("Ability \"" + ability + "\" does not exist for: "  + e.getKey() + ", args: " + args, true);
                                            }
                                        }
                                        catch(Exception e2)
                                        {
                                            e2.printStackTrace();
                                        }
                                    }
                                    if(!ability.isEmpty() && !hasArgs)
                                    {
                                        Class abilityClass = AbilityHandler.stringToClassMap.get(ability);
                                        if(abilityClass != null)
                                        {
                                            try
                                            {
                                                abilityObjs.add((Ability)abilityClass.getConstructor().newInstance());
                                            }
                                            catch(Exception e2)
                                            {
                                                e2.printStackTrace();
                                            }
                                        }
                                        else
                                        {
                                            Morph.console("Ability \"" + ability + "\" does not exist for: "  + e.getKey(), true);
                                        }
                                    }
                                }
                            }
                            if(abilityObjs.size() > 0){
                                Class<? extends EntityLivingBase> entityClass = (Class<? extends EntityLivingBase>) Class.forName(e.getKey());
                                if(entityClass != null){
                                    if(AbilityHandler.abilityMap.containsKey(entityClass))
                                    {
                                        Morph.console("Ignoring ability mapping for " + e.getKey() + "! Already has abilities mapped!", true);
                                    }
                                    else
                                    {
                                        if(entityClass.getName().startsWith("net.minecraft"))
                                        {
                                            mcMappings++;
                                        }
                                        else
                                        {
                                            StringBuilder sb = new StringBuilder();
                                            sb.append("Adding ability mappings ");
                                            for(int i = 0; i < abilityObjs.size(); i++)
                                            {
                                                Ability a = abilityObjs.get(i);
                                                sb.append(a.getType());
                                                if(i != abilityObjs.size() - 1)
                                                {
                                                    sb.append(", ");
                                                }
                                            }
View Full Code Here


                                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)
                                    {
                                    }
View Full Code Here

                int offsetX = 0;
                int offsetY = 0;
                int renders = 0;
                for(int i = 0; i < (abilitiesSize > 3 && stencilBit >= 0 && abilities.size() > 3 ? abilities.size() * 2 : abilities.size()); i++)
                {
                    Ability ability = abilities.get(i >= abilities.size() ? i - abilities.size() : i);

                    if(!ability.entityHasAbility(ent) || (ability.getIcon() == null && !(ability instanceof AbilityPotionEffect)) || ability instanceof AbilityPotionEffect && Potion.potionTypes[((AbilityPotionEffect)ability).potionId] != null && !Potion.potionTypes[((AbilityPotionEffect)ability).potionId].hasStatusIcon() || (abilitiesSize > 3 && stencilBit >= 0 && abilities.size() > 3) && !shouldScroll && renders >= 3)
                    {
                        continue;
                    }

                    ResourceLocation loc = ability.getIcon();
                    if(loc != null || ability instanceof AbilityPotionEffect)
                    {
                        double pX = -20.5D;
                        double pY = -33.5D;
                        double size = 12D;
View Full Code Here

            {
                if(ability.requiresInactiveClone())
                {
                    try
                    {
                        Ability clone = ability.clone();
                        clone.inactive = true;
                        info.morphAbilities.add(clone);
                    }
                    catch(Exception e1)
                    {
                    }
                }
            }
        }
        else
        {
            ArrayList<Ability> newAbilities = AbilityHandler.getEntityAbilities(info.nextState.entInstance.getClass());
            info.morphAbilities = new ArrayList<Ability>();
            for(Ability ability : newAbilities)
            {
                try
                {
                    Ability clone = ability.clone();
                    info.morphAbilities.add(clone);
                }
                catch(Exception e1)
                {
                }
View Full Code Here

                registerAbility(ability.getType(), ability.getClass());
                Morph.console("Ability type \"" + ability.getType() + "\" is not registered! Registering.", true);
            }
            for(int i = 0; i < abilityList.size(); i++)
            {
                Ability ab = abilityList.get(i);
                if(ab.getType().equals(ability.getType()))
                {
                    abilityList.remove(i);
                    abilityList.add(i, ability);
                    added = true;
                }
View Full Code Here

        ArrayList<Ability> abilityList = abilityMap.get(entClass);
        if(abilityList != null)
        {
            for(int i = abilityList.size() - 1; i >= 0; i--)
            {
                Ability ability = abilityList.get(i);
                if(ability.getType().equalsIgnoreCase(type))
                {
                    abilityList.remove(i);
                }
            }
        }
View Full Code Here

            else
            {
                String[] disabledAbilities = Morph.config.getSessionString("disabledAbilities").split(",");
                for(int i = abilities.size() - 1; i >= 0 ; i--)
                {
                    Ability ab = abilities.get(i);
                    for(String s : disabledAbilities)
                    {
                        if(!s.isEmpty() && ab.getType().equals(s))
                        {
                            abilities.remove(i);
                            break;
                        }
                    }
View Full Code Here

        try
        {
            Class abilityClass = AbilityHandler.stringToClassMap.get(type);
            if(abilityClass != null)
            {
                Ability ab = ((Ability)abilityClass.getConstructor().newInstance());
                try
                {
                    ab.parse(arguments);
                }
                catch(Exception e2)
                {
                    Morph.console("Arguments are erroring when trying to create ability by type: "  + abilityClass.getName() + ", "+ type + ", args: " + arguments == null ? "none" : "arg list of size " + arguments.length, true);
                    e2.printStackTrace();
View Full Code Here

                            {
                                if(ability.requiresInactiveClone())
                                {
                                    try
                                    {
                                        Ability clone = ability.clone();
                                        clone.inactive = true;
                                        info.morphAbilities.add(clone);
                                    }
                                    catch(Exception e1)
                                    {
View Full Code Here

                            info.morphAbilities = new ArrayList<Ability>();
                            for(Ability ability : newAbilities)
                            {
                                try
                                {
                                    Ability clone = ability.clone();
                                    clone.setParent(player);
                                    info.morphAbilities.add(clone);
                                }
                                catch(Exception e1)
                                {
                                }
View Full Code Here

TOP

Related Classes of morph.api.Ability

Copyright © 2018 www.massapicom. 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.