Record Class GeyserItemPredicateContext

java.lang.Object
java.lang.Record
org.geysermc.geyser.item.custom.GeyserItemPredicateContext
All Implemented Interfaces:
org.geysermc.geyser.api.predicate.context.item.ItemPredicateContext, org.geysermc.geyser.api.predicate.context.MinecraftPredicateContext

public record GeyserItemPredicateContext(Supplier<org.geysermc.geyser.api.util.Identifier> dimensionSupplier, int count, Supplier<Integer> maxStackSizeSupplier, Supplier<Integer> damageSupplier, Supplier<Integer> maxDamageSupplier, Supplier<Boolean> fishingRodCastSupplier, Supplier<Boolean> unbreakableSupplier, Supplier<Float> bundleFullnessSupplier, Supplier<org.geysermc.geyser.api.util.Identifier> trimMaterialSupplier, Supplier<List<org.geysermc.geyser.api.predicate.context.item.ChargedProjectile>> chargedProjectilesSupplier, Supplier<List<org.geysermc.geyser.api.util.Identifier>> componentsSupplier, Supplier<List<Boolean>> customModelDataFlagsSupplier, Supplier<List<String>> customModelDataStringsSupplier, Supplier<List<Float>> customModelDataFloatsSupplier) extends Record implements org.geysermc.geyser.api.predicate.context.item.ItemPredicateContext
  • Constructor Details

    • GeyserItemPredicateContext

      public GeyserItemPredicateContext(Supplier<org.geysermc.geyser.api.util.Identifier> dimensionSupplier, int count, Supplier<Integer> maxStackSizeSupplier, Supplier<Integer> damageSupplier, Supplier<Integer> maxDamageSupplier, Supplier<Boolean> fishingRodCastSupplier, Supplier<Boolean> unbreakableSupplier, Supplier<Float> bundleFullnessSupplier, Supplier<org.geysermc.geyser.api.util.Identifier> trimMaterialSupplier, Supplier<List<org.geysermc.geyser.api.predicate.context.item.ChargedProjectile>> chargedProjectilesSupplier, Supplier<List<org.geysermc.geyser.api.util.Identifier>> componentsSupplier, Supplier<List<Boolean>> customModelDataFlagsSupplier, Supplier<List<String>> customModelDataStringsSupplier, Supplier<List<Float>> customModelDataFloatsSupplier)
      Creates an instance of a GeyserItemPredicateContext record class.
      Parameters:
      dimensionSupplier - the value for the dimensionSupplier record component
      count - the value for the count record component
      maxStackSizeSupplier - the value for the maxStackSizeSupplier record component
      damageSupplier - the value for the damageSupplier record component
      maxDamageSupplier - the value for the maxDamageSupplier record component
      fishingRodCastSupplier - the value for the fishingRodCastSupplier record component
      unbreakableSupplier - the value for the unbreakableSupplier record component
      bundleFullnessSupplier - the value for the bundleFullnessSupplier record component
      trimMaterialSupplier - the value for the trimMaterialSupplier record component
      chargedProjectilesSupplier - the value for the chargedProjectilesSupplier record component
      componentsSupplier - the value for the componentsSupplier record component
      customModelDataFlagsSupplier - the value for the customModelDataFlagsSupplier record component
      customModelDataStringsSupplier - the value for the customModelDataStringsSupplier record component
      customModelDataFloatsSupplier - the value for the customModelDataFloatsSupplier record component
  • Method Details

    • dimension

      public org.geysermc.geyser.api.util.Identifier dimension()
      Specified by:
      dimension in interface org.geysermc.geyser.api.predicate.context.MinecraftPredicateContext
    • maxStackSize

      public int maxStackSize()
      Specified by:
      maxStackSize in interface org.geysermc.geyser.api.predicate.context.item.ItemPredicateContext
    • damage

      public int damage()
      Specified by:
      damage in interface org.geysermc.geyser.api.predicate.context.item.ItemPredicateContext
    • maxDamage

      public int maxDamage()
      Specified by:
      maxDamage in interface org.geysermc.geyser.api.predicate.context.item.ItemPredicateContext
    • hasFishingRodCast

      public boolean hasFishingRodCast()
      Specified by:
      hasFishingRodCast in interface org.geysermc.geyser.api.predicate.context.item.ItemPredicateContext
    • unbreakable

      public boolean unbreakable()
      Specified by:
      unbreakable in interface org.geysermc.geyser.api.predicate.context.item.ItemPredicateContext
    • bundleFullness

      public float bundleFullness()
      Specified by:
      bundleFullness in interface org.geysermc.geyser.api.predicate.context.item.ItemPredicateContext
    • trimMaterial

      public @Nullable org.geysermc.geyser.api.util.Identifier trimMaterial()
      Specified by:
      trimMaterial in interface org.geysermc.geyser.api.predicate.context.item.ItemPredicateContext
    • chargedProjectiles

      public @NonNull List<org.geysermc.geyser.api.predicate.context.item.ChargedProjectile> chargedProjectiles()
      Specified by:
      chargedProjectiles in interface org.geysermc.geyser.api.predicate.context.item.ItemPredicateContext
    • components

      public @NonNull List<org.geysermc.geyser.api.util.Identifier> components()
      Specified by:
      components in interface org.geysermc.geyser.api.predicate.context.item.ItemPredicateContext
    • customModelDataFlag

      public boolean customModelDataFlag(int index)
      Specified by:
      customModelDataFlag in interface org.geysermc.geyser.api.predicate.context.item.ItemPredicateContext
    • customModelDataString

      public String customModelDataString(int index)
      Specified by:
      customModelDataString in interface org.geysermc.geyser.api.predicate.context.item.ItemPredicateContext
    • customModelDataFloat

      public float customModelDataFloat(int index)
      Specified by:
      customModelDataFloat in interface org.geysermc.geyser.api.predicate.context.item.ItemPredicateContext
    • create

      public static org.geysermc.geyser.api.predicate.context.item.ItemPredicateContext create(GeyserSession session, int stackSize, org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents components)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • dimensionSupplier

      public Supplier<org.geysermc.geyser.api.util.Identifier> dimensionSupplier()
      Returns the value of the dimensionSupplier record component.
      Returns:
      the value of the dimensionSupplier record component
    • count

      public int count()
      Returns the value of the count record component.
      Specified by:
      count in interface org.geysermc.geyser.api.predicate.context.item.ItemPredicateContext
      Returns:
      the value of the count record component
    • maxStackSizeSupplier

      public Supplier<Integer> maxStackSizeSupplier()
      Returns the value of the maxStackSizeSupplier record component.
      Returns:
      the value of the maxStackSizeSupplier record component
    • damageSupplier

      public Supplier<Integer> damageSupplier()
      Returns the value of the damageSupplier record component.
      Returns:
      the value of the damageSupplier record component
    • maxDamageSupplier

      public Supplier<Integer> maxDamageSupplier()
      Returns the value of the maxDamageSupplier record component.
      Returns:
      the value of the maxDamageSupplier record component
    • fishingRodCastSupplier

      public Supplier<Boolean> fishingRodCastSupplier()
      Returns the value of the fishingRodCastSupplier record component.
      Returns:
      the value of the fishingRodCastSupplier record component
    • unbreakableSupplier

      public Supplier<Boolean> unbreakableSupplier()
      Returns the value of the unbreakableSupplier record component.
      Returns:
      the value of the unbreakableSupplier record component
    • bundleFullnessSupplier

      public Supplier<Float> bundleFullnessSupplier()
      Returns the value of the bundleFullnessSupplier record component.
      Returns:
      the value of the bundleFullnessSupplier record component
    • trimMaterialSupplier

      public Supplier<org.geysermc.geyser.api.util.Identifier> trimMaterialSupplier()
      Returns the value of the trimMaterialSupplier record component.
      Returns:
      the value of the trimMaterialSupplier record component
    • chargedProjectilesSupplier

      public Supplier<List<org.geysermc.geyser.api.predicate.context.item.ChargedProjectile>> chargedProjectilesSupplier()
      Returns the value of the chargedProjectilesSupplier record component.
      Returns:
      the value of the chargedProjectilesSupplier record component
    • componentsSupplier

      public Supplier<List<org.geysermc.geyser.api.util.Identifier>> componentsSupplier()
      Returns the value of the componentsSupplier record component.
      Returns:
      the value of the componentsSupplier record component
    • customModelDataFlagsSupplier

      public Supplier<List<Boolean>> customModelDataFlagsSupplier()
      Returns the value of the customModelDataFlagsSupplier record component.
      Returns:
      the value of the customModelDataFlagsSupplier record component
    • customModelDataStringsSupplier

      public Supplier<List<String>> customModelDataStringsSupplier()
      Returns the value of the customModelDataStringsSupplier record component.
      Returns:
      the value of the customModelDataStringsSupplier record component
    • customModelDataFloatsSupplier

      public Supplier<List<Float>> customModelDataFloatsSupplier()
      Returns the value of the customModelDataFloatsSupplier record component.
      Returns:
      the value of the customModelDataFloatsSupplier record component