Class DedicatedServerMixin

java.lang.Object
net.minecraft.util.thread.BlockableEventLoop<R>
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.ProcessorHandle<net.minecraft.server.TickTask>, 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, START_CHUNK_RADIUS, storageSource, VANILLA_BRAND, worldData

    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.ChunkProgressListenerFactory chunkProgressListenerFactory)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the server port.

    Methods inherited from class net.minecraft.server.MinecraftServer

    acceptsFailure, acceptsSuccess, addTickable, areNpcsEnabled, cancelRecordingMetrics, close, configurePackRepository, createCommandSourceStack, createGameModeForPlayer, createLevels, createTextFilterForPlayer, doRunTask, dumpServerProperties, enforceSecureProfile, executeIfPossible, fillServerSystemReport, fillSystemReport, finishRecordingMetrics, forceDifficulty, forceSynchronousWrites, forceTimeSynchronization, getAbsoluteMaxWorldSize, getAdvancements, getAllLevels, getAverageTickTimeNanos, getChatDecorator, getCommands, getCommandStorage, getCompressionThreshold, getConnection, getCurrentSmoothedTickTime, getCustomBossEvents, getDefaultGameType, getFile, getFixerUpper, getForcedGameType, getFunctionCompilationLevel, getFunctions, getGameRules, getKeyPair, getLevel, getLocalIp, getLootData, getMaxChainedNeighborUpdates, getMaxPlayers, getModdedStatus, getMotd, getNextTickTime, getOperatorUserPermissionLevel, getPackRepository, getPlayerCount, getPlayerIdleTimeout, getPlayerList, getPlayerNames, getPort, getPreventProxyConnections, getProfileCache, getProfileKeySignatureValidator, getProfilePermissions, getProfiler, getProfileRepository, getProxy, getRateLimitPacketsPerSecond, getRecipeManager, getResourceManager, getRunningThread, getScaledTrackingDistance, getScoreboard, getServerDirectory, getServerModName, getServerResourcePack, getServerVersion, getSessionService, getSingleplayerProfile, getSpawnProtectionRadius, getSpawnRadius, getStatus, getStructureManager, getTickCount, getTickTimesNanos, getWorldData, getWorldPath, getWorldScreenshotFile, halt, hasGui, hidesOnlinePlayers, initializeKeyPair, initServer, invalidateStatus, isCommandBlockEnabled, isCurrentlySaving, isDedicatedServer, isDemo, isEnforceWhitelist, isEpollEnabled, isFlightAllowed, isHardcore, isNetherEnabled, isPaused, isPublished, isPvpAllowed, isReady, isRecordingMetrics, isResourcePackRequired, isRunning, isShutdown, isSingleplayer, isSingleplayerOwner, isSpawningAnimals, isSpawningMonsters, isStopped, isTimeProfilerRunning, isUnderSpawnProtection, kickUnlistedPlayers, levelKeys, loadLevel, logChatMessage, logIPs, logTickTime, onServerCrash, onServerExit, onTickRateChanged, overworld, pollTask, publishServer, registries, registryAccess, reloadResources, repliesToStatus, runServer, saveAllChunks, saveEverything, scheduleExecutables, sendSystemMessage, setDefaultGameType, setDemo, setDifficulty, setDifficultyLocked, setEnforceWhitelist, setFlightAllowed, setId, setLocalIp, setMotd, setPlayerIdleTimeout, setPlayerList, setPort, setPreventProxyConnections, setPvpAllowed, setSingleplayerProfile, setUsesAuthentication, shouldInformAdmins, shouldRconBroadcast, shouldRun, spin, startRecordingMetrics, startTimeProfiler, stopRecordingMetrics, stopServer, stopTimeProfiler, tickChildren, tickRateManager, tickServer, usesAuthentication, 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, isSameThread, managedBlock, name, profiledMetrics, runAllTasks, submit, submit, tell, waitForTasks

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface net.minecraft.commands.CommandSource

    alwaysAccepts

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

    ask, askEither
  • 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.ChunkProgressListenerFactory chunkProgressListenerFactory)
  • 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.