當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。