AppleSkin

AppleSkin

236M Downloads

FoodValuesEvent mapping incorrect on fabric

CoffeeCatRailway opened this issue ยท 3 comments

commented
@Override
public void registerEvents()
{
    FoodValuesEvent.EVENT.register(event -> {
        ItemStack stack = event.itemStack; // Mapping missmatch
        if (stack.getItem() instanceof AbstractSandwichItem)
        {
            FoodProperties properties = ((AbstractSandwichItem) stack.getItem()).getFood(stack);
            event.modifiedFoodValues = new FoodValues(properties.getNutrition(), properties.getSaturationModifier());
        }
    });
}
modCompileOnly("squeek.appleskin:appleskin-fabric:mc1.18.2-2.4.0:api") { transitive = false }
modRuntimeOnly("squeek.appleskin:appleskin-fabric:mc1.18.2-2.4.0") {
    exclude module: 'modmenu'
}

It's saying that event.itemStack is net.minecraft.item while net.minecraft.world.item is required
I didn't know what else to provide here, please tell me if you need anything else

commented

Hm, is this a Yarn mappings difference? I'm not sure how that is handled or what a fix would look like.

commented

I'm using quiltflower with official mojang mappings
I'm also in an architectury environment if that changes anything

commented

for architectury use modApi it will remapping the api jar into your project.

modApi "squeek.appleskin:appleskin-fabric:mc1.16.5-2.4.0"
modLocalRuntime "squeek.appleskin:appleskin-fabric:mc1.16.5-2.4.0"