Now we add a WailaCompatibility class and also a WailaInfoProvider interface similar to how we did it with TOP:

publicclassWailaCompatibilityimplementsIWailaDataProvider{publicstaticfinalWailaCompatibilityINSTANCE=newWailaCompatibility();privateWailaCompatibility(){}privatestaticbooleanregistered;privatestaticbooleanloaded;publicstaticvoidload(IWailaRegistrarregistrar){System.out.println("WailaCompatibility.load");if(!registered){thrownewRuntimeException("Please register this handler using the provided method.");}if(!loaded){registrar.registerHeadProvider(INSTANCE,DataBlock.class);registrar.registerBodyProvider(INSTANCE,DataBlock.class);registrar.registerTailProvider(INSTANCE,DataBlock.class);loaded=true;}}publicstaticvoidregister(){if(registered)return;registered=true;FMLInterModComms.sendMessage("Waila","register","mcjty.modtut.compat.waila.WailaCompatibility.load");}@OverridepublicNBTTagCompoundgetNBTData(EntityPlayerMPplayer,TileEntityte,NBTTagCompoundtag,Worldworld,BlockPospos){returntag;}@OverridepublicItemStackgetWailaStack(IWailaDataAccessoraccessor,IWailaConfigHandlerconfig){returnnull;}@OverridepublicList<String>getWailaHead(ItemStackitemStack,List<String>currenttip,IWailaDataAccessoraccessor,IWailaConfigHandlerconfig){returncurrenttip;}@OverridepublicList<String>getWailaBody(ItemStackitemStack,List<String>currenttip,IWailaDataAccessoraccessor,IWailaConfigHandlerconfig){Blockblock=accessor.getBlock();if(blockinstanceofWailaInfoProvider){return((WailaInfoProvider)block).getWailaBody(itemStack,currenttip,accessor,config);}returncurrenttip;}@OverridepublicList<String>getWailaTail(ItemStackitemStack,List<String>currenttip,IWailaDataAccessoraccessor,IWailaConfigHandlerconfig){returncurrenttip;}}publicinterfaceWailaInfoProvider{List<String>getWailaBody(ItemStackitemStack,List<String>currenttip,IWailaDataAccessoraccessor,IWailaConfigHandlerconfig);}

Then we add support in our DataBlock. It is important to note that (in contrast with The One Probe) the getWailaBody method is called on the client side. That means we can't easily access information that is only present on the server. And since our DataBlock does not sync its counter value to the client the WAILA tooltip will always show 0. There are ways to fix this with packets: