Record Class ContextTeamReward
java.lang.Object
java.lang.Record
petrolpark.mc.library.core.data.reward.ContextTeamReward
- All Implemented Interfaces:
net.minecraft.world.level.storage.loot.LootContextUser,IAbstractReward<IReward.Type>,IReward,IWrappedReward<ITeamReward>
@ParametersAreNonnullByDefault
public record ContextTeamReward(net.minecraft.core.Holder<ITeamReward> rewardHolder)
extends Record
implements IWrappedReward<ITeamReward>
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface petrolpark.mc.library.core.data.reward.IReward
IReward.Type -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<ContextTeamReward> Fields inherited from interface petrolpark.mc.library.core.data.reward.IReward
DIRECT_CODEC, SET_CODEC, TYPED_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionContextTeamReward(net.minecraft.core.Holder<ITeamReward> rewardHolder) Creates an instance of aContextTeamRewardrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.getType()final inthashCode()Returns a hash code value for this object.booleanreward(net.minecraft.world.level.storage.loot.LootContext context, float multiplier, boolean simulate) net.minecraft.core.Holder<ITeamReward> Returns the value of therewardHolderrecord component.final StringtoString()Returns a string representation of this record class.wrapInfo(IRewardInfo info) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface petrolpark.mc.library.core.data.reward.IWrappedReward
info, validateMethods inherited from interface net.minecraft.world.level.storage.loot.LootContextUser
getReferencedContextParams
-
Field Details
-
CODEC
-
-
Constructor Details
-
ContextTeamReward
Creates an instance of aContextTeamRewardrecord class.- Parameters:
rewardHolder- the value for therewardHolderrecord component
-
-
Method Details
-
reward
public boolean reward(net.minecraft.world.level.storage.loot.LootContext context, float multiplier, boolean simulate) -
wrapInfo
- Specified by:
wrapInfoin interfaceIWrappedReward<ITeamReward>
-
getType
- Specified by:
getTypein interfaceIAbstractReward<IReward.Type>
-
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). -
rewardHolder
Returns the value of therewardHolderrecord component.- Specified by:
rewardHolderin interfaceIWrappedReward<ITeamReward>- Returns:
- the value of the
rewardHolderrecord component
-