Package org.spongepowered.api
Interface Client
- All Superinterfaces:
Engine
,LocaleSource
,RegistryHolder
Represents a typical Minecraft Client.
-
Method Summary
Modifier and TypeMethodDescriptionGets theClientSideConnection
that is currently active, this is only the case if the client is connected to a server.player()
Gets theplayer
responsible for controlling this client.server()
Gets theserver
that powers a local SinglePlayer game instance of a typical Minecraft client.world()
Gets theworld
that a typical Minecraft client will be viewing while in some game instance (local or remote).Methods inherited from interface org.spongepowered.api.Engine
causeStackManager, game, onMainThread, packRepository, reloadResources, resourceManager, scheduler
Methods inherited from interface org.spongepowered.api.util.locale.LocaleSource
locale
Methods inherited from interface org.spongepowered.api.registry.RegistryHolder
findRegistry, registry, streamRegistries
-
Method Details
-
player
Optional<LocalPlayer> player()Gets theplayer
responsible for controlling this client.- Returns:
- The local player or
Optional.empty()
if it is not found
-
server
Optional<LocalServer> server()Gets theserver
that powers a local SinglePlayer game instance of a typical Minecraft client.- Returns:
- The local server or
Optional.empty()
if it is not found
-
world
Optional<ClientWorld> world()Gets theworld
that a typical Minecraft client will be viewing while in some game instance (local or remote).- Returns:
- The client world or
Optional.empty()
} if it is not found
-
connection
Optional<ClientSideConnection> connection()Gets theClientSideConnection
that is currently active, this is only the case if the client is connected to a server.- Returns:
- The client side connection, if present
-