Record Class GrantRestaurantXPTeamReward
java.lang.Object
java.lang.Record
petrolpark.mc.library.core.data.reward.team.GrantRestaurantXPTeamReward
- All Implemented Interfaces:
net.minecraft.world.level.storage.loot.LootContextUser,IAbstractReward<ITeamReward.Type>,ITeamReward
@ParametersAreNonnullByDefault
public record GrantRestaurantXPTeamReward(net.minecraft.core.Holder<Restaurant> restaurant, net.minecraft.world.level.storage.loot.providers.number.NumberProvider amount)
extends Record
implements ITeamReward
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface petrolpark.mc.library.core.data.reward.team.ITeamReward
ITeamReward.Type -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<GrantRestaurantXPTeamReward> Fields inherited from interface petrolpark.mc.library.core.data.reward.team.ITeamReward
TYPED_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionGrantRestaurantXPTeamReward(net.minecraft.core.Holder<Restaurant> restaurant, net.minecraft.world.level.storage.loot.providers.number.NumberProvider amount) Creates an instance of aGrantRestaurantXPTeamRewardrecord class. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.level.storage.loot.providers.number.NumberProvideramount()Returns the value of theamountrecord component.final booleanIndicates whether some other object is "equal to" this one.Set<net.minecraft.world.level.storage.loot.parameters.LootContextParam<?>> getType()final inthashCode()Returns a hash code value for this object.info()net.minecraft.core.Holder<Restaurant> Returns the value of therestaurantrecord component.booleanreward(ITeam team, net.minecraft.world.level.storage.loot.LootContext context, float multiplier, boolean simulate) final StringtoString()Returns a string representation of this record class.voidvalidate(net.minecraft.world.level.storage.loot.ValidationContext context)
-
Field Details
-
CODEC
-
-
Constructor Details
-
GrantRestaurantXPTeamReward
public GrantRestaurantXPTeamReward(net.minecraft.core.Holder<Restaurant> restaurant, net.minecraft.world.level.storage.loot.providers.number.NumberProvider amount) Creates an instance of aGrantRestaurantXPTeamRewardrecord class.- Parameters:
restaurant- the value for therestaurantrecord componentamount- the value for theamountrecord component
-
-
Method Details
-
reward
public boolean reward(ITeam team, net.minecraft.world.level.storage.loot.LootContext context, float multiplier, boolean simulate) - Specified by:
rewardin interfaceITeamReward
-
info
- Specified by:
infoin interfaceIAbstractReward<ITeamReward.Type>
-
getType
- Specified by:
getTypein interfaceIAbstractReward<ITeamReward.Type>
-
getReferencedContextParams
public Set<net.minecraft.world.level.storage.loot.parameters.LootContextParam<?>> getReferencedContextParams()- Specified by:
getReferencedContextParamsin interfacenet.minecraft.world.level.storage.loot.LootContextUser
-
validate
public void validate(net.minecraft.world.level.storage.loot.ValidationContext context) - Specified by:
validatein interfacenet.minecraft.world.level.storage.loot.LootContextUser
-
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). -
restaurant
Returns the value of therestaurantrecord component.- Returns:
- the value of the
restaurantrecord component
-
amount
public net.minecraft.world.level.storage.loot.providers.number.NumberProvider amount()Returns the value of theamountrecord component.- Returns:
- the value of the
amountrecord component
-