Record Class LevelSettings
java.lang.Object
java.lang.Record
net.minecraft.world.level.LevelSettings
public record LevelSettings(String levelName, GameType gameType, LevelSettings.DifficultySettings difficultySettings, boolean allowCommands, WorldDataConfiguration dataConfiguration, com.mojang.serialization.Lifecycle lifecycle)
extends Record
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanThe field for theallowCommandsrecord component.private final WorldDataConfigurationThe field for thedataConfigurationrecord component.private final LevelSettings.DifficultySettingsThe field for thedifficultySettingsrecord component.private final GameTypeThe field for thegameTyperecord component.private final StringThe field for thelevelNamerecord component.private final com.mojang.serialization.LifecycleThe field for thelifecyclerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionLevelSettings(String levelName, GameType gameType, LevelSettings.DifficultySettings difficultySettings, boolean allowCommands, WorldDataConfiguration dataConfiguration) LevelSettings(String levelName, GameType gameType, LevelSettings.DifficultySettings difficultySettings, boolean allowCommands, WorldDataConfiguration dataConfiguration, com.mojang.serialization.Lifecycle lifecycle) Creates an instance of aLevelSettingsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theallowCommandsrecord component.copy()Returns the value of thedataConfigurationrecord component.Returns the value of thedifficultySettingsrecord component.final booleanIndicates whether some other object is "equal to" this one.gameType()Returns the value of thegameTyperecord component.com.mojang.serialization.Lifecyclefinal inthashCode()Returns a hash code value for this object.Returns the value of thelevelNamerecord component.com.mojang.serialization.LifecycleReturns the value of thelifecyclerecord component.static LevelSettingsparse(com.mojang.serialization.Dynamic<?> input, WorldDataConfiguration loadConfig) final StringtoString()Returns a string representation of this record class.withDataConfiguration(WorldDataConfiguration dataConfiguration) withDifficulty(Difficulty difficulty) withDifficultyLock(boolean locked) withGameType(GameType gameType) withLifecycle(com.mojang.serialization.Lifecycle lifecycle)
-
Field Details
-
levelName
The field for thelevelNamerecord component. -
gameType
The field for thegameTyperecord component. -
difficultySettings
The field for thedifficultySettingsrecord component. -
allowCommands
private final boolean allowCommandsThe field for theallowCommandsrecord component. -
dataConfiguration
The field for thedataConfigurationrecord component. -
lifecycle
private final com.mojang.serialization.Lifecycle lifecycleThe field for thelifecyclerecord component.
-
-
Constructor Details
-
LevelSettings
public LevelSettings(String levelName, GameType gameType, LevelSettings.DifficultySettings difficultySettings, boolean allowCommands, WorldDataConfiguration dataConfiguration) -
LevelSettings
public LevelSettings(String levelName, GameType gameType, LevelSettings.DifficultySettings difficultySettings, boolean allowCommands, WorldDataConfiguration dataConfiguration, com.mojang.serialization.Lifecycle lifecycle) Creates an instance of aLevelSettingsrecord class.- Parameters:
levelName- the value for thelevelNamerecord componentgameType- the value for thegameTyperecord componentdifficultySettings- the value for thedifficultySettingsrecord componentallowCommands- the value for theallowCommandsrecord componentdataConfiguration- the value for thedataConfigurationrecord componentlifecycle- the value for thelifecyclerecord component
-
-
Method Details
-
parse
public static LevelSettings parse(com.mojang.serialization.Dynamic<?> input, WorldDataConfiguration loadConfig) -
withGameType
-
withDifficulty
-
withDifficultyLock
-
withDataConfiguration
-
withLifecycle
-
copy
-
getLifecycle
public com.mojang.serialization.Lifecycle getLifecycle() -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
levelName
Returns the value of thelevelNamerecord component.- Returns:
- the value of the
levelNamerecord component
-
gameType
Returns the value of thegameTyperecord component.- Returns:
- the value of the
gameTyperecord component
-
difficultySettings
Returns the value of thedifficultySettingsrecord component.- Returns:
- the value of the
difficultySettingsrecord component
-
allowCommands
public boolean allowCommands()Returns the value of theallowCommandsrecord component.- Returns:
- the value of the
allowCommandsrecord component
-
dataConfiguration
Returns the value of thedataConfigurationrecord component.- Returns:
- the value of the
dataConfigurationrecord component
-
lifecycle
public com.mojang.serialization.Lifecycle lifecycle()Returns the value of thelifecyclerecord component.- Returns:
- the value of the
lifecyclerecord component
-