From c2de8dc7507f4df605db30881ecd86852ef8e2a3 Mon Sep 17 00:00:00 2001 From: i509VCB Date: Wed, 12 Aug 2020 02:20:57 -0500 Subject: [PATCH] Document FoodComponent and it's builder (#1667) * Document FoodComponent and it's builder * Update mappings/net/minecraft/item/FoodComponent.mapping Co-authored-by: liach <7806504+liach@users.noreply.github.com> * Update mappings/net/minecraft/item/FoodComponent.mapping Co-authored-by: liach <7806504+liach@users.noreply.github.com> * Update mappings/net/minecraft/item/FoodComponent.mapping Co-authored-by: liach <7806504+liach@users.noreply.github.com> * Update mappings/net/minecraft/item/FoodComponent.mapping Co-authored-by: liach <7806504+liach@users.noreply.github.com> * Update mappings/net/minecraft/item/FoodComponent.mapping Co-authored-by: liach <7806504+liach@users.noreply.github.com> * Update mappings/net/minecraft/item/FoodComponent.mapping Co-authored-by: liach <7806504+liach@users.noreply.github.com> * Update mappings/net/minecraft/item/FoodComponent.mapping Co-authored-by: liach <7806504+liach@users.noreply.github.com> * Update mappings/net/minecraft/item/FoodComponent.mapping Co-authored-by: liach <7806504+liach@users.noreply.github.com> * Update mappings/net/minecraft/item/FoodComponent.mapping Co-authored-by: Yanis48 * Update mappings/net/minecraft/item/FoodComponent.mapping Co-authored-by: Yanis48 * Update mappings/net/minecraft/item/FoodComponent.mapping Co-authored-by: Yanis48 Co-authored-by: liach <7806504+liach@users.noreply.github.com> Co-authored-by: Yanis48 --- .../net/minecraft/item/FoodComponent.mapping | 29 +++++++++++++++++++ .../net/minecraft/item/FoodComponents.mapping | 1 + 2 files changed, 30 insertions(+) diff --git a/mappings/net/minecraft/item/FoodComponent.mapping b/mappings/net/minecraft/item/FoodComponent.mapping index 5892dd9c73..b931518c06 100644 --- a/mappings/net/minecraft/item/FoodComponent.mapping +++ b/mappings/net/minecraft/item/FoodComponent.mapping @@ -1,4 +1,5 @@ CLASS net/minecraft/class_4174 net/minecraft/item/FoodComponent + COMMENT Represents the components that make up the properties of a food item. FIELD field_18614 hunger I FIELD field_18615 saturationModifier F FIELD field_18616 meat Z @@ -13,11 +14,24 @@ CLASS net/minecraft/class_4174 net/minecraft/item/FoodComponent ARG 5 snack ARG 6 statusEffects METHOD method_19230 getHunger ()I + COMMENT Gets the amount of hunger a food item will fill. + COMMENT + COMMENT

One hunger is equivalent to half of a hunger bar icon. METHOD method_19231 getSaturationModifier ()F + COMMENT Gets the staturation modifier of a food item. + COMMENT + COMMENT

This value is typically used to determine how long a player can sustain the current hunger value before the hunger is used. METHOD method_19232 isMeat ()Z + COMMENT Checks if a food item can be fed to dogs. METHOD method_19233 isAlwaysEdible ()Z + COMMENT Checks if a food item can be eaten when the current hunger bar is full. METHOD method_19234 isSnack ()Z + COMMENT Checks if a food item is snack-like and is eaten quickly. METHOD method_19235 getStatusEffects ()Ljava/util/List; + COMMENT Gets a list of all status effect instances that may be applied when a food item is consumed. + COMMENT + COMMENT

The first value in the pair is the status effect instance to be applied. + COMMENT

The second value is the chance the status effect gets applied, on a scale between {@code 0.0F} and {@code 1.0F}. CLASS class_4175 Builder FIELD field_18620 hunger I FIELD field_18621 saturationModifier F @@ -26,13 +40,28 @@ CLASS net/minecraft/class_4174 net/minecraft/item/FoodComponent FIELD field_18624 snack Z FIELD field_18625 statusEffects Ljava/util/List; METHOD method_19236 meat ()Lnet/minecraft/class_4174$class_4175; + COMMENT Specifies that a food item can be fed to dogs. METHOD method_19237 saturationModifier (F)Lnet/minecraft/class_4174$class_4175; + COMMENT Specifies the saturation modifier of a food item. + COMMENT + COMMENT

This value is typically used to determine how long a player can sustain the current hunger value before the hunger is used. ARG 1 saturationModifier + COMMENT the saturation modifier METHOD method_19238 hunger (I)Lnet/minecraft/class_4174$class_4175; + COMMENT Specifies the amount of hunger a food item will fill. + COMMENT + COMMENT

One hunger is equivalent to half of a hunger bar icon. ARG 1 hunger + COMMENT the amount of hunger METHOD method_19239 statusEffect (Lnet/minecraft/class_1293;F)Lnet/minecraft/class_4174$class_4175; + COMMENT Specifies a status effect to apply to an entity when a food item is consumed. + COMMENT This method may be called multiple times to apply several status effects when food is consumed. ARG 1 effect + COMMENT the effect instance to apply ARG 2 chance + COMMENT the chance the status effect is applied, on a scale of {@code 0.0F} to {@code 1.0F} METHOD method_19240 alwaysEdible ()Lnet/minecraft/class_4174$class_4175; + COMMENT Specifies that a food item can be eaten when the current hunger bar is full. METHOD method_19241 snack ()Lnet/minecraft/class_4174$class_4175; + COMMENT Specifies that a food item is snack-like and is eaten quickly. METHOD method_19242 build ()Lnet/minecraft/class_4174; diff --git a/mappings/net/minecraft/item/FoodComponents.mapping b/mappings/net/minecraft/item/FoodComponents.mapping index ebbf50070b..2aff3aca9b 100644 --- a/mappings/net/minecraft/item/FoodComponents.mapping +++ b/mappings/net/minecraft/item/FoodComponents.mapping @@ -1,4 +1,5 @@ CLASS net/minecraft/class_4176 net/minecraft/item/FoodComponents + COMMENT Contains all the default food components used in vanilla food items. FIELD field_18626 PORKCHOP Lnet/minecraft/class_4174; FIELD field_18627 POTATO Lnet/minecraft/class_4174; FIELD field_18628 PUFFERFISH Lnet/minecraft/class_4174;