C# Class Sharpcraft.Library.Minecraft.Client

The Minecraft client.
Mostrar archivo Open project: SijmenSchoon/Sharpcraft Class Usage Examples

Public Methods

Method 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

Method 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 method

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.
return System

Connect() public method

Attempt to connect to the server.
public Connect ( ) : bool
return bool

Disconnect() public method

Disconnect from current server.
public Disconnect ( ) : bool
return bool

Exit() public method

Exit client.
public Exit ( ) : void
return void

GetItemByID() public static method

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

GetPlayer() public method

Get the player associated with this Client.
public GetPlayer ( ) : Player
return Player

GetServer() public method

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

SendChatMessage() public method

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