Java 类cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker 实例源码

项目:LegacyJavaFixer    文件:LegacyJavaFixer.java   
public LegacyJavaFixer()
{
    @SuppressWarnings("unchecked")
    ListIterator<ITweaker> itr = ((List<ITweaker>)Launch.blackboard.get("Tweaks")).listIterator();
    ITweaker replacement = new SortReplacement();
    while (itr.hasNext())
    {
        ITweaker t = itr.next();
        FMLRelaunchLog.log.info("[LegacyJavaFixer] Tweaker: " + t);
        if (t instanceof FMLInjectionAndSortingTweaker)
        {
            itr.set(replacement);
            FMLRelaunchLog.info("[LegacyJavaFixer] Replacing tweaker %s with %s", t, replacement);
        }
    }
}
项目:LegacyJavaFixer    文件:LegacyJavaFixer.java   
@Override
public void injectIntoClassLoader(LaunchClassLoader classLoader)
{
    if (!hasRun)
    {
        FMLRelaunchLog.log.info("[LegacyJavaFixer] Replacing sort");
        sort();
        URL is = FMLInjectionAndSortingTweaker.class.getResource("/cpw/mods/fml/common/launcher/TerminalTweaker.class");
        if (is != null)
        {
            FMLRelaunchLog.log.info("[LegacyJavaFixer] Detected TerminalTweaker");
            @SuppressWarnings("unchecked")
            List<String> newTweaks = (List<String>) Launch.blackboard.get("TweakClasses");
            newTweaks.add("cpw.mods.fml.common.launcher.TerminalTweaker");
        }
    }
    hasRun = true;
}
项目:TRHS_Club_Mod_2016    文件:CoreModManager.java   
public static void injectCoreModTweaks(FMLInjectionAndSortingTweaker fmlInjectionAndSortingTweaker)
{
    @SuppressWarnings("unchecked")
    List<ITweaker> tweakers = (List<ITweaker>) Launch.blackboard.get("Tweaks");
    // Add the sorting tweaker first- it'll appear twice in the list
    tweakers.add(0, fmlInjectionAndSortingTweaker);
    for (FMLPluginWrapper wrapper : loadPlugins)
    {
        tweakers.add(wrapper);
    }
}
项目:CauldronGit    文件:CoreModManager.java   
public static void injectCoreModTweaks(FMLInjectionAndSortingTweaker fmlInjectionAndSortingTweaker)
{
    @SuppressWarnings("unchecked")
    List<ITweaker> tweakers = (List<ITweaker>) Launch.blackboard.get("Tweaks");
    // Add the sorting tweaker first- it'll appear twice in the list
    tweakers.add(0, fmlInjectionAndSortingTweaker);
    for (FMLPluginWrapper wrapper : loadPlugins)
    {
        tweakers.add(wrapper);
    }
}
项目:Cauldron    文件:CoreModManager.java   
public static void injectCoreModTweaks(FMLInjectionAndSortingTweaker fmlInjectionAndSortingTweaker)
{
    @SuppressWarnings("unchecked")
    List<ITweaker> tweakers = (List<ITweaker>) Launch.blackboard.get("Tweaks");
    // Add the sorting tweaker first- it'll appear twice in the list
    tweakers.add(0, fmlInjectionAndSortingTweaker);
    for (FMLPluginWrapper wrapper : loadPlugins)
    {
        tweakers.add(wrapper);
    }
}
项目:Cauldron    文件:CoreModManager.java   
public static void injectCoreModTweaks(FMLInjectionAndSortingTweaker fmlInjectionAndSortingTweaker)
{
    @SuppressWarnings("unchecked")
    List<ITweaker> tweakers = (List<ITweaker>) Launch.blackboard.get("Tweaks");
    // Add the sorting tweaker first- it'll appear twice in the list
    tweakers.add(0, fmlInjectionAndSortingTweaker);
    for (FMLPluginWrapper wrapper : loadPlugins)
    {
        tweakers.add(wrapper);
    }
}
项目:Cauldron    文件:CoreModManager.java   
public static void injectCoreModTweaks(FMLInjectionAndSortingTweaker fmlInjectionAndSortingTweaker)
{
    @SuppressWarnings("unchecked")
    List<ITweaker> tweakers = (List<ITweaker>) Launch.blackboard.get("Tweaks");
    // Add the sorting tweaker first- it'll appear twice in the list
    tweakers.add(0, fmlInjectionAndSortingTweaker);
    for (FMLPluginWrapper wrapper : loadPlugins)
    {
        tweakers.add(wrapper);
    }
}
项目:RuneCraftery    文件:CoreModManager.java   
public static void injectCoreModTweaks(FMLInjectionAndSortingTweaker fmlInjectionAndSortingTweaker)
{
    List<ITweaker> tweakers = (List<ITweaker>) Launch.blackboard.get("Tweaks");
    // Add the sorting tweaker first- it'll appear twice in the list
    tweakers.add(0, fmlInjectionAndSortingTweaker);
    for (FMLPluginWrapper wrapper : loadPlugins)
    {
        tweakers.add(wrapper);
    }
}
项目:RuneCraftery    文件:CoreModManager.java   
public static void injectCoreModTweaks(FMLInjectionAndSortingTweaker fmlInjectionAndSortingTweaker)
{
    List<ITweaker> tweakers = (List<ITweaker>) Launch.blackboard.get("Tweaks");
    // Add the sorting tweaker first- it'll appear twice in the list
    tweakers.add(0, fmlInjectionAndSortingTweaker);
    for (FMLPluginWrapper wrapper : loadPlugins)
    {
        tweakers.add(wrapper);
    }
}
项目:BetterNutritionMod    文件:CoreModManager.java   
public static void injectCoreModTweaks(FMLInjectionAndSortingTweaker fmlInjectionAndSortingTweaker)
{
    List<ITweaker> tweakers = (List<ITweaker>) Launch.blackboard.get("Tweaks");
    // Add the sorting tweaker first- it'll appear twice in the list
    tweakers.add(0, fmlInjectionAndSortingTweaker);
    for (FMLPluginWrapper wrapper : loadPlugins)
    {
        tweakers.add(wrapper);
    }
}
项目:TRHS_Club_Mod_2016    文件:CoreModManager.java   
public static void sortTweakList()
{
    @SuppressWarnings("unchecked")
    List<ITweaker> tweakers = (List<ITweaker>) Launch.blackboard.get("Tweaks");
    // Basically a copy of Collections.sort pre 8u20, optimized as we know we're an array list.
    // Thanks unhelpful fixer of http://bugs.java.com/view_bug.do?bug_id=8032636
    ITweaker[] toSort = tweakers.toArray(new ITweaker[tweakers.size()]);
    Arrays.sort(toSort, new Comparator<ITweaker>() {
        @Override
        public int compare(ITweaker o1, ITweaker o2)
        {
            Integer first = null;
            Integer second = null;
            if (o1 instanceof FMLInjectionAndSortingTweaker)
            {
                first = Integer.MIN_VALUE;
            }
            if (o2 instanceof FMLInjectionAndSortingTweaker)
            {
                second = Integer.MIN_VALUE;
            }

            if (o1 instanceof FMLPluginWrapper)
            {
                first = ((FMLPluginWrapper) o1).sortIndex;
            }
            else if (first == null)
            {
                first = tweakSorting.get(o1.getClass().getName());
            }
            if (o2 instanceof FMLPluginWrapper)
            {
                second = ((FMLPluginWrapper) o2).sortIndex;
            }
            else if (second == null)
            {
                second = tweakSorting.get(o2.getClass().getName());
            }
            if (first == null)
            {
                first = 0;
            }
            if (second == null)
            {
                second = 0;
            }

            return Ints.saturatedCast((long)first - (long)second);
        }
    });
    // Basically a copy of Collections.sort, optimized as we know we're an array list.
    // Thanks unhelpful fixer of http://bugs.java.com/view_bug.do?bug_id=8032636
    for (int j = 0; j < toSort.length; j++) {
        tweakers.set(j, toSort[j]);
    }
}
项目:CauldronGit    文件:CoreModManager.java   
public static void sortTweakList()
{
    @SuppressWarnings("unchecked")
    List<ITweaker> tweakers = (List<ITweaker>) Launch.blackboard.get("Tweaks");
    Collections.sort(tweakers, new Comparator<ITweaker>() {
        @Override
        public int compare(ITweaker o1, ITweaker o2)
        {
            Integer first = null;
            Integer second = null;
            if (o1 instanceof FMLInjectionAndSortingTweaker)
            {
                first = Integer.MIN_VALUE;
            }
            if (o2 instanceof FMLInjectionAndSortingTweaker)
            {
                second = Integer.MIN_VALUE;
            }

            if (o1 instanceof FMLPluginWrapper)
            {
                first = ((FMLPluginWrapper) o1).sortIndex;
            }
            else if (first == null)
            {
                first = tweakSorting.get(o1.getClass().getName());
            }
            if (o2 instanceof FMLPluginWrapper)
            {
                second = ((FMLPluginWrapper) o2).sortIndex;
            }
            else if (second == null)
            {
                second = tweakSorting.get(o2.getClass().getName());
            }
            if (first == null)
            {
                first = 0;
            }
            if (second == null)
            {
                second = 0;
            }

            return Ints.saturatedCast((long)first - (long)second);
        }
    });
}
项目:Cauldron    文件:CoreModManager.java   
public static void sortTweakList()
{
    @SuppressWarnings("unchecked")
    List<ITweaker> tweakers = (List<ITweaker>) Launch.blackboard.get("Tweaks");
    Collections.sort(tweakers, new Comparator<ITweaker>() {
        @Override
        public int compare(ITweaker o1, ITweaker o2)
        {
            Integer first = null;
            Integer second = null;
            if (o1 instanceof FMLInjectionAndSortingTweaker)
            {
                first = Integer.MIN_VALUE;
            }
            if (o2 instanceof FMLInjectionAndSortingTweaker)
            {
                second = Integer.MIN_VALUE;
            }

            if (o1 instanceof FMLPluginWrapper)
            {
                first = ((FMLPluginWrapper) o1).sortIndex;
            }
            else if (first == null)
            {
                first = tweakSorting.get(o1.getClass().getName());
            }
            if (o2 instanceof FMLPluginWrapper)
            {
                second = ((FMLPluginWrapper) o2).sortIndex;
            }
            else if (second == null)
            {
                second = tweakSorting.get(o2.getClass().getName());
            }
            if (first == null)
            {
                first = 0;
            }
            if (second == null)
            {
                second = 0;
            }

            return Ints.saturatedCast((long)first - (long)second);
        }
    });
}
项目:Cauldron    文件:CoreModManager.java   
public static void sortTweakList()
{
    @SuppressWarnings("unchecked")
    List<ITweaker> tweakers = (List<ITweaker>) Launch.blackboard.get("Tweaks");
    Collections.sort(tweakers, new Comparator<ITweaker>() {
        @Override
        public int compare(ITweaker o1, ITweaker o2)
        {
            Integer first = null;
            Integer second = null;
            if (o1 instanceof FMLInjectionAndSortingTweaker)
            {
                first = Integer.MIN_VALUE;
            }
            if (o2 instanceof FMLInjectionAndSortingTweaker)
            {
                second = Integer.MIN_VALUE;
            }

            if (o1 instanceof FMLPluginWrapper)
            {
                first = ((FMLPluginWrapper) o1).sortIndex;
            }
            else if (first == null)
            {
                first = tweakSorting.get(o1.getClass().getName());
            }
            if (o2 instanceof FMLPluginWrapper)
            {
                second = ((FMLPluginWrapper) o2).sortIndex;
            }
            else if (second == null)
            {
                second = tweakSorting.get(o2.getClass().getName());
            }
            if (first == null)
            {
                first = 0;
            }
            if (second == null)
            {
                second = 0;
            }

            return Ints.saturatedCast((long)first - (long)second);
        }
    });
}
项目:Cauldron    文件:CoreModManager.java   
public static void sortTweakList()
{
    @SuppressWarnings("unchecked")
    List<ITweaker> tweakers = (List<ITweaker>) Launch.blackboard.get("Tweaks");
    Collections.sort(tweakers, new Comparator<ITweaker>() {
        @Override
        public int compare(ITweaker o1, ITweaker o2)
        {
            Integer first = null;
            Integer second = null;
            if (o1 instanceof FMLInjectionAndSortingTweaker)
            {
                first = Integer.MIN_VALUE;
            }
            if (o2 instanceof FMLInjectionAndSortingTweaker)
            {
                second = Integer.MIN_VALUE;
            }

            if (o1 instanceof FMLPluginWrapper)
            {
                first = ((FMLPluginWrapper) o1).sortIndex;
            }
            else if (first == null)
            {
                first = tweakSorting.get(o1.getClass().getName());
            }
            if (o2 instanceof FMLPluginWrapper)
            {
                second = ((FMLPluginWrapper) o2).sortIndex;
            }
            else if (second == null)
            {
                second = tweakSorting.get(o2.getClass().getName());
            }
            if (first == null)
            {
                first = 0;
            }
            if (second == null)
            {
                second = 0;
            }

            return Ints.saturatedCast((long)first - (long)second);
        }
    });
}
项目:RuneCraftery    文件:CoreModManager.java   
public static void sortTweakList()
{
    List<ITweaker> tweakers = (List<ITweaker>) Launch.blackboard.get("Tweaks");
    Collections.sort(tweakers, new Comparator<ITweaker>() {
        @Override
        public int compare(ITweaker o1, ITweaker o2)
        {
            Integer first = null;
            Integer second = null;
            if (o1 instanceof FMLInjectionAndSortingTweaker)
            {
                first = Integer.MIN_VALUE;
            }
            if (o2 instanceof FMLInjectionAndSortingTweaker)
            {
                second = Integer.MIN_VALUE;
            }

            if (o1 instanceof FMLPluginWrapper)
            {
                first = ((FMLPluginWrapper) o1).sortIndex;
            }
            else if (first == null)
            {
                first = tweakSorting.get(o1.getClass().getName());
            }
            if (o2 instanceof FMLPluginWrapper)
            {
                second = ((FMLPluginWrapper) o2).sortIndex;
            }
            else if (second == null)
            {
                second = tweakSorting.get(o2.getClass().getName());
            }
            if (first == null)
            {
                first = 0;
            }
            if (second == null)
            {
                second = 0;
            }

            return Ints.saturatedCast((long)first - (long)second);
        }
    });
}
项目:RuneCraftery    文件:CoreModManager.java   
public static void sortTweakList()
{
    List<ITweaker> tweakers = (List<ITweaker>) Launch.blackboard.get("Tweaks");
    Collections.sort(tweakers, new Comparator<ITweaker>() {
        @Override
        public int compare(ITweaker o1, ITweaker o2)
        {
            Integer first = null;
            Integer second = null;
            if (o1 instanceof FMLInjectionAndSortingTweaker)
            {
                first = Integer.MIN_VALUE;
            }
            if (o2 instanceof FMLInjectionAndSortingTweaker)
            {
                second = Integer.MIN_VALUE;
            }

            if (o1 instanceof FMLPluginWrapper)
            {
                first = ((FMLPluginWrapper) o1).sortIndex;
            }
            else if (first == null)
            {
                first = tweakSorting.get(o1.getClass().getName());
            }
            if (o2 instanceof FMLPluginWrapper)
            {
                second = ((FMLPluginWrapper) o2).sortIndex;
            }
            else if (second == null)
            {
                second = tweakSorting.get(o2.getClass().getName());
            }
            if (first == null)
            {
                first = 0;
            }
            if (second == null)
            {
                second = 0;
            }

            return Ints.saturatedCast((long)first - (long)second);
        }
    });
}
项目:BetterNutritionMod    文件:CoreModManager.java   
public static void sortTweakList()
{
    List<ITweaker> tweakers = (List<ITweaker>) Launch.blackboard.get("Tweaks");
    Collections.sort(tweakers, new Comparator<ITweaker>() {
        @Override
        public int compare(ITweaker o1, ITweaker o2)
        {
            Integer first = null;
            Integer second = null;
            if (o1 instanceof FMLInjectionAndSortingTweaker)
            {
                first = Integer.MIN_VALUE;
            }
            if (o2 instanceof FMLInjectionAndSortingTweaker)
            {
                second = Integer.MIN_VALUE;
            }

            if (o1 instanceof FMLPluginWrapper)
            {
                first = ((FMLPluginWrapper) o1).sortIndex;
            }
            else if (first == null)
            {
                first = tweakSorting.get(o1.getClass().getName());
            }
            if (o2 instanceof FMLPluginWrapper)
            {
                second = ((FMLPluginWrapper) o2).sortIndex;
            }
            else if (second == null)
            {
                second = tweakSorting.get(o2.getClass().getName());
            }
            if (first == null)
            {
                first = 0;
            }
            if (second == null)
            {
                second = 0;
            }

            return Ints.saturatedCast((long)first - (long)second);
        }
    });
}