Record Class UnlockItemEffectData
java.lang.Object
java.lang.Record
com.portingdeadmods.researchd.impl.research.effect.data.UnlockItemEffectData
- All Implemented Interfaces:
ResearchEffectData<UnlockItemEffect>
public record UnlockItemEffectData(com.portingdeadmods.portingdeadlibs.utils.UniqueArray<net.minecraft.resources.ResourceKey<net.minecraft.world.item.Item>> blockedItems)
extends Record
implements ResearchEffectData<UnlockItemEffect>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<UnlockItemEffectData> static final UnlockItemEffectDatastatic final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, UnlockItemEffectData> -
Constructor Summary
ConstructorsConstructorDescriptionUnlockItemEffectData(com.portingdeadmods.portingdeadlibs.utils.UniqueArray<net.minecraft.resources.ResourceKey<net.minecraft.world.item.Item>> blockedItems) Creates an instance of aUnlockItemEffectDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionadd(UnlockItemEffect effect, net.minecraft.world.level.Level level) com.portingdeadmods.portingdeadlibs.utils.UniqueArray<net.minecraft.resources.ResourceKey<net.minecraft.world.item.Item>> Returns the value of theblockedItemsrecord component.final booleanIndicates whether some other object is "equal to" this one.com.portingdeadmods.portingdeadlibs.utils.UniqueArray<net.minecraft.resources.ResourceKey<net.minecraft.world.item.Item>> getAll()getDefault(net.minecraft.world.level.Level level) This method should return a 'default' instance of the Data class As a default, it should hold all the effects as if they weren't researched yet.final inthashCode()Returns a hash code value for this object.booleanisBlocked(net.minecraft.world.item.Item item) booleanisBlocked(net.minecraft.world.item.ItemStack stack) remove(UnlockItemEffect effect, net.minecraft.world.level.Level level) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
EMPTY
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf,UnlockItemEffectData> STREAM_CODEC
-
-
Constructor Details
-
UnlockItemEffectData
public UnlockItemEffectData(com.portingdeadmods.portingdeadlibs.utils.UniqueArray<net.minecraft.resources.ResourceKey<net.minecraft.world.item.Item>> blockedItems) Creates an instance of aUnlockItemEffectDatarecord class.- Parameters:
blockedItems- the value for theblockedItemsrecord component
-
-
Method Details
-
add
- Specified by:
addin interfaceResearchEffectData<UnlockItemEffect>
-
remove
- Specified by:
removein interfaceResearchEffectData<UnlockItemEffect>
-
isBlocked
public boolean isBlocked(net.minecraft.world.item.ItemStack stack) -
isBlocked
public boolean isBlocked(net.minecraft.world.item.Item item) -
getDefault
Description copied from interface:ResearchEffectDataThis method should return a 'default' instance of the Data class As a default, it should hold all the effects as if they weren't researched yet.- Specified by:
getDefaultin interfaceResearchEffectData<UnlockItemEffect>
-
getAll
public com.portingdeadmods.portingdeadlibs.utils.UniqueArray<net.minecraft.resources.ResourceKey<net.minecraft.world.item.Item>> getAll()- Specified by:
getAllin interfaceResearchEffectData<UnlockItemEffect>
-
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). -
blockedItems
public com.portingdeadmods.portingdeadlibs.utils.UniqueArray<net.minecraft.resources.ResourceKey<net.minecraft.world.item.Item>> blockedItems()Returns the value of theblockedItemsrecord component.- Returns:
- the value of the
blockedItemsrecord component
-