C# Класс Sharpcraft.Library.Minecraft.Client

The Minecraft client.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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

Описание методов

Client() публичный Метод

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.
Результат System

Connect() публичный Метод

Attempt to connect to the server.
public Connect ( ) : bool
Результат bool

Disconnect() публичный Метод

Disconnect from current server.
public Disconnect ( ) : bool
Результат bool

Exit() публичный Метод

Exit client.
public Exit ( ) : void
Результат void

GetItemByID() публичный статический Метод

Get an item by its ID.
public static GetItemByID ( short id ) : Item
id short ID of the item.
Результат Item

GetPlayer() публичный Метод

Get the player associated with this Client.
public GetPlayer ( ) : Player
Результат Player

GetServer() публичный Метод

Get the server this client is currently connected to.
public GetServer ( ) : Server
Результат Server

SendChatMessage() публичный Метод

Send a chat message to the server.
public SendChatMessage ( string message ) : void
message string Message to send.
Результат void