Record Class GiveLootReward.Info
java.lang.Object
java.lang.Record
petrolpark.mc.library.core.data.reward.GiveLootReward.Info
- All Implemented Interfaces:
INamedRewardInfo,IRewardInfo
- Enclosing class:
GiveLootReward
public static record GiveLootReward.Info(List<net.minecraft.world.item.ItemStack> possibleStacks, Optional<net.minecraft.resources.ResourceLocation> lootTableLocation)
extends Record
implements INamedRewardInfo
-
Nested Class Summary
Nested classes/interfaces inherited from interface petrolpark.mc.library.core.data.reward.info.INamedRewardInfo
INamedRewardInfo.Type -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<GiveLootReward.Info> static final net.minecraft.resources.ResourceLocationstatic final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, GiveLootReward.Info> Fields inherited from interface petrolpark.mc.library.core.data.reward.info.IRewardInfo
DIRECT_CODEC, TYPED_CODEC -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Optional<net.minecraft.resources.ResourceLocation> Returns the value of thelootTableLocationrecord component.List<net.minecraft.world.item.ItemStack> Returns the value of thepossibleStacksrecord component.voidrender(net.minecraft.client.gui.GuiGraphics graphics) final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface petrolpark.mc.library.core.data.reward.info.INamedRewardInfo
translate, translateSimple
-
Field Details
-
DIE_TEXTURE
public static final net.minecraft.resources.ResourceLocation DIE_TEXTURE -
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,GiveLootReward.Info> STREAM_CODEC
-
-
Constructor Details
-
Info
public Info(List<net.minecraft.world.item.ItemStack> possibleStacks, Optional<net.minecraft.resources.ResourceLocation> lootTableLocation) Creates an instance of aInforecord class.- Parameters:
possibleStacks- the value for thepossibleStacksrecord componentlootTableLocation- the value for thelootTableLocationrecord component
-
-
Method Details
-
render
public void render(net.minecraft.client.gui.GuiGraphics graphics) - Specified by:
renderin interfaceIRewardInfo
-
addToDescription
- Specified by:
addToDescriptionin interfaceIRewardInfo
-
getRewardInfoType
- Specified by:
getRewardInfoTypein interfaceINamedRewardInfo- Specified by:
getRewardInfoTypein interfaceIRewardInfo
-
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). -
possibleStacks
Returns the value of thepossibleStacksrecord component.- Returns:
- the value of the
possibleStacksrecord component
-
lootTableLocation
Returns the value of thelootTableLocationrecord component.- Returns:
- the value of the
lootTableLocationrecord component
-