package tehnut.xtones.compat;

import mcp.mobius.waila.api.*;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.translation.I18n;
import tehnut.xtones.block.BlockXtone;

import javax.annotation.Nonnull;
import java.util.List;

@WailaPlugin
public class CompatWaila implements IWailaPlugin {

    @Override
    public void register(IWailaRegistrar registrar) {
        registrar.registerHeadProvider(new DataProviderXtones(), BlockXtone.class);
    }

    public static class DataProviderXtones implements IWailaDataProvider {
        @Override
        @Nonnull
        public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
            currenttip.add(I18n.translateToLocalFormatted("tooltip.xtones.type", itemStack.getItemDamage() + 1));
            return currenttip;
        }
    }
}

@@ -80,22 +80,29 @@
 aft.
-item.ItemStack
+client.resources.I18n
 ;%0Aim
@@ -124,34 +124,22 @@
 aft.
-util.text.translation.I18n
+item.ItemStack
 ;%0Aim
@@ -409,16 +409,22 @@
 der(new 
+IWaila
 DataProv
@@ -431,119 +431,38 @@
 ider
-Xtones(), BlockXtone.class);
+() %7B
 %0A    
-%7D%0A%0A
     
-public static class DataProviderXtones implements IWailaDataProvider %7B%0A
+    @Nonnull%0A    
     
@@ -475,37 +475,24 @@
 verride%0A    
-    @Nonnull%0A
         publ
@@ -637,16 +637,20 @@
         
+    
 currentt
@@ -665,33 +665,14 @@
 18n.
-translateToLocalF
+f
 ormat
-ted
 (%22to
@@ -736,16 +736,20 @@
         
+    
 return c
@@ -767,17 +767,51 @@
         
-%7D
+    %7D%0A        %7D, BlockXtone.class);
 %0A    %7D%0A%7D

Move Hwyla integration into a lambda