Record Class TrialSpawnerConfig
java.lang.Object
java.lang.Record
net.minecraft.world.level.block.entity.trialspawner.TrialSpawnerConfig
public record TrialSpawnerConfig(int requiredPlayerRange, int spawnRange, float totalMobs, float simultaneousMobs, float totalMobsAddedPerPlayer, float simultaneousMobsAddedPerPlayer, int ticksBetweenSpawn, int targetCooldownLength, SimpleWeightedRandomList<SpawnData> spawnPotentialsDefinition, SimpleWeightedRandomList<ResourceLocation> lootTablesToEject)
extends Record
-
Field Summary
Modifier and TypeFieldDescriptionstatic TrialSpawnerConfig
private final SimpleWeightedRandomList<ResourceLocation>
The field for thelootTablesToEject
record component.static com.mojang.serialization.MapCodec<TrialSpawnerConfig>
private final int
The field for therequiredPlayerRange
record component.private final float
The field for thesimultaneousMobs
record component.private final float
The field for thesimultaneousMobsAddedPerPlayer
record component.private final SimpleWeightedRandomList<SpawnData>
The field for thespawnPotentialsDefinition
record component.private final int
The field for thespawnRange
record component.private final int
The field for thetargetCooldownLength
record component.private final int
The field for theticksBetweenSpawn
record component.private final float
The field for thetotalMobs
record component.private final float
The field for thetotalMobsAddedPerPlayer
record component. -
Constructor Summary
ConstructorDescriptionTrialSpawnerConfig
(int requiredPlayerRange, int spawnRange, float totalMobs, float simultaneousMobs, float totalMobsAddedPerPlayer, float simultaneousMobsAddedPerPlayer, int ticksBetweenSpawn, int targetCooldownLength, SimpleWeightedRandomList<SpawnData> spawnPotentialsDefinition, SimpleWeightedRandomList<ResourceLocation> lootTablesToEject) Creates an instance of aTrialSpawnerConfig
record class. -
Method Summary
Modifier and TypeMethodDescriptionint
calculateTargetSimultaneousMobs
(int p_312677_) int
calculateTargetTotalMobs
(int p_309661_) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of thelootTablesToEject
record component.int
Returns the value of therequiredPlayerRange
record component.float
Returns the value of thesimultaneousMobs
record component.float
Returns the value of thesimultaneousMobsAddedPerPlayer
record component.Returns the value of thespawnPotentialsDefinition
record component.int
Returns the value of thespawnRange
record component.int
Returns the value of thetargetCooldownLength
record component.int
Returns the value of theticksBetweenSpawn
record component.final String
toString()
Returns a string representation of this record class.float
Returns the value of thetotalMobs
record component.float
Returns the value of thetotalMobsAddedPerPlayer
record component.
-
Field Details
-
requiredPlayerRange
private final int requiredPlayerRangeThe field for therequiredPlayerRange
record component. -
spawnRange
private final int spawnRangeThe field for thespawnRange
record component. -
totalMobs
private final float totalMobsThe field for thetotalMobs
record component. -
simultaneousMobs
private final float simultaneousMobsThe field for thesimultaneousMobs
record component. -
totalMobsAddedPerPlayer
private final float totalMobsAddedPerPlayerThe field for thetotalMobsAddedPerPlayer
record component. -
simultaneousMobsAddedPerPlayer
private final float simultaneousMobsAddedPerPlayerThe field for thesimultaneousMobsAddedPerPlayer
record component. -
ticksBetweenSpawn
private final int ticksBetweenSpawnThe field for theticksBetweenSpawn
record component. -
targetCooldownLength
private final int targetCooldownLengthThe field for thetargetCooldownLength
record component. -
spawnPotentialsDefinition
The field for thespawnPotentialsDefinition
record component. -
lootTablesToEject
The field for thelootTablesToEject
record component. -
DEFAULT
-
MAP_CODEC
-
-
Constructor Details
-
TrialSpawnerConfig
public TrialSpawnerConfig(int requiredPlayerRange, int spawnRange, float totalMobs, float simultaneousMobs, float totalMobsAddedPerPlayer, float simultaneousMobsAddedPerPlayer, int ticksBetweenSpawn, int targetCooldownLength, SimpleWeightedRandomList<SpawnData> spawnPotentialsDefinition, SimpleWeightedRandomList<ResourceLocation> lootTablesToEject) Creates an instance of aTrialSpawnerConfig
record class.- Parameters:
requiredPlayerRange
- the value for therequiredPlayerRange
record componentspawnRange
- the value for thespawnRange
record componenttotalMobs
- the value for thetotalMobs
record componentsimultaneousMobs
- the value for thesimultaneousMobs
record componenttotalMobsAddedPerPlayer
- the value for thetotalMobsAddedPerPlayer
record componentsimultaneousMobsAddedPerPlayer
- the value for thesimultaneousMobsAddedPerPlayer
record componentticksBetweenSpawn
- the value for theticksBetweenSpawn
record componenttargetCooldownLength
- the value for thetargetCooldownLength
record componentspawnPotentialsDefinition
- the value for thespawnPotentialsDefinition
record componentlootTablesToEject
- the value for thelootTablesToEject
record component
-
-
Method Details
-
calculateTargetTotalMobs
public int calculateTargetTotalMobs(int p_309661_) -
calculateTargetSimultaneousMobs
public int calculateTargetSimultaneousMobs(int p_312677_) -
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 '=='. -
requiredPlayerRange
public int requiredPlayerRange()Returns the value of therequiredPlayerRange
record component.- Returns:
- the value of the
requiredPlayerRange
record component
-
spawnRange
public int spawnRange()Returns the value of thespawnRange
record component.- Returns:
- the value of the
spawnRange
record component
-
totalMobs
public float totalMobs()Returns the value of thetotalMobs
record component.- Returns:
- the value of the
totalMobs
record component
-
simultaneousMobs
public float simultaneousMobs()Returns the value of thesimultaneousMobs
record component.- Returns:
- the value of the
simultaneousMobs
record component
-
totalMobsAddedPerPlayer
public float totalMobsAddedPerPlayer()Returns the value of thetotalMobsAddedPerPlayer
record component.- Returns:
- the value of the
totalMobsAddedPerPlayer
record component
-
simultaneousMobsAddedPerPlayer
public float simultaneousMobsAddedPerPlayer()Returns the value of thesimultaneousMobsAddedPerPlayer
record component.- Returns:
- the value of the
simultaneousMobsAddedPerPlayer
record component
-
ticksBetweenSpawn
public int ticksBetweenSpawn()Returns the value of theticksBetweenSpawn
record component.- Returns:
- the value of the
ticksBetweenSpawn
record component
-
targetCooldownLength
public int targetCooldownLength()Returns the value of thetargetCooldownLength
record component.- Returns:
- the value of the
targetCooldownLength
record component
-
spawnPotentialsDefinition
Returns the value of thespawnPotentialsDefinition
record component.- Returns:
- the value of the
spawnPotentialsDefinition
record component
-
lootTablesToEject
Returns the value of thelootTablesToEject
record component.- Returns:
- the value of the
lootTablesToEject
record component
-