Record Class HasContaminantItemAttribute

java.lang.Object
java.lang.Record
com.petrolpark.compat.create.core.item.HasContaminantItemAttribute
All Implemented Interfaces:
com.simibubi.create.content.logistics.item.filter.attribute.ItemAttribute

public record HasContaminantItemAttribute(net.minecraft.core.Holder<Contaminant> contaminantHolder) extends Record implements com.simibubi.create.content.logistics.item.filter.attribute.ItemAttribute
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     

    Nested classes/interfaces inherited from interface com.simibubi.create.content.logistics.item.filter.attribute.ItemAttribute

    com.simibubi.create.content.logistics.item.filter.attribute.ItemAttribute.ItemAttributeEntry
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.MapCodec<HasContaminantItemAttribute>
     
    static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,HasContaminantItemAttribute>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    HasContaminantItemAttribute(net.minecraft.core.Holder<Contaminant> contaminantHolder)
    Creates an instance of a HasContaminantItemAttribute record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    appliesTo(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.Level world)
     
    net.minecraft.core.Holder<Contaminant>
    Returns the value of the contaminantHolder record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
     
     
    com.simibubi.create.content.logistics.item.filter.attribute.ItemAttributeType
     
    final int
    Returns a hash code value for this object.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.simibubi.create.content.logistics.item.filter.attribute.ItemAttribute

    format
  • Field Details

  • Constructor Details

    • HasContaminantItemAttribute

      public HasContaminantItemAttribute(net.minecraft.core.Holder<Contaminant> contaminantHolder)
      Creates an instance of a HasContaminantItemAttribute record class.
      Parameters:
      contaminantHolder - the value for the contaminantHolder record component
  • Method Details

    • appliesTo

      public boolean appliesTo(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.Level world)
      Specified by:
      appliesTo in interface com.simibubi.create.content.logistics.item.filter.attribute.ItemAttribute
    • getType

      public com.simibubi.create.content.logistics.item.filter.attribute.ItemAttributeType getType()
      Specified by:
      getType in interface com.simibubi.create.content.logistics.item.filter.attribute.ItemAttribute
    • getTranslationKey

      public String getTranslationKey()
      Specified by:
      getTranslationKey in interface com.simibubi.create.content.logistics.item.filter.attribute.ItemAttribute
    • getTranslationParameters

      public Object[] getTranslationParameters()
      Specified by:
      getTranslationParameters in interface com.simibubi.create.content.logistics.item.filter.attribute.ItemAttribute
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • contaminantHolder

      public net.minecraft.core.Holder<Contaminant> contaminantHolder()
      Returns the value of the contaminantHolder record component.
      Returns:
      the value of the contaminantHolder record component