java.lang.Object
com.github.retrooper.packetevents.protocol.component.builtin.item.FoodProperties

public class FoodProperties extends Object
  • Constructor Details

    • FoodProperties

      public FoodProperties(int nutrition, float saturation, boolean canAlwaysEat)
    • FoodProperties

      @Obsolete public FoodProperties(int nutrition, float saturation, boolean canAlwaysEat, float eatSeconds, List<FoodProperties.PossibleEffect> effects)
      eatSeconds and effects have been moved to ItemConsumable in 1.21.2
    • FoodProperties

      @Obsolete public FoodProperties(int nutrition, float saturation, boolean canAlwaysEat, float eatSeconds, List<FoodProperties.PossibleEffect> effects, @Nullable @Nullable ItemStack usingConvertsTo)
      eatSeconds, effects and usingConvertsTo have been moved to ItemConsumable in 1.21.2
  • Method Details

    • read

      public static FoodProperties read(PacketWrapper<?> wrapper)
    • write

      public static void write(PacketWrapper<?> wrapper, FoodProperties props)
    • getNutrition

      public int getNutrition()
    • setNutrition

      public void setNutrition(int nutrition)
    • getSaturation

      public float getSaturation()
    • setSaturation

      public void setSaturation(float saturation)
    • isCanAlwaysEat

      public boolean isCanAlwaysEat()
    • setCanAlwaysEat

      public void setCanAlwaysEat(boolean canAlwaysEat)
    • getEatSeconds

      @Obsolete public float getEatSeconds()
      Has been moved to ItemConsumable in 1.21.2
    • setEatSeconds

      @Obsolete public void setEatSeconds(float eatSeconds)
      Has been moved to ItemConsumable in 1.21.2
    • addEffect

      @Obsolete public void addEffect(FoodProperties.PossibleEffect effect)
      Has been moved to ItemConsumable in 1.21.2
    • getEffects

      @Obsolete public List<FoodProperties.PossibleEffect> getEffects()
      Has been moved to ItemConsumable in 1.21.2
    • setEffects

      @Obsolete public void setEffects(List<FoodProperties.PossibleEffect> effects)
      Has been moved to ItemConsumable in 1.21.2
    • getUsingConvertsTo

      @Obsolete @Nullable public @Nullable ItemStack getUsingConvertsTo()
      Has been moved to ItemConsumable in 1.21.2
    • setUsingConvertsTo

      @Obsolete public void setUsingConvertsTo(@Nullable @Nullable ItemStack usingConvertsTo)
      Has been moved to ItemConsumable in 1.21.2
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object