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


Java IWailaDataProvider类代码示例

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


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

示例1: getWailaTail

import mcp.mobius.waila.api.IWailaDataProvider; //导入依赖的package包/类
@Override
public List<String> getWailaTail(final ItemStack stack, final List<String> strings, final IWailaDataAccessor data, final IWailaConfigHandler config) {
    TileStickyJar tile = (TileStickyJar) data.getTileEntity();
    if(tile != null && tile.isValid()) {
        callParentProviders(ModuleRegistrar.instance().getBodyProviders(tile.getParentBlock()), new Callable<IWailaDataProvider>() {
            @Override
            public void call(IWailaDataProvider provider) {
                provider.getWailaTail(stack, strings, data, config);
            }
        });
    }

    if(data.getTileEntity() instanceof TileStickyJar) {
        if(strings.size() > 0) {
            String oldMod = strings.get(strings.size() - 1);
            String mod = ColorHelper.extractColors(oldMod) + Gadomancy.NAME;
            strings.remove(strings.size() - 1);
            strings.add(mod);
        }
    }
    return strings;
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:23,代码来源:StickyJarProvider.java

示例2: wailaRegister

import mcp.mobius.waila.api.IWailaDataProvider; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static void wailaRegister(IWailaRegistrar registrar) {
    BlockRegistry registry = instance();

    HashMap<String, Block> hash = (HashMap<String, Block>) registry.blockMap.clone();

    List<ItemBlock> listedRegistrars = new ArrayList<ItemBlock>();

    for (Map.Entry<String, Block> entry : hash.entrySet()) {
        ItemBlock ib = (ItemBlock) ItemBlock.getItemFromBlock(entry.getValue());
        if (ib instanceof IWailaDataProvider && !listedRegistrars.contains(ib)) {
            registrar.registerBodyProvider((IWailaDataProvider) ib, entry.getValue().getClass());
            listedRegistrars.add(ib);
        }

        if (entry.getValue() instanceof IWailaDataProvider)
            registrar.registerBodyProvider((IWailaDataProvider) entry.getValue(), entry.getValue().getClass());
    }
}
 
开发者ID:MSourceCoded,项目名称:Quantum-Anomalies,代码行数:20,代码来源:BlockRegistry.java

示例3: register

import mcp.mobius.waila.api.IWailaDataProvider; //导入依赖的package包/类
public static void register() {
    IWailaDataProvider provider = new WailaHUDHandler();

    ModuleRegistrar.instance().registerStackProvider(provider, BlockCrop.class);
    ModuleRegistrar.instance().registerStackProvider(provider, BlockDoubleCrop.class);

    ModuleRegistrar.instance().registerBodyProvider(provider, BlockDoubleCrop.class);
    ModuleRegistrar.instance().registerBodyProvider(provider, BlockModCauldron.class);
}
 
开发者ID:GirafiStudios,项目名称:Culinary-Cultivation,代码行数:10,代码来源:WailaHUDHandler.java

示例4: callbackRegister

import mcp.mobius.waila.api.IWailaDataProvider; //导入依赖的package包/类
public static void callbackRegister(IWailaRegistrar registrar)
{
    final String mod = "The Kitchen Mod";

    registrar.addConfig(mod, "show_change_block_direction", true);

    System.out.println("Register");

    IWailaDataProvider provider = new WailaCompatibility();
    registrar.registerBodyProvider(provider, BlockChangeBlock.class);
    registrar.registerBodyProvider(provider, BlockToggleController.class);
    registrar.registerStackProvider(provider, BlockToggleController.class);
}
 
开发者ID:MrSpring,项目名称:ToggleBlocks,代码行数:14,代码来源:WailaCompatibility.java

示例5: register

import mcp.mobius.waila.api.IWailaDataProvider; //导入依赖的package包/类
@Optional.Method(modid = ModIDs.WAILA)
public static void register(IWailaRegistrar registrar) {
    final IWailaDataProvider tile = new TileWailaDataProvider();

    registrar.registerBodyProvider(tile, TileEntityPlayerInterface.class);
    registrar.registerNBTProvider(tile, TileEntityPlayerInterface.class);
}
 
开发者ID:Dragon9815,项目名称:PlayerInterfaceMod,代码行数:8,代码来源:WailaModHelper.java

示例6: getWailaHead

import mcp.mobius.waila.api.IWailaDataProvider; //导入依赖的package包/类
@Override
public List<String> getWailaHead(ItemStack itemStack, List<String> currentToolTip, IWailaDataAccessor iWailaDataAccessor, IWailaConfigHandler iWailaConfigHandler) {
    for (IWailaDataProvider provider : this.providers) {
        provider.getWailaHead(itemStack, currentToolTip, iWailaDataAccessor, iWailaConfigHandler);
    }

    return currentToolTip;
}
 
开发者ID:Dragon9815,项目名称:PlayerInterfaceMod,代码行数:9,代码来源:TileWailaDataProvider.java

示例7: getWailaBody

import mcp.mobius.waila.api.IWailaDataProvider; //导入依赖的package包/类
@Override
public List<String> getWailaBody(ItemStack itemStack, List<String> currentToolTip, IWailaDataAccessor iWailaDataAccessor, IWailaConfigHandler iWailaConfigHandler) {
    for (IWailaDataProvider provider : this.providers) {
        provider.getWailaBody(itemStack, currentToolTip, iWailaDataAccessor, iWailaConfigHandler);
    }

    return currentToolTip;
}
 
开发者ID:Dragon9815,项目名称:PlayerInterfaceMod,代码行数:9,代码来源:TileWailaDataProvider.java

示例8: getWailaTail

import mcp.mobius.waila.api.IWailaDataProvider; //导入依赖的package包/类
@Override
public List<String> getWailaTail(ItemStack itemStack, List<String> currentToolTip, IWailaDataAccessor iWailaDataAccessor, IWailaConfigHandler iWailaConfigHandler) {
    for (IWailaDataProvider provider : this.providers) {
        provider.getWailaTail(itemStack, currentToolTip, iWailaDataAccessor, iWailaConfigHandler);
    }

    return currentToolTip;
}
 
开发者ID:Dragon9815,项目名称:PlayerInterfaceMod,代码行数:9,代码来源:TileWailaDataProvider.java

示例9: getNBTData

import mcp.mobius.waila.api.IWailaDataProvider; //导入依赖的package包/类
@Override
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity tileEntity, NBTTagCompound tag, World world, int x, int y, int z) {
    for (IWailaDataProvider provider : this.providers) {
        provider.getNBTData(player, tileEntity, tag, world, x, y, z);
    }

    return tag;
}
 
