Class DedicatedServerMixin

java.lang.Object
net.minecraft.util.thread.BlockableEventLoop<net.minecraft.server.TickTask>
net.minecraft.util.thread.ReentrantBlockableEventLoop<net.minecraft.server.TickTask>
net.minecraft.server.MinecraftServer
org.geysermc.geyser.platform.mod.mixin.server.DedicatedServerMixin
All Implemented Interfaces:
AutoCloseable, Executor, net.minecraft.commands.CommandSource, net.minecraft.server.ServerInfo, net.minecraft.util.profiling.metrics.ProfilerMeasured, net.minecraft.util.thread.TaskScheduler<net.minecraft.server.TickTask>, net.minecraft.world.level.chunk.storage.ChunkIOErrorReporter, GeyserServerPortGetter

public abstract class DedicatedServerMixin extends net.minecraft.server.MinecraftServer implements GeyserServerPortGetter
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.minecraft.server.MinecraftServer

    net.minecraft.server.MinecraftServer.ServerResourcePackInfo
  • Field Summary

    Fields inherited from class net.minecraft.server.MinecraftServer

    ABSOLUTE_MAX_WORLD_SIZE, ANONYMOUS_PLAYER_PROFILE, DEMO_SETTINGS, playerDataStorage, proxy, services, SPAWN_POSITION_SEARCH_RADIUS, storageSource, VANILLA_BRAND, worldData

    Fields inherited from class net.minecraft.util.thread.BlockableEventLoop

    BLOCK_TIME_NANOS

    Fields inherited from interface net.minecraft.commands.CommandSource

    NULL
  • Constructor Summary

    Constructors
    Constructor
    Description
    DedicatedServerMixin(Thread thread, net.minecraft.world.level.storage.LevelStorageSource.LevelStorageAccess levelStorageAccess, net.minecraft.server.packs.repository.PackRepository packRepository, net.minecraft.server.WorldStem worldStem, Proxy proxy, com.mojang.datafixers.DataFixer dataFixer, net.minecraft.server.Services services, net.minecraft.server.level.progress.LevelLoadListener levelLoadListener)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the server port.

    Methods inherited from class net.minecraft.server.MinecraftServer

    acceptsFailure, acceptsSuccess, acceptsTransfers, addTickable, allowFlight, cancelRecordingMetrics, close, configurePackRepository, createChunkLoadStatusView, createCommandSourceStack, createGameModeForPlayer, createLevels, createTextFilterForPlayer, debugSubscribers, doRunTask, dumpServerProperties, endMetricsRecordingTick, enforceGameTypeForPlayers, enforceSecureProfile, executeIfPossible, fillServerSystemReport, fillSystemReport, findRespawnDimension, finishRecordingMetrics, forceDifficulty, forceSynchronousWrites, forceTimeSynchronization, fuelValues, getAbsoluteMaxWorldSize, getAdvancements, getAllLevels, getAverageTickTimeNanos, getChatDecorator, getCodeOfConducts, getCommands, getCommandStorage, getCompressionThreshold, getConnection, getCurrentSmoothedTickTime, getCustomBossEvents, getDefaultGameType, getFile, getFixerUpper, getForcedGameType, getFunctionCompilationLevel, getFunctions, getGameRules, getKeyPair, getLevel, getLevelLoadListener, getLocalIp, getMaxChainedNeighborUpdates, getModdedStatus, getMotd, getNextTickTime, getPackRepository, getPlayerCount, getPlayerList, getPlayerNames, getPort, getPreventProxyConnections, getProfilePermissions, getProxy, getRateLimitPacketsPerSecond, getRecipeManager, getResourceManager, getRespawnData, getRunningThread, getScaledTrackingDistance, getScoreboard, getServerDirectory, getServerModName, getServerResourcePack, getServerVersion, getSingleplayerProfile, getStatus, getStructureManager, getTickCount, getTickTimeLogger, getTickTimesNanos, getWorldData, getWorldPath, getWorldScreenshotFile, halt, handleCustomClickAction, hasGui, hidesOnlinePlayers, initializeKeyPair, initServer, invalidateStatus, isAllowedToEnterPortal, isAutoSave, isCommandBlockEnabled, isCurrentlySaving, isDedicatedServer, isDemo, isEnforceWhitelist, isEpollEnabled, isHardcore, isPaused, isPublished, isPvpAllowed, isReady, isRecordingMetrics, isResourcePackRequired, isRunning, isShutdown, isSingleplayer, isSingleplayerOwner, isSpawnerBlockEnabled, isSpawningMonsters, isStopped, isTickTimeLoggingEnabled, isTimeProfilerRunning, isUnderSpawnProtection, isUsingWhitelist, kickUnlistedPlayers, levelKeys, loadLevel, logChatMessage, logIPs, managedBlock, notificationManager, onGameRuleChanged, onServerCrash, onServerExit, onTickRateChanged, operatorUserPermissionLevel, overworld, packetProcessor, pauseWhenEmptySeconds, playerIdleTimeout, pollTask, potionBrewing, publishServer, registries, registryAccess, reloadableRegistries, reloadResources, repliesToStatus, reportChunkLoadFailure, reportChunkSaveFailure, reportPacketHandlingException, runServer, saveAllChunks, saveEverything, scheduleExecutables, selectLevelLoadFocusPos, sendSystemMessage, serverLinks, services, setAutoSave, setDefaultGameType, setDemo, setDifficulty, setDifficultyLocked, setEnforceWhitelist, setFatalException, setId, setLocalIp, setMotd, setPlayerIdleTimeout, setPlayerList, setPort, setPreventProxyConnections, setRespawnData, setSingleplayerProfile, setUsesAuthentication, setUsingWhitelist, shouldInformAdmins, shouldRconBroadcast, shouldRun, spin, startRecordingMetrics, startTimeProfiler, stopRecordingMetrics, stopServer, stopTimeProfiler, throwIfFatalException, tickChildren, tickConnection, tickRateManager, tickServer, updateMobSpawningFlags, usesAuthentication, waitForTasks, waitUntilNextTick, wrapRunnable

    Methods inherited from class net.minecraft.util.thread.ReentrantBlockableEventLoop

    runningTask

    Methods inherited from class net.minecraft.util.thread.BlockableEventLoop

    dropAllTasks, execute, executeBlocking, getPendingTasksCount, isNonRecoverable, isSameThread, name, profiledMetrics, runAllTasks, schedule, shouldRunAllTasks, submit, submit

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.minecraft.world.level.chunk.storage.ChunkIOErrorReporter

    reportMisplacedChunk

    Methods inherited from interface net.minecraft.commands.CommandSource

    alwaysAccepts

    Methods inherited from interface net.minecraft.server.ServerInfo

    getMaxPlayers

    Methods inherited from interface net.minecraft.util.thread.TaskScheduler

    scheduleWithResult
  • Constructor Details

    • DedicatedServerMixin

      public DedicatedServerMixin(Thread thread, net.minecraft.world.level.storage.LevelStorageSource.LevelStorageAccess levelStorageAccess, net.minecraft.server.packs.repository.PackRepository packRepository, net.minecraft.server.WorldStem worldStem, Proxy proxy, com.mojang.datafixers.DataFixer dataFixer, net.minecraft.server.Services services, net.minecraft.server.level.progress.LevelLoadListener levelLoadListener)
  • Method Details

    • geyser$getServerPort

      public int geyser$getServerPort()
      Description copied from interface: GeyserServerPortGetter
      Returns the server port.
      • If it's a dedicated server, it will return the server port specified in the server.properties file.
      • If it's an integrated server, it will return the LAN port if opened, else -1.
      The reason is that MinecraftServer.getPort() doesn't return the LAN port if it's the integrated server, and changing the behavior of this method via a mixin should be avoided as it could have unexpected consequences.
      Specified by:
      geyser$getServerPort in interface GeyserServerPortGetter
      Returns:
      The server port.