Record Class SpawnRules
java.lang.Object
java.lang.Record
net.lcc.sollib.api.common.registry.data.entity.SpawnRules
-
Constructor Summary
ConstructorsConstructorDescriptionSpawnRules(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 aSpawnRulesrecord class. -
Method Summary
Modifier and TypeMethodDescriptionList<net.minecraft.resources.ResourceKey<net.minecraft.world.level.biome.Biome>> Returns the value of thebiomeKeysrecord component.List<net.minecraft.tags.TagKey<net.minecraft.world.level.biome.Biome>> Returns the value of thebiomeTagsrecord component.net.minecraft.world.entity.MobCategorycategory()Returns the value of thecategoryrecord component.static SpawnRulescreate(List<String> biomes, net.minecraft.world.entity.MobCategory category, int weight, int min, int max) com.google.gson.JsonObjectcreateBiomeModifier(com.google.gson.JsonObject json, net.minecraft.resources.ResourceLocation entity) com.google.gson.JsonObjectcreateTag(com.google.gson.JsonObject json, net.minecraft.resources.ResourceLocation entity) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanmatchesBiome(Predicate<net.minecraft.resources.ResourceKey<net.minecraft.world.level.biome.Biome>> isBiome, Predicate<net.minecraft.tags.TagKey<net.minecraft.world.level.biome.Biome>> isTag) intmax()Returns the value of themaxrecord component.intmin()Returns the value of theminrecord component.final StringtoString()Returns a string representation of this record class.intweight()Returns the value of theweightrecord component.
-
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 aSpawnRulesrecord class.- Parameters:
biomeKeys- the value for thebiomeKeysrecord componentbiomeTags- the value for thebiomeTagsrecord componentcategory- the value for thecategoryrecord componentweight- the value for theweightrecord componentmin- the value for theminrecord componentmax- the value for themaxrecord component
-
-
Method Details
-
create
public static SpawnRules create(List<String> biomes, net.minecraft.world.entity.MobCategory category, int weight, int min, int max) -
matchesBiome
-
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
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
biomeKeys
Returns the value of thebiomeKeysrecord component.- Returns:
- the value of the
biomeKeysrecord component
-
biomeTags
Returns the value of thebiomeTagsrecord component.- Returns:
- the value of the
biomeTagsrecord component
-
category
public net.minecraft.world.entity.MobCategory category()Returns the value of thecategoryrecord component.- Returns:
- the value of the
categoryrecord component
-
weight
public int weight()Returns the value of theweightrecord component.- Returns:
- the value of the
weightrecord component
-
min
public int min()Returns the value of theminrecord component.- Returns:
- the value of the
minrecord component
-
max
public int max()Returns the value of themaxrecord component.- Returns:
- the value of the
maxrecord component
-