Package com.petrolpark.util
Record Class Conversion.TaggedBlockConversion
java.lang.Object
java.lang.Record
com.petrolpark.util.Conversion.TaggedBlockConversion
- All Implemented Interfaces:
Conversion<net.minecraft.world.level.block.Block>
- Enclosing interface:
Conversion<T>
public static record Conversion.TaggedBlockConversion(net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block> tag, Supplier<net.minecraft.world.level.block.Block> result, boolean classesMustMatch)
extends Record
implements Conversion<net.minecraft.world.level.block.Block>
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.petrolpark.util.Conversion
Conversion.AlwaysConversion<T>, Conversion.ArmorItemConversion, Conversion.BlockIDRegexConversion, Conversion.BlockItemConversion, Conversion.BlockStateBlockConversion, Conversion.BlockStateConversion, Conversion.BlockStateItemStackConversion, Conversion.ColorEntityConversion, Conversion.ContainerConversion, Conversion.ConversionResult<T>, Conversion.DyedBlockConversion, Conversion.Entry<T>, Conversion.InventoryEntityConversion, Conversion.ItemEntityConversion, Conversion.ItemFrameItemConversion, Conversion.ItemIDRegexConversion, Conversion.ItemStackComponentConversion<T>, Conversion.ItemStackContainerConversion, Conversion.ItemStackConversion, Conversion.ItemStackItemConversion, Conversion.NoConversion<T>, Conversion.RegisterConversionEvent<T>, Conversion.ReplacementConversion<T>, Conversion.TaggedBlockConversion, Conversion.TaggedItemConversion, Conversion.TieredItemConversion -
Constructor Summary
ConstructorsConstructorDescriptionTaggedBlockConversion(net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block> tag, Supplier<net.minecraft.world.level.block.Block> result, boolean classesMustMatch) Creates an instance of aTaggedBlockConversionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theclassesMustMatchrecord component.Conversion.ConversionResult<net.minecraft.world.level.block.Block> convert(net.minecraft.world.level.Level level, net.minecraft.world.level.block.Block object, net.minecraft.world.entity.player.Player player) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Supplier<net.minecraft.world.level.block.Block> result()Returns the value of theresultrecord component.net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block> tag()Returns the value of thetagrecord component.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.petrolpark.util.Conversion
finish, isChildInstance, isInstance, pass, supplyPass
-
Constructor Details
-
TaggedBlockConversion
public TaggedBlockConversion(net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block> tag, Supplier<net.minecraft.world.level.block.Block> result, boolean classesMustMatch) Creates an instance of aTaggedBlockConversionrecord class.- Parameters:
tag- the value for thetagrecord componentresult- the value for theresultrecord componentclassesMustMatch- the value for theclassesMustMatchrecord component
-
-
Method Details
-
convert
public Conversion.ConversionResult<net.minecraft.world.level.block.Block> convert(net.minecraft.world.level.Level level, net.minecraft.world.level.block.Block object, @Nullable net.minecraft.world.entity.player.Player player) - Specified by:
convertin interfaceConversion<net.minecraft.world.level.block.Block>
-
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 '=='. -
tag
public net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block> tag()Returns the value of thetagrecord component.- Returns:
- the value of the
tagrecord component
-
result
Returns the value of theresultrecord component.- Returns:
- the value of the
resultrecord component
-
classesMustMatch
public boolean classesMustMatch()Returns the value of theclassesMustMatchrecord component.- Returns:
- the value of the
classesMustMatchrecord component
-