Skip to content

Conversation

@isErenG
Copy link

@isErenG isErenG commented Sep 12, 2025

Villagers weren't able to consume some of the items they picked up (cabbage, tomatoe, rice, onion). Created a simple mixin to modify the FOOD_POINTS map.

I didn't give much thought to the food point worth so feel free to change it accordingly. I think it is fine though.

@KreloX
Copy link

KreloX commented Sep 12, 2025

It's not up to me to pull this or not but Farmer's Delight uses the following code along with accesstransformers to modify hard coded collections, so this implementation wouldn't be consistent with the rest of the mod.

public static void registerItemSetAdditions() {
Ingredient newChickenFood = Ingredient.of(ModItems.CABBAGE_SEEDS.get(), ModItems.TOMATO_SEEDS.get(), ModItems.RICE.get());
Chicken.FOOD_ITEMS = new CompoundIngredient(Arrays.asList(Chicken.FOOD_ITEMS, newChickenFood))
{
};
Ingredient newPigFood = Ingredient.of(ModItems.CABBAGE.get(), ModItems.TOMATO.get());
Pig.FOOD_ITEMS = new CompoundIngredient(Arrays.asList(Pig.FOOD_ITEMS, newPigFood))
{
};
Collections.addAll(Parrot.TAME_FOOD, ModItems.CABBAGE_SEEDS.get(), ModItems.TOMATO_SEEDS.get(), ModItems.RICE.get());
Set<Item> newWantedItems = Sets.newHashSet(
ModItems.CABBAGE.get(),
ModItems.TOMATO.get(),
ModItems.ONION.get(),
ModItems.RICE.get(),
ModItems.CABBAGE_SEEDS.get(),
ModItems.TOMATO_SEEDS.get(),
ModItems.RICE_PANICLE.get());
newWantedItems.addAll(Villager.WANTED_ITEMS);
Villager.WANTED_ITEMS = ImmutableSet.copyOf(newWantedItems);
}

@isErenG
Copy link
Author

isErenG commented Sep 12, 2025

I saw this file but the FOOD_POINTS map is immutable in Villager.class. That's why I resorted to making a mixin instead.

@KreloX
Copy link

KreloX commented Sep 12, 2025

the private and final modifiers can be changed using the accesstransformer file

public-f net.minecraft.world.entity.animal.Chicken f_28233_ # FOOD_ITEMS
public-f net.minecraft.world.entity.animal.Pig f_29458_ # FOOD_ITEMS
public-f net.minecraft.world.entity.animal.Parrot f_29357_ # TAME_FOOD
public-f net.minecraft.world.entity.npc.Villager f_35372_ # WANTED_ITEMS

@isErenG
Copy link
Author

isErenG commented Sep 12, 2025

Oh I didn't know, I'll rewrite it then. Tysm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants