Record Class RewardAndInfoType
java.lang.Object
java.lang.Record
petrolpark.mc.library.core.data.reward.RewardAndInfoType
- All Implemented Interfaces:
INamedRewardInfo.Type,IRewardInfo.Type,IReward.Type
public record RewardAndInfoType(String translationKey, com.mojang.serialization.MapCodec<? extends IReward> rewardCodec, com.mojang.serialization.MapCodec<? extends IRewardInfo> infoCodec, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf,? extends IRewardInfo> infoStreamCodec)
extends Record
implements IReward.Type, INamedRewardInfo.Type
-
Constructor Summary
ConstructorsConstructorDescriptionRewardAndInfoType(String translationKey, com.mojang.serialization.MapCodec<? extends IReward> rewardCodec, com.mojang.serialization.MapCodec<? extends IRewardInfo> infoCodec, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf, ? extends IRewardInfo> infoStreamCodec) Creates an instance of aRewardAndInfoTyperecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal 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.com.mojang.serialization.MapCodec<? extends IReward> Returns the value of therewardCodecrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetranslationKeyrecord component.
-
Constructor Details
-
RewardAndInfoType
public RewardAndInfoType(String translationKey, com.mojang.serialization.MapCodec<? extends IReward> rewardCodec, com.mojang.serialization.MapCodec<? extends IRewardInfo> infoCodec, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf, ? extends IRewardInfo> infoStreamCodec) Creates an instance of aRewardAndInfoTyperecord class.- Parameters:
translationKey- the value for thetranslationKeyrecord componentrewardCodec- the value for therewardCodecrecord 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
-
rewardCodec
Returns the value of therewardCodecrecord component.- Specified by:
rewardCodecin interfaceIReward.Type- Returns:
- the value of the
rewardCodecrecord 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
-