Record Class SimpleResearchQueue
java.lang.Object
java.lang.Record
com.portingdeadmods.researchd.impl.research.SimpleResearchQueue
- All Implemented Interfaces:
ResearchQueue
public record SimpleResearchQueue(List<net.minecraft.resources.ResourceKey<Research>> entries)
extends Record
implements ResearchQueue
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<SimpleResearchQueue> static final SimpleResearchQueuestatic final IntSupplierstatic final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, SimpleResearchQueue> -
Constructor Summary
ConstructorsConstructorDescriptionSimpleResearchQueue(List<net.minecraft.resources.ResourceKey<Research>> entries) Creates an instance of aSimpleResearchQueuerecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(ResearchInstance researchInstance) boolean@Nullable net.minecraft.resources.ResourceKey<Research> current()entries()Returns the value of theentriesrecord component.final booleanIndicates whether some other object is "equal to" this one.net.minecraft.resources.ResourceKey<Research> get(int index) net.minecraft.resources.ResourceKey<Research> getFirst()final inthashCode()Returns a hash code value for this object.booleanisEmpty()booleanremove(int index, boolean removeChildren) booleanintsize()final StringtoString()Returns a string representation of this record class.
-
Field Details
-
EMPTY
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,SimpleResearchQueue> STREAM_CODEC -
QUEUE_LENGTH
-
-
Constructor Details
-
SimpleResearchQueue
Creates an instance of aSimpleResearchQueuerecord class.- Parameters:
entries- the value for theentriesrecord component
-
SimpleResearchQueue
public SimpleResearchQueue()
-
-
Method Details
-
add
- Specified by:
addin interfaceResearchQueue- Parameters:
researchInstance- the instance that should be added to the queue- Returns:
- whether it was possible to add the element to the queue
-
remove
public boolean remove(net.minecraft.resources.ResourceKey<Research> researchKey, boolean removeChildren) - Specified by:
removein interfaceResearchQueue- Parameters:
researchKey- the element to be removed- Returns:
- whether it was possible to remove the element
-
remove
public boolean remove(int index, boolean removeChildren) - Specified by:
removein interfaceResearchQueue- Parameters:
index- of the element to be removed- Returns:
- whether it was possible to remove the element
-
contains
- Specified by:
containsin interfaceResearchQueue
-
get
- Specified by:
getin interfaceResearchQueue
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceResearchQueue
-
getFirst
- Specified by:
getFirstin interfaceResearchQueue
-
current
-
size
public int size()- Specified by:
sizein interfaceResearchQueue
-
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). -
entries
Returns the value of theentriesrecord component.- Returns:
- the value of the
entriesrecord component
-