Record Class FlaggedItemAttribute
java.lang.Object
java.lang.Record
petrolpark.mc.library.compat.create.core.world.item.attribute.FlaggedItemAttribute
- All Implemented Interfaces:
com.simibubi.create.content.logistics.item.filter.attribute.ItemAttribute,PetrolparkItemAttribute
public record FlaggedItemAttribute(net.minecraft.core.Holder<Flag> flag)
extends Record
implements PetrolparkItemAttribute
-
Nested Class Summary
Nested ClassesNested 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
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<FlaggedItemAttribute> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, FlaggedItemAttribute> -
Constructor Summary
ConstructorsConstructorDescriptionFlaggedItemAttribute(net.minecraft.core.Holder<Flag> flag) Creates an instance of aFlaggedItemAttributerecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanappliesTo(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.Level world) final booleanIndicates whether some other object is "equal to" this one.net.minecraft.core.Holder<Flag> flag()Returns the value of theflagrecord component.net.minecraft.network.chat.MutableComponentformat(boolean inverted) getType()final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.simibubi.create.content.logistics.item.filter.attribute.ItemAttribute
getTranslationParameters
-
Field Details
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,FlaggedItemAttribute> STREAM_CODEC
-
-
Constructor Details
-
FlaggedItemAttribute
Creates an instance of aFlaggedItemAttributerecord class.- Parameters:
flag- the value for theflagrecord component
-
-
Method Details
-
appliesTo
public boolean appliesTo(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.Level world) - Specified by:
appliesToin interfacecom.simibubi.create.content.logistics.item.filter.attribute.ItemAttribute
-
getType
- Specified by:
getTypein interfacecom.simibubi.create.content.logistics.item.filter.attribute.ItemAttribute
-
getTranslationKey
- Specified by:
getTranslationKeyin interfacecom.simibubi.create.content.logistics.item.filter.attribute.ItemAttribute
-
format
public net.minecraft.network.chat.MutableComponent format(boolean inverted) - Specified by:
formatin interfacecom.simibubi.create.content.logistics.item.filter.attribute.ItemAttribute- Specified by:
formatin interfacePetrolparkItemAttribute
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
flag
Returns the value of theflagrecord component.- Returns:
- the value of the
flagrecord component
-