Record Class ReactorMobs
java.lang.Object
java.lang.Record
net.darkhax.retroreactors.common.data.reactor.ReactorMobs
- Record Components:
spawnAmount- The amount of random mobs to spawn.random- The pool of random mobs. Optional, and can be empty.always- A pool of mobs that always spawn. Optional, and can be empty.
public record ReactorMobs(net.minecraft.world.level.storage.loot.providers.number.NumberProvider spawnRadius, net.minecraft.world.level.storage.loot.providers.number.NumberProvider spawnAmount, net.minecraft.util.random.WeightedList<net.minecraft.world.item.component.TypedEntityData<net.minecraft.world.entity.EntityType<?>>> random, List<net.minecraft.world.item.component.TypedEntityData<net.minecraft.world.entity.EntityType<?>>> always)
extends Record
Represents mob spawning logic for a reactor tower.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionReactorMobs(net.minecraft.world.level.storage.loot.providers.number.NumberProvider spawnRadius, net.minecraft.world.level.storage.loot.providers.number.NumberProvider spawnAmount, net.minecraft.util.random.WeightedList<net.minecraft.world.item.component.TypedEntityData<net.minecraft.world.entity.EntityType<?>>> random, List<net.minecraft.world.item.component.TypedEntityData<net.minecraft.world.entity.EntityType<?>>> always) Creates an instance of aReactorMobsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionList<net.minecraft.world.item.component.TypedEntityData<net.minecraft.world.entity.EntityType<?>>> always()Returns the value of thealwaysrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.net.minecraft.util.random.WeightedList<net.minecraft.world.item.component.TypedEntityData<net.minecraft.world.entity.EntityType<?>>> random()Returns the value of therandomrecord component.net.minecraft.world.level.storage.loot.providers.number.NumberProviderReturns the value of thespawnAmountrecord component.voidspawnMobs(net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos centerPos, net.minecraft.world.level.storage.loot.LootContext lootContext) Spawns mobs from the configuration into the reactor.net.minecraft.world.level.storage.loot.providers.number.NumberProviderReturns the value of thespawnRadiusrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
-
Constructor Details
-
ReactorMobs
public ReactorMobs(net.minecraft.world.level.storage.loot.providers.number.NumberProvider spawnRadius, net.minecraft.world.level.storage.loot.providers.number.NumberProvider spawnAmount, net.minecraft.util.random.WeightedList<net.minecraft.world.item.component.TypedEntityData<net.minecraft.world.entity.EntityType<?>>> random, List<net.minecraft.world.item.component.TypedEntityData<net.minecraft.world.entity.EntityType<?>>> always) Creates an instance of aReactorMobsrecord class.- Parameters:
spawnRadius- the value for thespawnRadiusrecord componentspawnAmount- the value for thespawnAmountrecord componentrandom- the value for therandomrecord componentalways- the value for thealwaysrecord component
-
-
Method Details
-
spawnMobs
public void spawnMobs(net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos centerPos, net.minecraft.world.level.storage.loot.LootContext lootContext) Spawns mobs from the configuration into the reactor.- Parameters:
level- The level to spawn mobs within.centerPos- The center of the reactor layer to spawn mobs within.
-
toString
-
hashCode
-
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). -
spawnRadius
public net.minecraft.world.level.storage.loot.providers.number.NumberProvider spawnRadius()Returns the value of thespawnRadiusrecord component.- Returns:
- the value of the
spawnRadiusrecord component
-
spawnAmount
public net.minecraft.world.level.storage.loot.providers.number.NumberProvider spawnAmount()Returns the value of thespawnAmountrecord component.- Returns:
- the value of the
spawnAmountrecord component
-
random
-
always
-