Option to disable milking cows or add compatibility with Animania
Kurtchekov opened this issue ยท 3 comments
Issue Description
When milking cows from Animania mod, Pyrotech takes over milk handling instead of letting Animania return a bucket filled the correct kind of milk based on the breed of cow.
The problem lies right here, function itemInteractionForEntity in the ItemBucketBase class:
if (target instanceof EntityCow) {
int durability = this.getDurability(stack);
player.playSound(SoundEvents.ENTITY_COW_MILK, 1, 1);
if (stack.getCount() == 1) {
stack.setItemDamage(EnumType.MILK.getMeta());
this.setDurability(stack, durability);
} else {
stack.shrink(1);
ItemStack result = EnumType.MILK.asStack(this);
this.setDurability(result, durability);
ItemHandlerHelper.giveItemToPlayer(player, result, player.inventory.currentItem);
}
return true;
}
Animania cows ultimately inherit from vanilla EntityCow, which causes the problem. Therefore, it'd be nice to have an option in the config to disable that code. Ideally, though, we could have compatibility with Animania instead.
I added the config option because it was fast and I could do it right away.
Sometime in the future I might look into adding Animania milking compat.
Thank you so much! It's working as intended now, Animania is correctly filling the buckets with the appropriate milk and forbidding milking when cows aren't ready.