Record Class SpawnRules

java.lang.Object
java.lang.Record
net.lcc.sollib.api.common.registry.data.entity.SpawnRules

public record SpawnRules(List<net.minecraft.resources.ResourceKey<net.minecraft.world.level.biome.Biome>> biomeKeys, List<net.minecraft.tags.TagKey<net.minecraft.world.level.biome.Biome>> biomeTags, net.minecraft.world.entity.MobCategory category, int weight, int min, int max) extends Record
  • Constructor Summary

    Constructors
    Constructor
    Description
    SpawnRules(List<net.minecraft.resources.ResourceKey<net.minecraft.world.level.biome.Biome>> biomeKeys, List<net.minecraft.tags.TagKey<net.minecraft.world.level.biome.Biome>> biomeTags, net.minecraft.world.entity.MobCategory category, int weight, int min, int max)
    Creates an instance of a SpawnRules record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    List<net.minecraft.resources.ResourceKey<net.minecraft.world.level.biome.Biome>>
    Returns the value of the biomeKeys record component.
    List<net.minecraft.tags.TagKey<net.minecraft.world.level.biome.Biome>>
    Returns the value of the biomeTags record component.
    net.minecraft.world.entity.MobCategory
    Returns the value of the category record component.
    static SpawnRules
    create(List<String> biomes, net.minecraft.world.entity.MobCategory category, int weight, int min, int max)
     
    com.google.gson.JsonObject
    createBiomeModifier(com.google.gson.JsonObject json, net.minecraft.resources.ResourceLocation entity)
     
    com.google.gson.JsonObject
    createTag(com.google.gson.JsonObject json, net.minecraft.resources.ResourceLocation entity)
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
    matchesBiome(Predicate<net.minecraft.resources.ResourceKey<net.minecraft.world.level.biome.Biome>> isBiome, Predicate<net.minecraft.tags.TagKey<net.minecraft.world.level.biome.Biome>> isTag)
     
    int
    max()
    Returns the value of the max record component.
    int
    min()
    Returns the value of the min record component.
    final String
    Returns a string representation of this record class.
    int
    Returns the value of the weight record component.

    Methods inherited from class java.lang.Object

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

    • SpawnRules

      public SpawnRules(List<net.minecraft.resources.ResourceKey<net.minecraft.world.level.biome.Biome>> biomeKeys, List<net.minecraft.tags.TagKey<net.minecraft.world.level.biome.Biome>> biomeTags, net.minecraft.world.entity.MobCategory category, int weight, int min, int max)
      Creates an instance of a SpawnRules record class.
      Parameters:
      biomeKeys - the value for the biomeKeys record component
      biomeTags - the value for the biomeTags record component
      category - the value for the category record component
      weight - the value for the weight record component
      min - the value for the min record component
      max - the value for the max record component
  • Method Details

    • create

      public static SpawnRules create(List<String> biomes, net.minecraft.world.entity.MobCategory category, int weight, int min, int max)
    • matchesBiome

      public boolean matchesBiome(Predicate<net.minecraft.resources.ResourceKey<net.minecraft.world.level.biome.Biome>> isBiome, Predicate<net.minecraft.tags.TagKey<net.minecraft.world.level.biome.Biome>> isTag)
    • createBiomeModifier

      public com.google.gson.JsonObject createBiomeModifier(com.google.gson.JsonObject json, net.minecraft.resources.ResourceLocation entity)
    • createTag

      public com.google.gson.JsonObject createTag(com.google.gson.JsonObject json, net.minecraft.resources.ResourceLocation entity)
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • biomeKeys

      public List<net.minecraft.resources.ResourceKey<net.minecraft.world.level.biome.Biome>> biomeKeys()
      Returns the value of the biomeKeys record component.
      Returns:
      the value of the biomeKeys record component
    • biomeTags

      public List<net.minecraft.tags.TagKey<net.minecraft.world.level.biome.Biome>> biomeTags()
      Returns the value of the biomeTags record component.
      Returns:
      the value of the biomeTags record component
    • category

      public net.minecraft.world.entity.MobCategory category()
      Returns the value of the category record component.
      Returns:
      the value of the category record component
    • weight

      public int weight()
      Returns the value of the weight record component.
      Returns:
      the value of the weight record component
    • min

      public int min()
      Returns the value of the min record component.
      Returns:
      the value of the min record component
    • max

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