Class GiveItemReward
java.lang.Object
petrolpark.mc.library.core.data.reward.AbstractGiveItemsReward
petrolpark.mc.library.core.data.reward.GiveItemReward
- All Implemented Interfaces:
net.minecraft.world.level.storage.loot.LootContextUser,IAbstractReward<IReward.Type>,INamedRewardInfo,IRewardInfo,IReward,ISimpleReward
@ParametersAreNonnullByDefault
public class GiveItemReward
extends AbstractGiveItemsReward
implements ISimpleReward
petrolpark:give_item
-
item-ItemStackto give to the recipient
Note that the late LootItemFunctions are not carried to the client at all.
-
Nested Class Summary
Nested classes/interfaces inherited from interface petrolpark.mc.library.core.data.reward.info.INamedRewardInfo
INamedRewardInfo.TypeNested classes/interfaces inherited from interface petrolpark.mc.library.core.data.reward.IReward
IReward.Type -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<GiveItemReward> static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, GiveItemReward> Fields inherited from class petrolpark.mc.library.core.data.reward.AbstractGiveItemsReward
compositeFunctionFields inherited from interface petrolpark.mc.library.core.data.reward.IReward
DIRECT_CODEC, SET_CODEC, TYPED_CODECFields inherited from interface petrolpark.mc.library.core.data.reward.info.IRewardInfo
DIRECT_CODEC, TYPED_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionGiveItemReward(net.minecraft.world.item.ItemStack stack) GiveItemReward(net.minecraft.world.item.ItemStack stack, List<net.minecraft.world.level.storage.loot.functions.LootItemFunction> functions) -
Method Summary
Modifier and TypeMethodDescriptionvoidgetType()voidrender(net.minecraft.client.gui.GuiGraphics graphics) net.minecraft.world.item.ItemStackstack()Stream<net.minecraft.world.item.ItemStack> streamStacks(net.minecraft.world.level.storage.loot.LootContext context) Methods inherited from class petrolpark.mc.library.core.data.reward.AbstractGiveItemsReward
getReferencedContextParams, itemFunctions, lateItemFunctionsField, reward, validateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface petrolpark.mc.library.core.data.reward.info.INamedRewardInfo
translate, translateSimpleMethods inherited from interface petrolpark.mc.library.core.data.reward.ISimpleReward
getRewardInfoType, infoMethods inherited from interface net.minecraft.world.level.storage.loot.LootContextUser
getReferencedContextParams, validate
-
Field Details
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,GiveItemReward> STREAM_CODEC
-
-
Constructor Details
-
GiveItemReward
public GiveItemReward(net.minecraft.world.item.ItemStack stack) -
GiveItemReward
public GiveItemReward(net.minecraft.world.item.ItemStack stack, List<net.minecraft.world.level.storage.loot.functions.LootItemFunction> functions)
-
-
Method Details
-
stack
public net.minecraft.world.item.ItemStack stack() -
streamStacks
public Stream<net.minecraft.world.item.ItemStack> streamStacks(net.minecraft.world.level.storage.loot.LootContext context) - Specified by:
streamStacksin classAbstractGiveItemsReward
-
render
public void render(net.minecraft.client.gui.GuiGraphics graphics) - Specified by:
renderin interfaceIRewardInfo
-
addToDescription
- Specified by:
addToDescriptionin interfaceIRewardInfo
-
getType
- Specified by:
getTypein interfaceIAbstractReward<IReward.Type>- Specified by:
getTypein interfaceISimpleReward
-