本文整理匯總了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);
}