开发者ID:Dragon9815,项目名称:PlayerInterfaceMod,代码行数:9,代码来源:TileWailaDataProvider.java

示例10: getWailaStack

import mcp.mobius.waila.api.IWailaDataProvider; //导入依赖的package包/类
@Override
public ItemStack getWailaStack(final IWailaDataAccessor data, final IWailaConfigHandler config) {
    if(data.getTileEntity() instanceof TileStickyJar) {
        TileStickyJar stickyJar = (TileStickyJar) data.getTileEntity();

        if(stickyJar.isValid()) {
            ItemStack stack = new ItemStack(stickyJar.getParentBlock(), 1, stickyJar.getBlockMetadata());
            for(IWailaDataProvider provider : getParentProviders(ModuleRegistrar.instance().stackBlockProviders, stickyJar.getParentBlock().getClass(), stickyJar.getParent().getClass())) {
                stack = provider.getWailaStack(data, config);
            }
            return stack;
        }
    }
    return null;
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:16,代码来源:StickyJarProvider.java

示例11: getParentProviders

import mcp.mobius.waila.api.IWailaDataProvider; //导入依赖的package包/类
private List<IWailaDataProvider> getParentProviders(LinkedHashMap<Class, ArrayList<IWailaDataProvider>> providerMap, Class... classes) {
    List<IWailaDataProvider> providers = new ArrayList<IWailaDataProvider>();
    for(Class parent : classes) {
        ArrayList<IWailaDataProvider> providerList = providerMap.get(parent);
        if(providerList != null)
            providers.addAll(providerList);
    }
    return providers;
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:10,代码来源:StickyJarProvider.java

示例12: getWailaHead

import mcp.mobius.waila.api.IWailaDataProvider; //导入依赖的package包/类
@Override
public List<String> getWailaHead(final ItemStack stack, final List<String> strings, final IWailaDataAccessor data, final IWailaConfigHandler config) {
    TileStickyJar tile = (TileStickyJar) data.getTileEntity();
    if(tile != null && tile.isValid()) {
        callParentProviders(ModuleRegistrar.instance().getBodyProviders(tile.getParentBlock()), new Callable<IWailaDataProvider>() {
            @Override
            public void call(IWailaDataProvider provider) {
                provider.getWailaHead(stack, strings, data, config);
            }
        });
    }
    return strings;
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:14,代码来源:StickyJarProvider.java

示例13: getWailaBody

import mcp.mobius.waila.api.IWailaDataProvider; //导入依赖的package包/类
@Override
public List<String> getWailaBody(final ItemStack stack, final List<String> strings, final IWailaDataAccessor data, final IWailaConfigHandler config) {
    TileStickyJar tile = (TileStickyJar) data.getTileEntity();
    if(tile != null && tile.isValid()) {
        callParentProviders(ModuleRegistrar.instance().getBodyProviders(tile.getParentBlock()), new Callable<IWailaDataProvider>() {
            @Override
            public void call(IWailaDataProvider provider) {
               provider.getWailaBody(stack, strings, data, config);
            }
        });
    }
    return strings;
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:14,代码来源:StickyJarProvider.java

示例14: callParentProviders

import mcp.mobius.waila.api.IWailaDataProvider; //导入依赖的package包/类
private void callParentProviders(Map<Integer, List<IWailaDataProvider>> providers, Callable<IWailaDataProvider> callable) {
    for(Map.Entry<Integer, List<IWailaDataProvider>> entry : providers.entrySet()) {
        for(IWailaDataProvider provider : entry.getValue()) {
            callable.call(provider);
        }
    }
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:8,代码来源:StickyJarProvider.java

示例15: TileWailaDataProvider

import mcp.mobius.waila.api.IWailaDataProvider; //导入依赖的package包/类
public TileWailaDataProvider() {
    final IWailaDataProvider playerInterface = new PlayerInterfaceWailaDataProvider();

    this.providers = Lists.newArrayList(playerInterface);
}
 
开发者ID:Dragon9815,项目名称:PlayerInterfaceMod,代码行数:6,代码来源:TileWailaDataProvider.java


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