mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Spectator-Teleport: Add MC version check (#1825)
Feature not supported by Minecraft 1.7, only 1.8+
This commit is contained in:
parent
76a10c0cd8
commit
1d1bd69eb2
1 changed files with 13 additions and 8 deletions
|
|
@ -2060,16 +2060,21 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
|
|
||||||
public bool SendSpectate(Guid UUID)
|
public bool SendSpectate(Guid UUID)
|
||||||
{
|
{
|
||||||
try
|
// MC 1.8 or greater
|
||||||
|
if (protocolversion >= MC18Version)
|
||||||
{
|
{
|
||||||
List<byte> packet = new List<byte>();
|
try
|
||||||
packet.AddRange(dataTypes.GetUUID(UUID));
|
{
|
||||||
SendPacket(PacketTypesOut.Spectate, packet);
|
List<byte> packet = new List<byte>();
|
||||||
return true;
|
packet.AddRange(dataTypes.GetUUID(UUID));
|
||||||
|
SendPacket(PacketTypesOut.Spectate, packet);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (SocketException) { return false; }
|
||||||
|
catch (System.IO.IOException) { return false; }
|
||||||
|
catch (ObjectDisposedException) { return false; }
|
||||||
}
|
}
|
||||||
catch (SocketException) { return false; }
|
else { return false; }
|
||||||
catch (System.IO.IOException) { return false; }
|
|
||||||
catch (ObjectDisposedException) { return false; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue