Record Class ObeliskFuel

java.lang.Object
java.lang.Record
at.minecraftschurli.mods.arsmagicalegacy.api.etherium.ObeliskFuel
Record Components:
burnTime - The burn time of the obelisk fuel, in ticks.
etheriumPerTick - The etherium generated by the obelisk fuel each tick.

public record ObeliskFuel(int burnTime, int etheriumPerTick) extends Record
Represents an obelisk fuel.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<ObeliskFuel>
     
    static final net.neoforged.neoforge.registries.datamaps.DataMapType<net.minecraft.world.item.Item, ObeliskFuel>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ObeliskFuel(int burnTime, int etheriumPerTick)
    Creates an instance of a ObeliskFuel record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the burnTime record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    int
    Returns the value of the etheriumPerTick record component.
    static @Nullable ObeliskFuel
    getFuel(net.minecraft.world.item.ItemStack stack)
     
    final int
    Returns a hash code value for this object.
    static boolean
    isFuel(net.minecraft.world.item.ItemStack stack)
     
    final String
    Returns a string representation of this record class.
    int
     

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<ObeliskFuel> CODEC
    • DATA_MAP

      public static final net.neoforged.neoforge.registries.datamaps.DataMapType<net.minecraft.world.item.Item, ObeliskFuel> DATA_MAP
  • Constructor Details

    • ObeliskFuel

      public ObeliskFuel(int burnTime, int etheriumPerTick)
      Creates an instance of a ObeliskFuel record class.
      Parameters:
      burnTime - the value for the burnTime record component
      etheriumPerTick - the value for the etheriumPerTick record component
  • Method Details

    • totalEtherium

      public int totalEtherium()
      Returns:
      The total etherium that burning the obelisk fuel will generate.
    • getFuel

      public static @Nullable ObeliskFuel getFuel(net.minecraft.world.item.ItemStack stack)
      Parameters:
      stack - The ItemStack to get the ObeliskFuel for.
      Returns:
      The ObeliskFuel for the given ItemStack, or null if no such ObeliskFuel exists.
    • isFuel

      public static boolean isFuel(net.minecraft.world.item.ItemStack stack)
      Parameters:
      stack - The ItemStack to check.
      Returns:
      Whether the given ItemStack is an ObeliskFuel or not.
    • 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 the compare method from their corresponding wrapper classes.
      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.
    • burnTime

      public int burnTime()
      Returns the value of the burnTime record component.
      Returns:
      the value of the burnTime record component
    • etheriumPerTick

      public int etheriumPerTick()
      Returns the value of the etheriumPerTick record component.
      Returns:
      the value of the etheriumPerTick record component