Package org.geysermc.geyser.item.custom
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 Summary
ConstructorsConstructorDescriptionGeyserItemPredicateContext(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 aGeyserItemPredicateContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfloatReturns the value of thebundleFullnessSupplierrecord component.@NonNull List<org.geysermc.geyser.api.predicate.context.item.ChargedProjectile>Returns the value of thechargedProjectilesSupplierrecord component.@NonNull List<org.geysermc.geyser.api.util.Identifier>Returns the value of thecomponentsSupplierrecord component.intcount()Returns the value of thecountrecord component.static org.geysermc.geyser.api.predicate.context.item.ItemPredicateContextcreate(GeyserSession session, int stackSize, org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents components) booleancustomModelDataFlag(int index) Returns the value of thecustomModelDataFlagsSupplierrecord component.floatcustomModelDataFloat(int index) Returns the value of thecustomModelDataFloatsSupplierrecord component.customModelDataString(int index) Returns the value of thecustomModelDataStringsSupplierrecord component.intdamage()Returns the value of thedamageSupplierrecord component.org.geysermc.geyser.api.util.IdentifierSupplier<org.geysermc.geyser.api.util.Identifier>Returns the value of thedimensionSupplierrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefishingRodCastSupplierrecord component.booleanfinal inthashCode()Returns a hash code value for this object.intReturns the value of themaxDamageSupplierrecord component.intReturns the value of themaxStackSizeSupplierrecord component.final StringtoString()Returns a string representation of this record class.@Nullable org.geysermc.geyser.api.util.IdentifierSupplier<org.geysermc.geyser.api.util.Identifier>Returns the value of thetrimMaterialSupplierrecord component.booleanReturns the value of theunbreakableSupplierrecord component.
-
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 aGeyserItemPredicateContextrecord class.- Parameters:
dimensionSupplier- the value for thedimensionSupplierrecord componentcount- the value for thecountrecord componentmaxStackSizeSupplier- the value for themaxStackSizeSupplierrecord componentdamageSupplier- the value for thedamageSupplierrecord componentmaxDamageSupplier- the value for themaxDamageSupplierrecord componentfishingRodCastSupplier- the value for thefishingRodCastSupplierrecord componentunbreakableSupplier- the value for theunbreakableSupplierrecord componentbundleFullnessSupplier- the value for thebundleFullnessSupplierrecord componenttrimMaterialSupplier- the value for thetrimMaterialSupplierrecord componentchargedProjectilesSupplier- the value for thechargedProjectilesSupplierrecord componentcomponentsSupplier- the value for thecomponentsSupplierrecord componentcustomModelDataFlagsSupplier- the value for thecustomModelDataFlagsSupplierrecord componentcustomModelDataStringsSupplier- the value for thecustomModelDataStringsSupplierrecord componentcustomModelDataFloatsSupplier- the value for thecustomModelDataFloatsSupplierrecord component
-
-
Method Details
-
dimension
public org.geysermc.geyser.api.util.Identifier dimension()- Specified by:
dimensionin interfaceorg.geysermc.geyser.api.predicate.context.MinecraftPredicateContext
-
maxStackSize
public int maxStackSize()- Specified by:
maxStackSizein interfaceorg.geysermc.geyser.api.predicate.context.item.ItemPredicateContext
-
damage
public int damage()- Specified by:
damagein interfaceorg.geysermc.geyser.api.predicate.context.item.ItemPredicateContext
-
maxDamage
public int maxDamage()- Specified by:
maxDamagein interfaceorg.geysermc.geyser.api.predicate.context.item.ItemPredicateContext
-
hasFishingRodCast
public boolean hasFishingRodCast()- Specified by:
hasFishingRodCastin interfaceorg.geysermc.geyser.api.predicate.context.item.ItemPredicateContext
-
unbreakable
public boolean unbreakable()- Specified by:
unbreakablein interfaceorg.geysermc.geyser.api.predicate.context.item.ItemPredicateContext
-
bundleFullness
public float bundleFullness()- Specified by:
bundleFullnessin interfaceorg.geysermc.geyser.api.predicate.context.item.ItemPredicateContext
-
trimMaterial
public @Nullable org.geysermc.geyser.api.util.Identifier trimMaterial()- Specified by:
trimMaterialin interfaceorg.geysermc.geyser.api.predicate.context.item.ItemPredicateContext
-
chargedProjectiles
public @NonNull List<org.geysermc.geyser.api.predicate.context.item.ChargedProjectile> chargedProjectiles()- Specified by:
chargedProjectilesin interfaceorg.geysermc.geyser.api.predicate.context.item.ItemPredicateContext
-
components
- Specified by:
componentsin interfaceorg.geysermc.geyser.api.predicate.context.item.ItemPredicateContext
-
customModelDataFlag
public boolean customModelDataFlag(int index) - Specified by:
customModelDataFlagin interfaceorg.geysermc.geyser.api.predicate.context.item.ItemPredicateContext
-
customModelDataString
- Specified by:
customModelDataStringin interfaceorg.geysermc.geyser.api.predicate.context.item.ItemPredicateContext
-
customModelDataFloat
public float customModelDataFloat(int index) - Specified by:
customModelDataFloatin interfaceorg.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
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
dimensionSupplier
Returns the value of thedimensionSupplierrecord component.- Returns:
- the value of the
dimensionSupplierrecord component
-
count
public int count()Returns the value of thecountrecord component.- Specified by:
countin interfaceorg.geysermc.geyser.api.predicate.context.item.ItemPredicateContext- Returns:
- the value of the
countrecord component
-
maxStackSizeSupplier
Returns the value of themaxStackSizeSupplierrecord component.- Returns:
- the value of the
maxStackSizeSupplierrecord component
-
damageSupplier
Returns the value of thedamageSupplierrecord component.- Returns:
- the value of the
damageSupplierrecord component
-
maxDamageSupplier
Returns the value of themaxDamageSupplierrecord component.- Returns:
- the value of the
maxDamageSupplierrecord component
-
fishingRodCastSupplier
Returns the value of thefishingRodCastSupplierrecord component.- Returns:
- the value of the
fishingRodCastSupplierrecord component
-
unbreakableSupplier
Returns the value of theunbreakableSupplierrecord component.- Returns:
- the value of the
unbreakableSupplierrecord component
-
bundleFullnessSupplier
Returns the value of thebundleFullnessSupplierrecord component.- Returns:
- the value of the
bundleFullnessSupplierrecord component
-
trimMaterialSupplier
Returns the value of thetrimMaterialSupplierrecord component.- Returns:
- the value of the
trimMaterialSupplierrecord component
-
chargedProjectilesSupplier
public Supplier<List<org.geysermc.geyser.api.predicate.context.item.ChargedProjectile>> chargedProjectilesSupplier()Returns the value of thechargedProjectilesSupplierrecord component.- Returns:
- the value of the
chargedProjectilesSupplierrecord component
-
componentsSupplier
Returns the value of thecomponentsSupplierrecord component.- Returns:
- the value of the
componentsSupplierrecord component
-
customModelDataFlagsSupplier
Returns the value of thecustomModelDataFlagsSupplierrecord component.- Returns:
- the value of the
customModelDataFlagsSupplierrecord component
-
customModelDataStringsSupplier
Returns the value of thecustomModelDataStringsSupplierrecord component.- Returns:
- the value of the
customModelDataStringsSupplierrecord component
-
customModelDataFloatsSupplier
Returns the value of thecustomModelDataFloatsSupplierrecord component.- Returns:
- the value of the
customModelDataFloatsSupplierrecord component
-