Record Class BarricadeData

java.lang.Object
java.lang.Record
net.modgarden.barricade.data.BarricadeData

public record BarricadeData(Optional<net.minecraft.network.chat.Component> name, BlockedDirections directions, Optional<net.minecraft.resources.Identifier> icon, Optional<net.minecraft.resources.Identifier> itemIcon, Optional<net.minecraft.resources.Identifier> itemBackground, Optional<net.minecraft.core.Holder<lgbt.greenhouse.silicate.api.predicate.GamePredicate<?>>> condition) extends Record
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<net.minecraft.core.Holder<BarricadeData>>
     
     
    static final com.mojang.serialization.Codec<BarricadeData>
     
    static final net.minecraft.core.IdMapper<net.minecraft.core.Holder<BarricadeData>>
     
    static final net.minecraft.world.level.chunk.Strategy<net.minecraft.core.Holder<BarricadeData>>
     
    static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, net.minecraft.core.Holder<BarricadeData>>
     
    static final BarricadeData
     
    static final net.minecraft.core.Holder<BarricadeData>
     
    static final net.minecraft.resources.Identifier
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    BarricadeData(Optional<net.minecraft.network.chat.Component> name, BlockedDirections directions, Optional<net.minecraft.resources.Identifier> icon, Optional<net.minecraft.resources.Identifier> itemIcon, Optional<net.minecraft.resources.Identifier> itemBackground, Optional<net.minecraft.core.Holder<lgbt.greenhouse.silicate.api.predicate.GamePredicate<?>>> condition)
    Creates an instance of a BarricadeData record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Optional<net.minecraft.core.Holder<lgbt.greenhouse.silicate.api.predicate.GamePredicate<?>>>
    Returns the value of the condition record component.
    Returns the value of the directions record component.
    boolean
    equals(Object other)
    Indicates whether some other object is "equal to" this one.
    int
    Returns a hash code value for this object.
    Optional<net.minecraft.resources.Identifier>
    Returns the value of the icon record component.
    Optional<net.minecraft.resources.Identifier>
    Returns the value of the itemBackground record component.
    Optional<net.minecraft.resources.Identifier>
    Returns the value of the itemIcon record component.
    Optional<net.minecraft.network.chat.Component>
    Returns the value of the name record component.
    boolean
    test(@NotNull net.minecraft.world.level.Level level, @NotNull net.minecraft.world.entity.Entity entity, net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.BlockPos pos)
     
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

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

    • DEFAULT

      public static BarricadeData DEFAULT
    • UNKNOWN_HOLDER

      public static final net.minecraft.core.Holder<BarricadeData> UNKNOWN_HOLDER
    • UNKNOWN_ICON

      public static final net.minecraft.resources.Identifier UNKNOWN_ICON
    • UNKNOWN

      public static final BarricadeData UNKNOWN
    • DIRECT_CODEC

      public static final com.mojang.serialization.Codec<BarricadeData> DIRECT_CODEC
    • CODEC

      public static final com.mojang.serialization.Codec<net.minecraft.core.Holder<BarricadeData>> CODEC
    • STREAM_CODEC

      public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, net.minecraft.core.Holder<BarricadeData>> STREAM_CODEC
    • ID_MAPPER

      public static final net.minecraft.core.IdMapper<net.minecraft.core.Holder<BarricadeData>> ID_MAPPER
    • STRATEGY

      public static final net.minecraft.world.level.chunk.Strategy<net.minecraft.core.Holder<BarricadeData>> STRATEGY
  • Constructor Details

    • BarricadeData

      public BarricadeData(Optional<net.minecraft.network.chat.Component> name, BlockedDirections directions, Optional<net.minecraft.resources.Identifier> icon, Optional<net.minecraft.resources.Identifier> itemIcon, Optional<net.minecraft.resources.Identifier> itemBackground, Optional<net.minecraft.core.Holder<lgbt.greenhouse.silicate.api.predicate.GamePredicate<?>>> condition)
      Creates an instance of a BarricadeData record class.
      Parameters:
      name - the value for the name record component
      directions - the value for the directions record component
      icon - the value for the icon record component
      itemIcon - the value for the itemIcon record component
      itemBackground - the value for the itemBackground record component
      condition - the value for the condition record component
  • Method Details

    • test

      public boolean test(@NotNull @NotNull net.minecraft.world.level.Level level, @NotNull @NotNull net.minecraft.world.entity.Entity entity, net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.BlockPos pos)
    • equals

      public boolean equals(Object other)
      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:
      other - the object with which to compare
      Returns:
      true if this object is the same as the other argument; false otherwise.
    • hashCode

      public 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
    • 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
    • name

      public Optional<net.minecraft.network.chat.Component> name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • directions

      public BlockedDirections directions()
      Returns the value of the directions record component.
      Returns:
      the value of the directions record component
    • icon

      public Optional<net.minecraft.resources.Identifier> icon()
      Returns the value of the icon record component.
      Returns:
      the value of the icon record component
    • itemIcon

      public Optional<net.minecraft.resources.Identifier> itemIcon()
      Returns the value of the itemIcon record component.
      Returns:
      the value of the itemIcon record component
    • itemBackground

      public Optional<net.minecraft.resources.Identifier> itemBackground()
      Returns the value of the itemBackground record component.
      Returns:
      the value of the itemBackground record component
    • condition

      public Optional<net.minecraft.core.Holder<lgbt.greenhouse.silicate.api.predicate.GamePredicate<?>>> condition()
      Returns the value of the condition record component.
      Returns:
      the value of the condition record component