Klasse RuntimeLevelConfig

java.lang.Object
de.luckymcdev.foundryengine.common.world.level.runtime.RuntimeLevelConfig

public class RuntimeLevelConfig extends Object
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:
  • Konstruktordetails

    • RuntimeLevelConfig

      public RuntimeLevelConfig()
  • Methodendetails

    • setClockManagerConstructor

      public RuntimeLevelConfig setClockManagerConstructor(net.minecraft.world.clock.PackedClockStates clockStates)
      Sets the clock manager constructor to RuntimeClockManager with 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

      public RuntimeLevelConfig setShouldTickTime(boolean shouldTickTime)
      Defines whenever the level should tick time.
      Setting this set's the GameRules.ADVANCE_TIME gamerule for the level to avoid jitter

      The gamerule does not have effect if mirrorOverworldGameRules is 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 if mirrorOverworldGameRules is true
      Parameter:
      key - The gamerule to modify
      value - The value of the gamerule
      Gibt zurück:
      The same instance of
    • setMirrorOverworldGameRules

      public RuntimeLevelConfig setMirrorOverworldGameRules(boolean mirror)
      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

      public RuntimeLevelConfig setMirrorOverworldDifficulty(boolean mirror)
      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

      public RuntimeLevelConfig setMirrorOverworldClocks(boolean mirror)
      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

      public RuntimeLevelConfig setFlat(net.minecraft.util.TriState state)
      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

      public RuntimeLevelConfig setFlat(boolean state)
      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

      public RuntimeLevelConfig setSeed(long seed)
      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

      public RuntimeLevelConfig setGenerator(net.minecraft.world.level.chunk.ChunkGenerator generator)
      Sets the level chunk generator
      Parameter:
      generator - The chunk generator to use
      Gibt zurück:
      The same instance of
    • getLevelConstructor

      public RuntimeLevel.Constructor getLevelConstructor()
    • setLevelConstructor

      public RuntimeLevelConfig setLevelConstructor(RuntimeLevel.Constructor constructor)
      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 check shouldMirrorOverworldDifficulty()
      Gibt zurück:
      The current difficulty stored in the config
    • setDifficulty

      public RuntimeLevelConfig setDifficulty(net.minecraft.world.Difficulty difficulty)
      Sets the level difficulty
      Parameter:
      difficulty - The difficulty to use
      Gibt zurück:
      The same instance of
    • getGameRules

      public GameRuleStore getGameRules()
      Gets the current configured gamerules
      It may not reflect the real gamerules, also check shouldMirrorOverworldGameRules()
      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

      public RuntimeLevelConfig setGameTime(long gameTime)
      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)