Record Class UnlockTradeEntityReward
java.lang.Object
java.lang.Record
com.petrolpark.core.data.reward.entity.UnlockTradeEntityReward
- All Implemented Interfaces:
IEntityReward,ITypedReward<EntityRewardType>,net.minecraft.world.level.storage.loot.LootContextUser
public record UnlockTradeEntityReward(net.minecraft.world.item.trading.MerchantOffer trade)
extends Record
implements IEntityReward
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<UnlockTradeEntityReward> Fields inherited from interface com.petrolpark.core.data.reward.entity.IEntityReward
TYPED_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionUnlockTradeEntityReward(net.minecraft.world.item.trading.MerchantOffer trade) Creates an instance of aUnlockTradeEntityRewardrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidfinal booleanIndicates whether some other object is "equal to" this one.getType()final inthashCode()Returns a hash code value for this object.voidrender(net.minecraft.client.gui.GuiGraphics graphics) voidreward(net.minecraft.world.entity.Entity entity, net.minecraft.world.level.storage.loot.LootContext context, float multiplier) final StringtoString()Returns a string representation of this record class.net.minecraft.world.item.trading.MerchantOffertrade()Returns the value of thetraderecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.petrolpark.core.data.reward.ITypedReward
translate, translateSimpleMethods inherited from interface net.minecraft.world.level.storage.loot.LootContextUser
getReferencedContextParams, validate
-
Field Details
-
CODEC
-
-
Constructor Details
-
UnlockTradeEntityReward
public UnlockTradeEntityReward(net.minecraft.world.item.trading.MerchantOffer trade) Creates an instance of aUnlockTradeEntityRewardrecord class.- Parameters:
trade- the value for thetraderecord component
-
-
Method Details
-
reward
public void reward(net.minecraft.world.entity.Entity entity, net.minecraft.world.level.storage.loot.LootContext context, float multiplier) - Specified by:
rewardin interfaceIEntityReward
-
render
public void render(net.minecraft.client.gui.GuiGraphics graphics) - Specified by:
renderin interfaceITypedReward<EntityRewardType>
-
addToDescription
- Specified by:
addToDescriptionin interfaceITypedReward<EntityRewardType>
-
getType
- Specified by:
getTypein interfaceITypedReward<EntityRewardType>
-
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). -
trade
public net.minecraft.world.item.trading.MerchantOffer trade()Returns the value of thetraderecord component.- Returns:
- the value of the
traderecord component
-