Record Class EntityRewardAndInfoType
java.lang.Object
java.lang.Record
petrolpark.mc.library.core.data.reward.entity.EntityRewardAndInfoType
- All Implemented Interfaces:
IEntityReward.Type,INamedRewardInfo.Type,IRewardInfo.Type
public record EntityRewardAndInfoType(String translationKey, com.mojang.serialization.MapCodec<? extends IEntityReward> entityRewardCodec, com.mojang.serialization.MapCodec<? extends IRewardInfo> infoCodec, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf,? extends IRewardInfo> infoStreamCodec)
extends Record
implements IEntityReward.Type, INamedRewardInfo.Type
-
Constructor Summary
ConstructorsConstructorDescriptionEntityRewardAndInfoType(String translationKey, com.mojang.serialization.MapCodec<? extends IEntityReward> entityRewardCodec, com.mojang.serialization.MapCodec<? extends IRewardInfo> infoCodec, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf, ? extends IRewardInfo> infoStreamCodec) Creates an instance of aEntityRewardAndInfoTyperecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<? extends IEntityReward> Returns the value of theentityRewardCodecrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.com.mojang.serialization.MapCodec<? extends IRewardInfo> Returns the value of theinfoCodecrecord component.net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf, ? extends IRewardInfo> Returns the value of theinfoStreamCodecrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetranslationKeyrecord component.
-
Constructor Details
-
EntityRewardAndInfoType
public EntityRewardAndInfoType(String translationKey, com.mojang.serialization.MapCodec<? extends IEntityReward> entityRewardCodec, com.mojang.serialization.MapCodec<? extends IRewardInfo> infoCodec, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf, ? extends IRewardInfo> infoStreamCodec) Creates an instance of aEntityRewardAndInfoTyperecord class.- Parameters:
translationKey- the value for thetranslationKeyrecord componententityRewardCodec- the value for theentityRewardCodecrecord componentinfoCodec- the value for theinfoCodecrecord componentinfoStreamCodec- the value for theinfoStreamCodecrecord component
-
-
Method Details
-
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). -
translationKey
Returns the value of thetranslationKeyrecord component.- Specified by:
translationKeyin interfaceINamedRewardInfo.Type- Returns:
- the value of the
translationKeyrecord component
-
entityRewardCodec
Returns the value of theentityRewardCodecrecord component.- Specified by:
entityRewardCodecin interfaceIEntityReward.Type- Returns:
- the value of the
entityRewardCodecrecord component
-
infoCodec
Returns the value of theinfoCodecrecord component.- Specified by:
infoCodecin interfaceIRewardInfo.Type- Returns:
- the value of the
infoCodecrecord component
-
infoStreamCodec
public net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf,? extends IRewardInfo> infoStreamCodec()Returns the value of theinfoStreamCodecrecord component.- Specified by:
infoStreamCodecin interfaceIRewardInfo.Type- Returns:
- the value of the
infoStreamCodecrecord component
-