mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Added respawn ability in /reco
- Added a notification message when you die stating you can respawn with /reco - Added a respawn packet sent before disconnecting when using /reco Note: Why a respawn in /reco and not a /respawn command? Once respawned using the console on 1.6.2 server, the player stays invisible for other players unless he (or the other player) disconnects & reconnect so it's necessary to reconnect after respawning.
This commit is contained in:
parent
d6f4b97ffa
commit
d1770ebb02
2 changed files with 14 additions and 1 deletions
|
|
@ -251,7 +251,10 @@ namespace MinecraftClient
|
|||
case 0x83: readData(4); nbr = readNextShort(); readData(nbr); break;
|
||||
case 0x84: readData(11); nbr = readNextShort(); if (nbr > 0) { readData(nbr); } break;
|
||||
case 0x85: if (protocolversion >= 74) { readData(13); } break;
|
||||
case 0xC8: if (protocolversion >= 72) { readData(8); } else readData(5); break;
|
||||
case 0xC8:
|
||||
if (readNextInt() == 2022) { printstring("You are dead. Type /reco to respawn & reconnect.", false); }
|
||||
if (protocolversion >= 72) { readData(4); } else readData(1);
|
||||
break;
|
||||
case 0xC9: readNextString(); readData(3); break;
|
||||
case 0xCA: if (protocolversion >= 72) { readData(9); } else readData(3); break;
|
||||
case 0xCB: readNextString(); break;
|
||||
|
|
@ -748,6 +751,15 @@ namespace MinecraftClient
|
|||
}
|
||||
catch (SocketException) { return false; }
|
||||
}
|
||||
public bool SendRespawnPacket()
|
||||
{
|
||||
try
|
||||
{
|
||||
Send(new byte[] { 0xCD, 1 });
|
||||
return true;
|
||||
}
|
||||
catch (SocketException) { return false; }
|
||||
}
|
||||
public void Disconnect(string message)
|
||||
{
|
||||
if (message == null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue