当前位置: 首页>>代码示例>>Java>>正文


Java ITweaker类代码示例

本文整理汇总了Java中net.minecraft.launchwrapper.ITweaker的典型用法代码示例。如果您正苦于以下问题:Java ITweaker类的具体用法?Java ITweaker怎么用?Java ITweaker使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ITweaker类属于net.minecraft.launchwrapper包,在下文中一共展示了ITweaker类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: LegacyJavaFixer

import net.minecraft.launchwrapper.ITweaker; //导入依赖的package包/类
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);
        }
    }
}
 
开发者ID:LexManos,项目名称:LegacyJavaFixer,代码行数:17,代码来源:LegacyJavaFixer.java

示例2: injectCoreModTweaks

import net.minecraft.launchwrapper.ITweaker; //导入依赖的package包/类
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);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:12,代码来源:CoreModManager.java

示例3: sort

import net.minecraft.launchwrapper.ITweaker; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void sort()
{
    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)
        {
            return Ints.saturatedCast((long)getIndex(o1) - (long)getIndex(o2));
        }
        private int getIndex(ITweaker t)
        {
            try
            {
                if (t instanceof SortReplacement) return Integer.MIN_VALUE;
                if (wrapperCls.isInstance(t)) return wrapperField.getInt(t);
                if (tweakSorting.containsKey(t.getClass().getName())) return tweakSorting.get(t.getClass().getName());
            }
            catch (Exception e)
            {
                Throwables.propagate(e);
            }
            return 0;
        }
    });
    // 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]);
    }
}
 
开发者ID:LexManos,项目名称:LegacyJavaFixer,代码行数:36,代码来源:LegacyJavaFixer.java

示例4: injectCoreModTweaks

import net.minecraft.launchwrapper.ITweaker; //导入依赖的package包/类
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);
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:11,代码来源:CoreModManager.java

示例5: sortTweakList

import net.minecraft.launchwrapper.ITweaker; //导入依赖的package包/类
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]);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:57,代码来源:CoreModManager.java

示例6: sortTweakList

import net.minecraft.launchwrapper.ITweaker; //导入依赖的package包/类
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);
        }
    });
}
 
开发者ID:alexandrage,项目名称:CauldronGit,代码行数:49,代码来源:CoreModManager.java

示例7: sortTweakList

import net.minecraft.launchwrapper.ITweaker; //导入依赖的package包/类
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);
        }
    });
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:48,代码来源:CoreModManager.java

示例8: MCITweaker

import net.minecraft.launchwrapper.ITweaker; //导入依赖的package包/类
public MCITweaker(ITweaker parent, List<Injector> injectors) {
    MCITransformer.injectors.addAll(injectors);
    this.parent = parent;
}
 
开发者ID:warriordog,项目名称:MCInject,代码行数:5,代码来源:MCITweaker.java


注:本文中的net.minecraft.launchwrapper.ITweaker类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。