Package net.minecraftforge.common.world
Record Class ForgeBiomeModifiers.RemoveSpawnsBiomeModifier
java.lang.Object
java.lang.Record
net.minecraftforge.common.world.ForgeBiomeModifiers.RemoveSpawnsBiomeModifier
- Record Components:
biomes
- Biomes to add mob spawns to.entityTypes
- EntityTypes to remove from spawn lists.
- All Implemented Interfaces:
BiomeModifier
- Enclosing class:
ForgeBiomeModifiers
public static record ForgeBiomeModifiers.RemoveSpawnsBiomeModifier(HolderSet<Biome> biomes, HolderSet<EntityType<?>> entityTypes)
extends Record
implements BiomeModifier
Stock biome modifier that removes mob spawns from a biome. Has the following json format:
{ "type": "forge:add_spawns", // Required "biomes": "#namespace:biome_tag", // Accepts a biome id, [list of biome ids], or #namespace:biome_tag "entity_types": #namespace:entitytype_tag // Accepts an entity type, [list of entity types], or #namespace:entitytype_tag }
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraftforge.common.world.BiomeModifier
BiomeModifier.Phase
-
Field Summary
Modifier and TypeFieldDescriptionThe field for thebiomes
record component.static final com.mojang.serialization.MapCodec
<ForgeBiomeModifiers.RemoveSpawnsBiomeModifier> private final HolderSet
<EntityType<?>> The field for theentityTypes
record component.Fields inherited from interface net.minecraftforge.common.world.BiomeModifier
DIRECT_CODEC, LIST_CODEC, REFERENCE_CODEC
-
Constructor Summary
ConstructorDescriptionRemoveSpawnsBiomeModifier
(HolderSet<Biome> biomes, HolderSet<EntityType<?>> entityTypes) Creates an instance of aRemoveSpawnsBiomeModifier
record class. -
Method Summary
Modifier and TypeMethodDescriptionbiomes()
Returns the value of thebiomes
record component.com.mojang.serialization.MapCodec
<? extends BiomeModifier> codec()
HolderSet
<EntityType<?>> Returns the value of theentityTypes
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.void
modify
(Holder<Biome> biome, BiomeModifier.Phase phase, ModifiableBiomeInfo.BiomeInfo.Builder builder) Modifies the information via the provided biome builder.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
biomes
The field for thebiomes
record component. -
entityTypes
The field for theentityTypes
record component. -
CODEC
public static final com.mojang.serialization.MapCodec<ForgeBiomeModifiers.RemoveSpawnsBiomeModifier> CODEC
-
-
Constructor Details
-
RemoveSpawnsBiomeModifier
Creates an instance of aRemoveSpawnsBiomeModifier
record class.- Parameters:
biomes
- the value for thebiomes
record componententityTypes
- the value for theentityTypes
record component
-
-
Method Details
-
modify
public void modify(Holder<Biome> biome, BiomeModifier.Phase phase, ModifiableBiomeInfo.BiomeInfo.Builder builder) Description copied from interface:BiomeModifier
Modifies the information via the provided biome builder. Allows mob spawns and world-gen features to be added or removed, and climate and client effects to be modified.- Specified by:
modify
in interfaceBiomeModifier
- Parameters:
biome
- the named biome being modified (with original data readable).phase
- biome modification phase. Biome modifiers apply in each phase in order of the enum constants.builder
- mutable biome info builder. Apply changes to this.
-
codec
- Specified by:
codec
in interfaceBiomeModifier
- Returns:
- the codec which serializes and deserializes this biome modifier
-
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
biomes
Returns the value of thebiomes
record component.- Returns:
- the value of the
biomes
record component
-
entityTypes
Returns the value of theentityTypes
record component.- Returns:
- the value of the
entityTypes
record component
-