mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Keep track of current game mode (#1053)
* GetGamemode() * GetGamemode() * ChangeGamemode() * GetGamemode() * Update ChatBot.cs code refractor * Update Inventory.cs Gamemode check added * Update Protocol18.cs * Update Protocol18.cs * Update Protocol18.cs code refractor * Update IMinecraftComHandler.cs code refractor * Update IMinecraftComHandler.cs * Update McTcpClient.cs fix * Update McTcpClient.cs fix * Fix duplicate gamemode event Co-authored-by: ORelio <oreliogitantispam.l0gin@spamgourmet.com>
This commit is contained in:
parent
27f35ee7a9
commit
87302bafab
4 changed files with 32 additions and 13 deletions
|
|
@ -217,7 +217,7 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
handler.OnGameJoined();
|
||||
int playerEntityID = dataTypes.ReadNextInt(packetData);
|
||||
handler.SetPlayerEntityID(playerEntityID);
|
||||
dataTypes.ReadNextByte(packetData);
|
||||
handler.OnGamemodeUpdate(Guid.Empty, dataTypes.ReadNextByte(packetData));
|
||||
if (protocolversion >= MC191Version)
|
||||
this.currentDimension = dataTypes.ReadNextInt(packetData);
|
||||
else
|
||||
|
|
@ -437,15 +437,14 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
if (dataTypes.ReadNextBool(packetData))
|
||||
dataTypes.ReadNextString(packetData);
|
||||
}
|
||||
dataTypes.ReadNextVarInt(packetData);
|
||||
handler.OnGamemodeUpdate(uuid, dataTypes.ReadNextVarInt(packetData));
|
||||
dataTypes.ReadNextVarInt(packetData);
|
||||
if (dataTypes.ReadNextBool(packetData))
|
||||
dataTypes.ReadNextString(packetData);
|
||||
handler.OnPlayerJoin(uuid, name);
|
||||
break;
|
||||
case 0x01: //Update gamemode
|
||||
int gamemode = dataTypes.ReadNextVarInt(packetData);
|
||||
handler.OnGamemodeUpdate(uuid, gamemode);
|
||||
handler.OnGamemodeUpdate(uuid, dataTypes.ReadNextVarInt(packetData));
|
||||
break;
|
||||
case 0x02: //Update latency
|
||||
int latency = dataTypes.ReadNextVarInt(packetData);
|
||||
|
|
@ -1366,7 +1365,6 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
catch (System.IO.IOException) { return false; }
|
||||
catch (ObjectDisposedException) { return false; }
|
||||
}
|
||||
|
||||
public bool SendWindowAction(int windowId, int slotId, WindowActionType action, Item item)
|
||||
{
|
||||
try
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue