mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
Fix null reference when trying to get protocol version (#1298)
* Fix null reference when trying to get protocol version * Use only stored version of protocolversion (No need to add a switch because the protocol version will not change between InitializeClient() calls) Co-authored-by: ORelio <ORelio@users.noreply.github.com>
This commit is contained in:
parent
ec9f999857
commit
ce389b6b31
1 changed files with 3 additions and 1 deletions
|
|
@ -55,6 +55,7 @@ namespace MinecraftClient
|
||||||
|
|
||||||
private string host;
|
private string host;
|
||||||
private int port;
|
private int port;
|
||||||
|
private int protocolversion;
|
||||||
private string username;
|
private string username;
|
||||||
private string uuid;
|
private string uuid;
|
||||||
private string sessionid;
|
private string sessionid;
|
||||||
|
|
@ -105,7 +106,7 @@ namespace MinecraftClient
|
||||||
public byte GetCurrentSlot() { return CurrentSlot; }
|
public byte GetCurrentSlot() { return CurrentSlot; }
|
||||||
public int GetGamemode() { return gamemode; }
|
public int GetGamemode() { return gamemode; }
|
||||||
public bool GetNetworkPacketCaptureEnabled() { return networkPacketCaptureEnabled; }
|
public bool GetNetworkPacketCaptureEnabled() { return networkPacketCaptureEnabled; }
|
||||||
public int GetProtocolVersion() { return handler.GetProtocolVersion(); }
|
public int GetProtocolVersion() { return protocolversion; }
|
||||||
|
|
||||||
// get bots list for unloading them by commands
|
// get bots list for unloading them by commands
|
||||||
public List<ChatBot> GetLoadedChatBots()
|
public List<ChatBot> GetLoadedChatBots()
|
||||||
|
|
@ -170,6 +171,7 @@ namespace MinecraftClient
|
||||||
this.username = user;
|
this.username = user;
|
||||||
this.host = server_ip;
|
this.host = server_ip;
|
||||||
this.port = port;
|
this.port = port;
|
||||||
|
this.protocolVersion = protocolversion;
|
||||||
|
|
||||||
if (!singlecommand)
|
if (!singlecommand)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue