Record Class DirectStringProvider
java.lang.Object
java.lang.Record
petrolpark.mc.library.core.data.stringProvider.DirectStringProvider
- All Implemented Interfaces:
net.minecraft.world.level.storage.loot.LootContextUser,StringProvider
public record DirectStringProvider(net.minecraft.network.chat.Component component)
extends Record
implements StringProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<DirectStringProvider> Fields inherited from interface petrolpark.mc.library.core.data.stringProvider.StringProvider
TYPED_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionDirectStringProvider(net.minecraft.network.chat.Component component) Creates an instance of aDirectStringProviderrecord class. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.network.chat.ComponentReturns the value of thecomponentrecord component.final booleanIndicates whether some other object is "equal to" this one.net.minecraft.network.chat.ComponentgetString(net.minecraft.world.level.storage.loot.LootContext context) 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 net.minecraft.world.level.storage.loot.LootContextUser
getReferencedContextParams, validate
-
Field Details
-
CODEC
-
-
Constructor Details
-
DirectStringProvider
public DirectStringProvider(net.minecraft.network.chat.Component component) Creates an instance of aDirectStringProviderrecord class.- Parameters:
component- the value for thecomponentrecord component
-
-
Method Details
-
getString
public net.minecraft.network.chat.Component getString(net.minecraft.world.level.storage.loot.LootContext context) - Specified by:
getStringin interfaceStringProvider
-
getStringProviderType
- Specified by:
getStringProviderTypein interfaceStringProvider
-
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). -
component
public net.minecraft.network.chat.Component component()Returns the value of thecomponentrecord component.- Returns:
- the value of the
componentrecord component
-