C# Class Sharpcraft.Library.Minecraft.Client

The Minecraft client.
Afficher le fichier Open project: SijmenSchoon/Sharpcraft Class Usage Examples

Méthodes publiques

Méthode Description
Client ( Server server, Player player ) : System

Initialize a new Minecraft client.

Connect ( ) : bool

Attempt to connect to the server.

Disconnect ( ) : bool

Disconnect from current server.

Exit ( ) : void

Exit client.

GetItemByID ( short id ) : Item

Get an item by its ID.

GetPlayer ( ) : Player

Get the player associated with this Client.

GetServer ( ) : Server

Get the server this client is currently connected to.

SendChatMessage ( string message ) : void

Send a chat message to the server.

Private Methods

Méthode Description
ChatMessageReceived ( ChatMessage message ) : void
PacketReceived ( object sender, PacketEventArgs e ) : void

Handles all packets received.

ParseLoginRequestSC ( LoginRequestPacketSC packet ) : void

Parse a LoginRequestPacketSC packet and update data accordingly.

ReceiveMessage ( string message ) : void

Method Details

Client() public méthode

Initialize a new Minecraft client.
public Client ( Server server, Player player ) : System
server Server The server to connect to.
player Sharpcraft.Library.Minecraft.Entities.Player The player who logged in with the client.
Résultat System

Connect() public méthode

Attempt to connect to the server.
public Connect ( ) : bool
Résultat bool

Disconnect() public méthode

Disconnect from current server.
public Disconnect ( ) : bool
Résultat bool

Exit() public méthode

Exit client.
public Exit ( ) : void
Résultat void

GetItemByID() public static méthode

Get an item by its ID.
public static GetItemByID ( short id ) : Item
id short ID of the item.
Résultat Item

GetPlayer() public méthode

Get the player associated with this Client.
public GetPlayer ( ) : Player
Résultat Player

GetServer() public méthode

Get the server this client is currently connected to.
public GetServer ( ) : Server
Résultat Server

SendChatMessage() public méthode

Send a chat message to the server.
public SendChatMessage ( string message ) : void
message string Message to send.
Résultat void