I would like to import ModelPredicateProviderRegistry in order to add animation to the bow I added, but when I import this it fails to compile. The log shows that this is caused by importing this, but of course an error will also occur if it is not imported.
package com.example.util;
import net.minecraft.client.item.ModelPredicateProviderRegistry;
import net.minecraft.item.Item;
import net.minecraft.item.Items;
import net.minecraft.util.Identifier;
import static com.example.item.init.*;
public class CustomModelPredicateProvider {
public static void registerModModels(){
registerNewBow(BOWTEST);
}
private static void registerNewBow(Item bow) {
ModelPredicateProviderRegistry.register(Items.BOW, new Identifier("pull"), (stack, world, entity, seed) -> {
if (entity == null) {
return 0.0f;
}
if (entity.getActiveItem() != stack) {
return 0.0f;
}
return (float)(stack.getMaxUseTime() - entity.getItemUseTimeLeft()) / 20.0f;
});
ModelPredicateProviderRegistry.register(Items.BOW, new Identifier("pulling"), (stack, world, entity, seed) -> entity != null && entity.isUsingItem() && entity.getActiveItem() == stack ? 1.0f : 0.0f);
}
}