MineColonies

MineColonies

53M Downloads

Citizens Eating - enhancement and better feature

bob0bob opened this issue · 7 comments

commented

Yeah... How about a new enhancement to eating and refinement.... I think it looks cool and works really well. it also, turn the citizens into more life like characters.

I removed the eat routine from onLivingUpdate. There is a new AI task called AIEatTask. This task handles every aspect of eating for all the citizens.

I created a class that will check when a citizen can eat. It has a more thorough check of possible times to eat. Like if the guard is in the middle of a fight, they will hold off until the battle is done. Citizen will not eat while sleeping. Each status of the citizen has a boolean to indicate if they can eat during that task. Certain task will mark it as false, liking in the middle of a fight, they will wait until they are done fighting, or mining a block and such...

I used the minecraft animation for each citizen to eat their food. They will stop working and eat with the default minecraft animation for eating. This allows the citizen to come across more live. Also, as the player you can see and hear the citizens eat unlike before you never knew they where eating.

In the wander task, I removed the check if saturation if to low to go search for food. This routine has been moved into the new EatTask. The EatTask will override other task if it is determine that the citizen needs to eat.

In the config file you have the option to turn on citizen has to sit on a chair at the restaurant. So if the citizen needs to eat and they have no food, they will try to go to their job building to get food, if no food their they will walk to the restaurant. If they have no job then they go straight to the restaurant.

If sitting is turned on, then the citizen will find an empty chair and sit there. They will wait for the cook to walk over and bring them food and they will eat. If the saturation level is still to low they will continue to seat and cook will bring them more food. Once saturation if over 7 then they will get up. Citizens will search for an empty seat and wait until they locate one. They will send out a message if no empty chairs are located. So if all chairs are taken, they will wait until a chair becomes available and then sit.

If sitting is not turned on (By default), they citizen will just walk to the cook block and wait for the waiter to hand them food and eat it.

If a citizen doesn't have a job and saturation if less then 7, they will hang around the restaurant all day and wonder around there.

Fixed, that the cook would never gain experience points for any activity. Now, they can XP from cooking and delivery food to citizens.

Also, there were many activities in job that would never lower their saturation levels. I've adjusted them to lower saturation levels on certain tasks completed. Citizens would go days without eating even though they chopped down 20 trees per day or mine 70 blocks in a day.

I created two types of sittable blocks. You have a cushion and a chair. When it comes to cushion there are 16 colors. When it comes to chairs, there is a wood type for each vanilla wood.

Minecolonies will work with any kind of sitting block as long as it implements interface class IBlockMinecoloniesSeat. It checks if the block is an instance of this class. Any other mod can create chairs for MC as long as they implement this class.

For kicks, if you have sitting required on. if any Player sits in a chair and your saturation level is under 6 hearts or less. The cook will deliver food to the player. Nice little easter egg that is not expected.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

commented

Builder will not eat if the status is BUILDING,CLEAR_STEP,BUILDING_STEP,DECORATION_STEP.
Composter not eat on status COMPOSTER_FILL,COMPOSTER_HARVEST
farmer = HOE,PLANT,HARVEST
guard = has target or ATTACK_PHYSICAL,ATTACK_RANGE,ATTACK_PROTECT
herder = BREED,BUTCHER,PICKUP,MILK,SHEAR
lumberjack = SEARCHING TREE, CHOP TREE,GATHERING,

commented

We should improve the AI State system to be much more context sensitive. Instead of having to code in which states should not be used to eat. The state should introduce it himself. Maybe Something like IAIState?

commented

Not following you. Are you saying each state should have another attribute that indicates you can eat during that state?

commented
commented

That is exactly what I am saying. Making this an Interface allows other mods to create states in the future easily.

commented

For kicks, if you have sitting required on. if any Player sits in a chair and your saturation level is under 6 hearts or less. The cook will deliver food to the player. Nice little easter egg that is not expected.

commented

Are there plans to allow for cooking mod integration? For example, allowing citizens to eat Pam's Harvestcraft meals as valid food.