Package org.spongepowered.api
Interface Client
-
- All Superinterfaces:
Engine
,LocaleSource
,RegistryHolder
public interface Client extends Engine, LocaleSource
Represents a typical Minecraft Client.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Optional<ClientSideConnection>
connection()
Gets theClientSideConnection
that is currently active, this is only the case if the client is connected to a server.java.util.Optional<LocalPlayer>
player()
Gets theplayer
responsible for controlling this client.java.util.Optional<LocalServer>
server()
Gets theserver
that powers a local SinglePlayer game instance of a typical Minecraft client.java.util.Optional<ClientWorld>
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 Detail
-
player
java.util.Optional<LocalPlayer> player()
Gets theplayer
responsible for controlling this client.A client may not always have a local player if browsing menus prior to joining a world or server.
- Returns:
- The local player or
Optional.empty()
if it is not found
-
server
java.util.Optional<LocalServer> server()
Gets theserver
that powers a local SinglePlayer game instance of a typical Minecraft client.A client will not have a local server if it is outside of SinglePlayer
- Returns:
- The local server or
Optional.empty()
if it is not found
-
world
java.util.Optional<ClientWorld> world()
Gets theworld
that a typical Minecraft client will be viewing while in some game instance (local or remote).A client will not have a client world if it is browsing the main menus
- Returns:
- The client world or
Optional.empty()
} if it is not found
-
connection
java.util.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
-
-