Class ExpandServer
java.lang.Object
com.blamejared.crafttweaker.natives.game.ExpandServer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanareNpcsEnabled(net.minecraft.server.MinecraftServer internal) Checks if NPCs are enabled.static voidexecuteCommand(net.minecraft.server.MinecraftServer internal, String command, boolean silent) Runs a command, if silent is true, the output is hidden.static voidexecuteCommand(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 intgetAbsoluteMaxWorldSize(net.minecraft.server.MinecraftServer internal) Gets the absolute maximum world size.static net.minecraft.server.ServerAdvancementManagergetAdvancements(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 floatgetCurrentSmoothedTickTime(net.minecraft.server.MinecraftServer internal) Gets the current smoothed tick time.static net.minecraft.world.level.GameTypegetDefaultGameType(net.minecraft.server.MinecraftServer internal) Gets the default game type.static net.minecraft.world.level.GameTypegetForcedGameType(net.minecraft.server.MinecraftServer internal) Gets the forced game type.static net.minecraft.server.level.ServerLevelgetLevel(net.minecraft.server.MinecraftServer internal, net.minecraft.resources.ResourceLocation location) Gets a level by its key.static intgetMaxPlayers(net.minecraft.server.MinecraftServer internal) Gets the maximum number of players.static StringgetModdedStatus(net.minecraft.server.MinecraftServer internal) Gets the modded status.static StringgetMotd(net.minecraft.server.MinecraftServer internal) Gets the message of the day.static intgetOperatorUserPermissionLevel(net.minecraft.server.MinecraftServer internal) Gets the operator user permission level.static CraftTweakerSavedDatagetOverworldData(net.minecraft.server.MinecraftServer internal) Gets the custom data of the overworld.static intgetPlayerCount(net.minecraft.server.MinecraftServer internal) Gets the player count.static net.minecraft.server.players.PlayerListgetPlayerList(net.minecraft.server.MinecraftServer internal) Gets the player list.static String[]getPlayerNames(net.minecraft.server.MinecraftServer internal) Gets the player names.static StringgetServerModName(net.minecraft.server.MinecraftServer internal) Gets the server mod name.static StringgetServerVersion(net.minecraft.server.MinecraftServer internal) Gets the server version.static intgetSpawnProtectionRadius(net.minecraft.server.MinecraftServer internal) Gets the spawn protection radius.static intgetSpawnRadius(net.minecraft.server.MinecraftServer internal, net.minecraft.server.level.ServerLevel level) Gets the spawn radius.static intgetTickCount(net.minecraft.server.MinecraftServer internal) Gets the tick count.static booleanisCommandBlockEnabled(net.minecraft.server.MinecraftServer internal) Checks if command blocks are enabled.static booleanisDedicatedServer(net.minecraft.server.MinecraftServer internal) Checks if the server is dedicated.static booleanisEnforceWhitelist(net.minecraft.server.MinecraftServer internal) Checks if the whitelist is enforced.static booleanisFlightAllowed(net.minecraft.server.MinecraftServer internal) Checks if flight is allowed.static booleanisHardcore(net.minecraft.server.MinecraftServer internal) Checks if the server is hardcore.static booleanisPvpAllowed(net.minecraft.server.MinecraftServer internal) Checks if PvP is allowed.static booleanisReady(net.minecraft.server.MinecraftServer internal) Checks if the server is ready.static booleanisRunning(net.minecraft.server.MinecraftServer internal) Checks if the server is running.static booleanisShutdown(net.minecraft.server.MinecraftServer internal) Checks if the server is shutting down.static booleanisSingleplayer(net.minecraft.server.MinecraftServer internal) Checks if the server is singleplayer.static booleanisSpawningAnimals(net.minecraft.server.MinecraftServer internal) Checks if animals are spawning.static booleanisSpawningMonsters(net.minecraft.server.MinecraftServer internal) Checks if monsters are spawning.static booleanisStopped(net.minecraft.server.MinecraftServer internal) Checks if the server is stopped.static booleanisUnderSpawnProtection(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.ServerLeveloverworld(net.minecraft.server.MinecraftServer internal) Gets the overworld.static voidsetDefaultGameType(net.minecraft.server.MinecraftServer internal, net.minecraft.world.level.GameType gameType) Sets the default game type.static voidsetDifficulty(net.minecraft.server.MinecraftServer internal, net.minecraft.world.Difficulty difficulty, boolean force) Sets the difficulty of the server.static voidsetDifficultyLocked(net.minecraft.server.MinecraftServer internal, boolean locked) Sets if the difficulty should be locked.static voidsetEnforceWhitelist(net.minecraft.server.MinecraftServer internal, boolean enforceWhitelist) Sets if the whitelist is enforced.static voidsetFlightAllowed(net.minecraft.server.MinecraftServer internal, boolean flightAllowed) Sets if flight is allowed.static voidSets the message of the day.static voidsetPvpAllowed(net.minecraft.server.MinecraftServer internal, boolean pvpAllowed) Sets if PvP is allowed.
-
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
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
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
Gets the player names.- Returns:
- The player names.
-
getServerModName
Gets the server mod name.- Returns:
- The server mod name.
-
getModdedStatus
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
Gets the message of the day.- Returns:
- The message of the day.
-
setMotd
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
-