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 Details

    • EMPTY

      public static final SimpleResearchQueue EMPTY
    • CODEC

      public static final com.mojang.serialization.Codec<SimpleResearchQueue> CODEC
    • STREAM_CODEC

      public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,SimpleResearchQueue> STREAM_CODEC
    • QUEUE_LENGTH

      public static final IntSupplier QUEUE_LENGTH
  • Constructor Details

    • SimpleResearchQueue

      public SimpleResearchQueue(List<net.minecraft.resources.ResourceKey<Research>> entries)
      Creates an instance of a SimpleResearchQueue record class.
      Parameters:
      entries - the value for the entries record component
    • SimpleResearchQueue

      public SimpleResearchQueue()
  • Method Details

    • add

      public boolean add(ResearchInstance researchInstance)
      Specified by:
      add in interface ResearchQueue
      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:
      remove in interface ResearchQueue
      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:
      remove in interface ResearchQueue
      Parameters:
      index - of the element to be removed
      Returns:
      whether it was possible to remove the element
    • contains

      public boolean contains(net.minecraft.resources.ResourceKey<Research> research)
      Specified by:
      contains in interface ResearchQueue
    • get

      public net.minecraft.resources.ResourceKey<Research> get(int index)
      Specified by:
      get in interface ResearchQueue
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface ResearchQueue
    • getFirst

      public net.minecraft.resources.ResourceKey<Research> getFirst()
      Specified by:
      getFirst in interface ResearchQueue
    • current

      @Nullable public @Nullable net.minecraft.resources.ResourceKey<Research> current()
    • size

      public int size()
      Specified by:
      size in interface ResearchQueue
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • entries

      public List<net.minecraft.resources.ResourceKey<Research>> entries()
      Returns the value of the entries record component.
      Returns:
      the value of the entries record component