Class ExpandServer

java.lang.Object
com.blamejared.crafttweaker.natives.game.ExpandServer

@ZenRegister public class ExpandServer extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    areNpcsEnabled(net.minecraft.server.MinecraftServer internal)
    Checks if NPCs are enabled.
    static void
    executeCommand(net.minecraft.server.MinecraftServer internal, String command, boolean silent)
    Runs a command, if silent is true, the output is hidden.
    static void
    executeCommand(net.minecraft.server.MinecraftServer internal, String command, net.minecraft.world.entity.player.Player player, boolean silent)
    let a player send a command, if silent is true, the output is hidden.
    static int
    getAbsoluteMaxWorldSize(net.minecraft.server.MinecraftServer internal)
    Gets the absolute maximum world size.
    static net.minecraft.server.ServerAdvancementManager
    getAdvancements(net.minecraft.server.MinecraftServer internal)
    Gets the advancements manager.
    static Iterable<net.minecraft.server.level.ServerLevel>
    getAllLevels(net.minecraft.server.MinecraftServer internal)
    Gets all levels.
    static float
    getCurrentSmoothedTickTime(net.minecraft.server.MinecraftServer internal)
    Gets the current smoothed tick time.
    static net.minecraft.world.level.GameType
    getDefaultGameType(net.minecraft.server.MinecraftServer internal)
    Gets the default game type.
    static net.minecraft.world.level.GameType
    getForcedGameType(net.minecraft.server.MinecraftServer internal)
    Gets the forced game type.
    static net.minecraft.server.level.ServerLevel
    getLevel(net.minecraft.server.MinecraftServer internal, net.minecraft.resources.ResourceLocation location)
    Gets a level by its key.
    static int
    getMaxPlayers(net.minecraft.server.MinecraftServer internal)
    Gets the maximum number of players.
    static String
    getModdedStatus(net.minecraft.server.MinecraftServer internal)
    Gets the modded status.
    static String
    getMotd(net.minecraft.server.MinecraftServer internal)
    Gets the message of the day.
    static int
    getOperatorUserPermissionLevel(net.minecraft.server.MinecraftServer internal)
    Gets the operator user permission level.
    getOverworldData(net.minecraft.server.MinecraftServer internal)
    Gets the custom data of the overworld.
    static int
    getPlayerCount(net.minecraft.server.MinecraftServer internal)
    Gets the player count.
    static net.minecraft.server.players.PlayerList
    getPlayerList(net.minecraft.server.MinecraftServer internal)
    Gets the player list.
    static String[]
    getPlayerNames(net.minecraft.server.MinecraftServer internal)
    Gets the player names.
    static String
    getServerModName(net.minecraft.server.MinecraftServer internal)
    Gets the server mod name.
    static String
    getServerVersion(net.minecraft.server.MinecraftServer internal)
    Gets the server version.
    static int
    getSpawnProtectionRadius(net.minecraft.server.MinecraftServer internal)
    Gets the spawn protection radius.
    static int
    getSpawnRadius(net.minecraft.server.MinecraftServer internal, net.minecraft.server.level.ServerLevel level)
    Gets the spawn radius.
    static int
    getTickCount(net.minecraft.server.MinecraftServer internal)
    Gets the tick count.
    static boolean
    isCommandBlockEnabled(net.minecraft.server.MinecraftServer internal)
    Checks if command blocks are enabled.
    static boolean
    isDedicatedServer(net.minecraft.server.MinecraftServer internal)
    Checks if the server is dedicated.
    static boolean
    isEnforceWhitelist(net.minecraft.server.MinecraftServer internal)
    Checks if the whitelist is enforced.
    static boolean
    isFlightAllowed(net.minecraft.server.MinecraftServer internal)
    Checks if flight is allowed.
    static boolean
    isHardcore(net.minecraft.server.MinecraftServer internal)
    Checks if the server is hardcore.
    static boolean
    isPvpAllowed(net.minecraft.server.MinecraftServer internal)
    Checks if PvP is allowed.
    static boolean
    isReady(net.minecraft.server.MinecraftServer internal)
    Checks if the server is ready.
    static boolean
    isRunning(net.minecraft.server.MinecraftServer internal)
    Checks if the server is running.
    static boolean
    isShutdown(net.minecraft.server.MinecraftServer internal)
    Checks if the server is shutting down.
    static boolean
    isSingleplayer(net.minecraft.server.MinecraftServer internal)
    Checks if the server is singleplayer.
    static boolean
    isSpawningAnimals(net.minecraft.server.MinecraftServer internal)
    Checks if animals are spawning.
    static boolean
    isSpawningMonsters(net.minecraft.server.MinecraftServer internal)
    Checks if monsters are spawning.
    static boolean
    isStopped(net.minecraft.server.MinecraftServer internal)
    Checks if the server is stopped.
    static boolean
    isUnderSpawnProtection(net.minecraft.server.MinecraftServer internal, net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player)
    Checks if a position is under spawn protection.
    static List<net.minecraft.resources.ResourceLocation>
    levelKeys(net.minecraft.server.MinecraftServer internal)
    Gets the keys of all levels.
    static net.minecraft.server.level.ServerLevel
    overworld(net.minecraft.server.MinecraftServer internal)
    Gets the overworld.
    static void
    setDefaultGameType(net.minecraft.server.MinecraftServer internal, net.minecraft.world.level.GameType gameType)
    Sets the default game type.
    static void
    setDifficulty(net.minecraft.server.MinecraftServer internal, net.minecraft.world.Difficulty difficulty, boolean force)
    Sets the difficulty of the server.
    static void
    setDifficultyLocked(net.minecraft.server.MinecraftServer internal, boolean locked)
    Sets if the difficulty should be locked.
    static void
    setEnforceWhitelist(net.minecraft.server.MinecraftServer internal, boolean enforceWhitelist)
    Sets if the whitelist is enforced.
    static void
    setFlightAllowed(net.minecraft.server.MinecraftServer internal, boolean flightAllowed)
    Sets if flight is allowed.
    static void
    setMotd(net.minecraft.server.MinecraftServer internal, String motd)
    Sets the message of the day.
    static void
    setPvpAllowed(net.minecraft.server.MinecraftServer internal, boolean pvpAllowed)
    Sets if PvP is allowed.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ExpandServer

      public ExpandServer()
  • Method Details

    • getAdvancements

      public static net.minecraft.server.ServerAdvancementManager getAdvancements(net.minecraft.server.MinecraftServer internal)
      Gets the advancements manager.
      Returns:
      The advancements manager.
    • getPlayerList

      public static net.minecraft.server.players.PlayerList getPlayerList(net.minecraft.server.MinecraftServer internal)
      Gets the player list.
      Returns:
      The player list.
    • getOverworldData

      public static CraftTweakerSavedData getOverworldData(net.minecraft.server.MinecraftServer internal)
      Gets the custom data of the overworld.

      The overworld is always loaded, so this can be used to store and access data no matter what level a player may be in.

      Returns:
      The overworld's custom data.
    • getDefaultGameType

      public static net.minecraft.world.level.GameType getDefaultGameType(net.minecraft.server.MinecraftServer internal)
      Gets the default game type.
      Returns:
      The default game type.
    • isHardcore

      public static boolean isHardcore(net.minecraft.server.MinecraftServer internal)
      Checks if the server is hardcore.
      Returns:
      True if the server is hardcore, false otherwise.
    • getOperatorUserPermissionLevel

      public static int getOperatorUserPermissionLevel(net.minecraft.server.MinecraftServer internal)
      Gets the operator user permission level.
      Returns:
      The operator user permission level.
    • isRunning

      public static boolean isRunning(net.minecraft.server.MinecraftServer internal)
      Checks if the server is running.
      Returns:
      True if the server is running, false otherwise.
    • isShutdown

      public static boolean isShutdown(net.minecraft.server.MinecraftServer internal)
      Checks if the server is shutting down.
      Returns:
      True if the server is shutting down, false otherwise.
    • overworld

      public static net.minecraft.server.level.ServerLevel overworld(net.minecraft.server.MinecraftServer internal)
      Gets the overworld.
      Returns:
      The overworld.
    • getLevel

      public static net.minecraft.server.level.ServerLevel getLevel(net.minecraft.server.MinecraftServer internal, net.minecraft.resources.ResourceLocation location)
      Gets a level by its key.
      Parameters:
      location - The key of the level.
      Returns:
      The level.
    • levelKeys

      public static List<net.minecraft.resources.ResourceLocation> levelKeys(net.minecraft.server.MinecraftServer internal)
      Gets the keys of all levels.
      Returns:
      The keys of all levels.
    • getAllLevels

      public static Iterable<net.minecraft.server.level.ServerLevel> getAllLevels(net.minecraft.server.MinecraftServer internal)
      Gets all levels.
      Returns:
      All levels.
    • getServerVersion

      public static String getServerVersion(net.minecraft.server.MinecraftServer internal)
      Gets the server version.
      Returns:
      The server version.
    • getPlayerCount

      public static int getPlayerCount(net.minecraft.server.MinecraftServer internal)
      Gets the player count.
      Returns:
      The player count.
    • getMaxPlayers

      public static int getMaxPlayers(net.minecraft.server.MinecraftServer internal)
      Gets the maximum number of players.
      Returns:
      The maximum number of players.
    • getPlayerNames

      public static String[] getPlayerNames(net.minecraft.server.MinecraftServer internal)
      Gets the player names.
      Returns:
      The player names.
    • getServerModName

      public static String getServerModName(net.minecraft.server.MinecraftServer internal)
      Gets the server mod name.
      Returns:
      The server mod name.
    • getModdedStatus

      public static String getModdedStatus(net.minecraft.server.MinecraftServer internal)
      Gets the modded status.
      Returns:
      The modded status.
    • isSingleplayer

      public static boolean isSingleplayer(net.minecraft.server.MinecraftServer internal)
      Checks if the server is singleplayer.
      Returns:
      True if the server is singleplayer, false otherwise.
    • setDifficulty

      public static void setDifficulty(net.minecraft.server.MinecraftServer internal, net.minecraft.world.Difficulty difficulty, boolean force)
      Sets the difficulty of the server.
      Parameters:
      difficulty - The difficulty to set.
      force - Whether to force the difficulty.
    • setDifficultyLocked

      public static void setDifficultyLocked(net.minecraft.server.MinecraftServer internal, boolean locked)
      Sets if the difficulty should be locked.
      Parameters:
      locked - Whether to lock the difficulty.
    • isSpawningMonsters

      public static boolean isSpawningMonsters(net.minecraft.server.MinecraftServer internal)
      Checks if monsters are spawning.
      Returns:
      True if monsters are spawning, false otherwise.
    • isDedicatedServer

      public static boolean isDedicatedServer(net.minecraft.server.MinecraftServer internal)
      Checks if the server is dedicated.
      Returns:
      True if the server is dedicated, false otherwise.
    • isSpawningAnimals

      public static boolean isSpawningAnimals(net.minecraft.server.MinecraftServer internal)
      Checks if animals are spawning.
      Returns:
      True if animals are spawning, false otherwise.
    • areNpcsEnabled

      public static boolean areNpcsEnabled(net.minecraft.server.MinecraftServer internal)
      Checks if NPCs are enabled.
      Returns:
      True if NPCs are enabled, false otherwise.
    • isPvpAllowed

      public static boolean isPvpAllowed(net.minecraft.server.MinecraftServer internal)
      Checks if PvP is allowed.
      Returns:
      True if PvP is allowed, false otherwise.
    • setPvpAllowed

      public static void setPvpAllowed(net.minecraft.server.MinecraftServer internal, boolean pvpAllowed)
      Sets if PvP is allowed.
      Parameters:
      pvpAllowed - Whether to allow PvP.
    • isFlightAllowed

      public static boolean isFlightAllowed(net.minecraft.server.MinecraftServer internal)
      Checks if flight is allowed.
      Returns:
      True if flight is allowed, false otherwise.
    • setFlightAllowed

      public static void setFlightAllowed(net.minecraft.server.MinecraftServer internal, boolean flightAllowed)
      Sets if flight is allowed.
      Parameters:
      flightAllowed - Whether to allow flight.
    • isCommandBlockEnabled

      public static boolean isCommandBlockEnabled(net.minecraft.server.MinecraftServer internal)
      Checks if command blocks are enabled.
      Returns:
      True if command blocks are enabled, false otherwise.
    • getMotd

      public static String getMotd(net.minecraft.server.MinecraftServer internal)
      Gets the message of the day.
      Returns:
      The message of the day.
    • setMotd

      public static void setMotd(net.minecraft.server.MinecraftServer internal, String motd)
      Sets the message of the day.
      Parameters:
      motd - The message of the day.
    • isStopped

      public static boolean isStopped(net.minecraft.server.MinecraftServer internal)
      Checks if the server is stopped.
      Returns:
      True if the server is stopped, false otherwise.
    • setDefaultGameType

      public static void setDefaultGameType(net.minecraft.server.MinecraftServer internal, net.minecraft.world.level.GameType gameType)
      Sets the default game type.
      Parameters:
      gameType - The game type to set.
    • isReady

      public static boolean isReady(net.minecraft.server.MinecraftServer internal)
      Checks if the server is ready.
      Returns:
      True if the server is ready, false otherwise.
    • getTickCount

      public static int getTickCount(net.minecraft.server.MinecraftServer internal)
      Gets the tick count.
      Returns:
      The tick count.
    • getSpawnProtectionRadius

      public static int getSpawnProtectionRadius(net.minecraft.server.MinecraftServer internal)
      Gets the spawn protection radius.
      Returns:
      The spawn protection radius.
    • isUnderSpawnProtection

      public static boolean isUnderSpawnProtection(net.minecraft.server.MinecraftServer internal, net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player)
      Checks if a position is under spawn protection.
      Parameters:
      level - The level.
      pos - The position.
      player - The player.
      Returns:
      True if the position is under spawn protection, false otherwise.
    • getAbsoluteMaxWorldSize

      public static int getAbsoluteMaxWorldSize(net.minecraft.server.MinecraftServer internal)
      Gets the absolute maximum world size.
      Returns:
      The absolute maximum world size.
    • getSpawnRadius

      public static int getSpawnRadius(net.minecraft.server.MinecraftServer internal, net.minecraft.server.level.ServerLevel level)
      Gets the spawn radius.
      Parameters:
      level - The level.
      Returns:
      The spawn radius.
    • isEnforceWhitelist

      public static boolean isEnforceWhitelist(net.minecraft.server.MinecraftServer internal)
      Checks if the whitelist is enforced.
      Returns:
      True if the whitelist is enforced, false otherwise.
    • setEnforceWhitelist

      public static void setEnforceWhitelist(net.minecraft.server.MinecraftServer internal, boolean enforceWhitelist)
      Sets if the whitelist is enforced.
      Parameters:
      enforceWhitelist - Whether to enforce the whitelist.
    • getCurrentSmoothedTickTime

      public static float getCurrentSmoothedTickTime(net.minecraft.server.MinecraftServer internal)
      Gets the current smoothed tick time.
      Returns:
      The current smoothed tick time.
    • getForcedGameType

      public static net.minecraft.world.level.GameType getForcedGameType(net.minecraft.server.MinecraftServer internal)
      Gets the forced game type.
      Returns:
      The forced game type.
    • executeCommand

      public static void executeCommand(net.minecraft.server.MinecraftServer internal, String command, boolean silent)
      Runs a command, if silent is true, the output is hidden.
      DocParam:
      command "time set day", silent true
    • executeCommand

      public static void executeCommand(net.minecraft.server.MinecraftServer internal, String command, net.minecraft.world.entity.player.Player player, boolean silent)
      let a player send a command, if silent is true, the output is hidden.
      DocParam:
      command "time set day", player player, silent true