本文整理汇总了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;
}
示例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());
}
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
}
示例15: TileWailaDataProvider
import mcp.mobius.waila.api.IWailaDataProvider; //导入依赖的package包/类
public TileWailaDataProvider() {
final IWailaDataProvider playerInterface = new PlayerInterfaceWailaDataProvider();
this.providers = Lists.newArrayList(playerInterface);
}