Klasse RuntimeLevelConfig
java.lang.Object
de.luckymcdev.foundryengine.common.world.level.runtime.RuntimeLevelConfig
A configuration describing how a runtime level should be constructed. This includes properties such as the dimension
type, chunk generator, and game rules.
- Siehe auch:
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifikator und TypMethodeBeschreibungnet.minecraft.world.level.dimension.LevelStemcreateDimensionOptions(net.minecraft.server.MinecraftServer server) Creates new dimension options from the servernet.minecraft.world.clock.ServerClockManagergetClockManager(net.minecraft.server.MinecraftServer server, net.minecraft.world.level.gamerules.GameRules gameRules) net.minecraft.world.DifficultyGets the current configured difficulty
It may not reflect the real difficulty, also checkshouldMirrorOverworldDifficulty()Gets the current configured gamerules
It may not reflect the real gamerules, also checkshouldMirrorOverworldGameRules()long@Nullable net.minecraft.world.level.chunk.ChunkGeneratorlonggetSeed()net.minecraft.util.TriStateisFlat()setClockManagerConstructor(Function<BooleanSupplier, RuntimeClockManager> clockManagerConstructor) Sets the clock manager constructorsetClockManagerConstructor(net.minecraft.world.clock.PackedClockStates clockStates) Sets the clock manager constructor toRuntimeClockManagerwith provided clock states as the default.setDifficulty(net.minecraft.world.Difficulty difficulty) Sets the level difficultysetDimensionType(net.minecraft.core.Holder<net.minecraft.world.level.dimension.DimensionType> dimensionType) Sets the level dimension typesetDimensionType(net.minecraft.resources.ResourceKey<net.minecraft.world.level.dimension.DimensionType> dimensionType) Sets the level dimension typesetFlat(boolean state) Defines if the level is a flat level or notsetFlat(net.minecraft.util.TriState state) Defines if the level is a flat level or notsetGameRule(net.minecraft.world.level.gamerules.GameRule<T> key, T value) Modifies a gamerule
Does nothing ifmirrorOverworldGameRulesis truesetGameTime(long gameTime) Sets the level's game timesetGenerator(net.minecraft.world.level.chunk.ChunkGenerator generator) Sets the level chunk generatorsetLevelConstructor(RuntimeLevel.Constructor constructor) Sets the level constructorsetMirrorOverworldClocks(boolean mirror) Defines if the level should follow the overworld clock values or notsetMirrorOverworldDifficulty(boolean mirror) Defines if the level should follow the overworld difficulty or notsetMirrorOverworldGameRules(boolean mirror) Defines if the level should follow the overworld gamerules or notsetSeed(long seed) Sets the level seedsetShouldTickTime(boolean shouldTickTime) Defines whenever the level should tick time.booleanbooleanbooleanboolean
-
Konstruktordetails
-
RuntimeLevelConfig
public RuntimeLevelConfig()
-
-
Methodendetails
-
setClockManagerConstructor
public RuntimeLevelConfig setClockManagerConstructor(net.minecraft.world.clock.PackedClockStates clockStates) Sets the clock manager constructor toRuntimeClockManagerwith provided clock states as the default.- Parameter:
clockStates- The clock states to initialize the clock manager from- Gibt zurück:
- The same instance of
-
setClockManagerConstructor
public RuntimeLevelConfig setClockManagerConstructor(Function<BooleanSupplier, RuntimeClockManager> clockManagerConstructor) Sets the clock manager constructor- Parameter:
clockManagerConstructor- The clock manager constructor to use- Gibt zurück:
- The same instance of
-
setDimensionType
public RuntimeLevelConfig setDimensionType(net.minecraft.core.Holder<net.minecraft.world.level.dimension.DimensionType> dimensionType) Sets the level dimension type- Parameter:
dimensionType- The dimension type to use- Gibt zurück:
- The same instance of
-
setDimensionType
public RuntimeLevelConfig setDimensionType(net.minecraft.resources.ResourceKey<net.minecraft.world.level.dimension.DimensionType> dimensionType) Sets the level dimension type- Parameter:
dimensionType- The dimension type to use- Gibt zurück:
- The same instance of
-
setShouldTickTime
Defines whenever the level should tick time.
Setting this set's theGameRules.ADVANCE_TIMEgamerule for the level to avoid jitter
The gamerule does not have effect ifmirrorOverworldGameRulesis set to true- Parameter:
shouldTickTime- Whenever the level should tick the time- Gibt zurück:
- The same instance of
-
setGameRule
public <T> RuntimeLevelConfig setGameRule(net.minecraft.world.level.gamerules.GameRule<T> key, T value) Modifies a gamerule
Does nothing ifmirrorOverworldGameRulesis true- Parameter:
key- The gamerule to modifyvalue- The value of the gamerule- Gibt zurück:
- The same instance of
-
setMirrorOverworldGameRules
Defines if the level should follow the overworld gamerules or not- Parameter:
mirror- Whenever it should mirror or not- Gibt zurück:
- The same instance of
-
setMirrorOverworldDifficulty
Defines if the level should follow the overworld difficulty or not- Parameter:
mirror- Whenever it should mirror or not- Gibt zurück:
- The same instance of
-
setMirrorOverworldClocks
Defines if the level should follow the overworld clock values or not- Parameter:
mirror- Whenever it should mirror or not- Gibt zurück:
- The same instance of
-
setFlat
Defines if the level is a flat level or not- Parameter:
state- If the level should be flat, not flat or use the default value- Gibt zurück:
- The same instance of
-
setFlat
Defines if the level is a flat level or not- Parameter:
state- If the level should be flat or not- Gibt zurück:
- The same instance of
-
getSeed
public long getSeed() -
setSeed
Sets the level seed- Parameter:
seed- The level seed to use- Gibt zurück:
- The same instance of
-
createDimensionOptions
public net.minecraft.world.level.dimension.LevelStem createDimensionOptions(net.minecraft.server.MinecraftServer server) Creates new dimension options from the server- Gibt zurück:
- The new dimension options
-
getGenerator
@Nullable public @Nullable net.minecraft.world.level.chunk.ChunkGenerator getGenerator() -
setGenerator
Sets the level chunk generator- Parameter:
generator- The chunk generator to use- Gibt zurück:
- The same instance of
-
getLevelConstructor
-
setLevelConstructor
Sets the level constructor- Parameter:
constructor- The level constructor to use- Gibt zurück:
- The same instance of
-
shouldTickTime
public boolean shouldTickTime() -
getDifficulty
public net.minecraft.world.Difficulty getDifficulty()Gets the current configured difficulty
It may not reflect the real difficulty, also checkshouldMirrorOverworldDifficulty()- Gibt zurück:
- The current difficulty stored in the config
-
setDifficulty
Sets the level difficulty- Parameter:
difficulty- The difficulty to use- Gibt zurück:
- The same instance of
-
getGameRules
Gets the current configured gamerules
It may not reflect the real gamerules, also checkshouldMirrorOverworldGameRules()- Gibt zurück:
- The current gamerules stored in the config
-
shouldMirrorOverworldGameRules
public boolean shouldMirrorOverworldGameRules() -
shouldMirrorOverworldDifficulty
public boolean shouldMirrorOverworldDifficulty() -
shouldMirrorOverworldClocks
public boolean shouldMirrorOverworldClocks() -
getGameTime
public long getGameTime() -
setGameTime
Sets the level's game time- Parameter:
gameTime- The new time of the game- Gibt zurück:
- The same instance of
-
isFlat
public net.minecraft.util.TriState isFlat() -
getClockManager
public net.minecraft.world.clock.ServerClockManager getClockManager(net.minecraft.server.MinecraftServer server, net.minecraft.world.level.gamerules.GameRules gameRules)
-