-
-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(eating): initial version of food eating #602
Draft
HookWoods
wants to merge
1
commit into
Pumpkin-MC:master
Choose a base branch
from
HookWoods:feat/food-eating-system
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Snowiiii
reviewed
Mar 2, 2025
Comment on lines
+9
to
+251
|
||
#[async_trait] | ||
impl PumpkinFood for DriedKelpItem {} | ||
|
||
#[pumpkin_item("sweet_berries")] | ||
pub struct SweetBerriesItem; | ||
|
||
#[async_trait] | ||
impl PumpkinFood for SweetBerriesItem {} | ||
|
||
#[pumpkin_item("honey_bottle")] | ||
pub struct HoneyBottleItem; | ||
|
||
#[async_trait] | ||
impl PumpkinFood for HoneyBottleItem {} | ||
|
||
// Additional foods | ||
#[pumpkin_item("cookie")] | ||
pub struct CookieItem; | ||
|
||
#[async_trait] | ||
impl PumpkinFood for CookieItem {} | ||
|
||
#[pumpkin_item("melon_slice")] | ||
pub struct MelonSliceItem; | ||
|
||
#[async_trait] | ||
impl PumpkinFood for MelonSliceItem {} | ||
|
||
#[pumpkin_item("beetroot")] | ||
pub struct BeetrootItem; | ||
|
||
#[async_trait] | ||
impl PumpkinFood for BeetrootItem {} | ||
|
||
#[pumpkin_item("beetroot_soup")] | ||
pub struct BeetrootSoupItem; | ||
|
||
#[async_trait] | ||
impl PumpkinFood for BeetrootSoupItem {} | ||
|
||
#[pumpkin_item("mushroom_stew")] | ||
pub struct MushroomStewItem; | ||
|
||
#[async_trait] | ||
impl PumpkinFood for MushroomStewItem {} | ||
|
||
#[pumpkin_item("rabbit_stew")] | ||
pub struct RabbitStewItem; | ||
|
||
#[async_trait] | ||
impl PumpkinFood for RabbitStewItem {} | ||
|
||
#[pumpkin_item("carrot")] | ||
pub struct CarrotItem; | ||
|
||
#[async_trait] | ||
impl PumpkinFood for CarrotItem {} | ||
|
||
#[pumpkin_item("potato")] | ||
pub struct PotatoItem; | ||
|
||
#[async_trait] | ||
impl PumpkinFood for PotatoItem {} | ||
|
||
#[pumpkin_item("baked_potato")] | ||
pub struct BakedPotatoItem; | ||
|
||
#[async_trait] | ||
impl PumpkinFood for BakedPotatoItem {} | ||
|
||
#[pumpkin_item("poisonous_potato")] | ||
pub struct PoisonousPotatoItem; | ||
|
||
#[async_trait] | ||
impl PumpkinFood for PoisonousPotatoItem {} | ||
|
||
#[pumpkin_item("pumpkin_pie")] | ||
pub struct PumpkinPieItem; | ||
|
||
#[async_trait] | ||
impl PumpkinFood for PumpkinPieItem {} | ||
|
||
#[pumpkin_item("tropical_fish")] | ||
pub struct TropicalFishItem; | ||
|
||
#[async_trait] | ||
impl PumpkinFood for TropicalFishItem {} | ||
|
||
#[pumpkin_item("pufferfish")] | ||
pub struct PufferfishItem; | ||
|
||
#[async_trait] | ||
impl PumpkinFood for PufferfishItem {} | ||
|
||
#[pumpkin_item("glow_berries")] | ||
pub struct GlowBerriesItem; | ||
|
||
#[async_trait] | ||
impl PumpkinFood for GlowBerriesItem {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why implementing all foods yourself, We have a data driven design to not hard code such things
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR is the initial version of food eating, the PR is still in draft cause some small bugs are present but this is working in a general way.
I implemented food and consumable item properties at the json loading so like that we have a generic way of handling food data
Some system will need to be handled later like effects ticking when eating some food but we currently send effect data to clients.
The system I implemented is very basic, I created a trait of PumpkinItem to handle all food function like eating duration, start eating, common on use, ...
Then there is a basic eating ticking that will send packet to client, check if eating is finished or if player has cancel the eating effect
Testing
Please follow our Coding Guidelines