-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
1,234 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using MoBot.Protocol.Handlers; | ||
|
||
namespace MoBot.Protocol | ||
{ | ||
class PacketBlockChange : Packet | ||
{ | ||
public int X, Z; | ||
public byte Y; | ||
public int BlockID; | ||
public byte BlockMetadata; | ||
public override void HandlePacket(IHandler handler) | ||
{ | ||
handler.HandlePacketBlockChange(this); | ||
} | ||
|
||
public override void ReadPacketData(PacketBuffer buff) | ||
{ | ||
X = buff.ReadInt(); | ||
Y = buff.ReadByte(); | ||
Z = buff.ReadInt(); | ||
BlockID = buff.ReadVarInt(); | ||
BlockMetadata = buff.ReadByte(); | ||
} | ||
|
||
public override void WritePacketData(PacketBuffer buff) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using MoBot.Protocol.Handlers; | ||
using MinecraftEmuPTS.GameData; | ||
|
||
namespace MoBot.Protocol.Packets.Play | ||
{ | ||
class PacketChunkData : Packet | ||
{ | ||
public Chunk chunk; | ||
public byte[] ChunkData; | ||
public int Length; | ||
public bool RemoveChunk; | ||
public int x, z; | ||
public override void HandlePacket(IHandler handler) | ||
{ | ||
handler.HandlePacketChunkData(this); | ||
} | ||
|
||
public override void ReadPacketData(PacketBuffer buff) | ||
{ | ||
x = buff.ReadInt(); | ||
z = buff.ReadInt(); | ||
bool groundUp = buff.ReadBool(); | ||
short pbitmap = buff.ReadShort(); | ||
short abitmap = buff.ReadShort(); | ||
Length = buff.ReadInt(); | ||
ChunkData = buff.ReadBytes(Length); | ||
chunk = new Chunk(x, z, pbitmap, abitmap, groundUp, true); | ||
RemoveChunk = pbitmap == 0; | ||
} | ||
|
||
public override void WritePacketData(PacketBuffer buff) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using MoBot.Protocol.Handlers; | ||
|
||
namespace MoBot.Protocol.Packets.Play | ||
{ | ||
class PacketDestroyEntities : Packet | ||
{ | ||
public byte Length; | ||
public int[] IDList; | ||
public override void HandlePacket(IHandler handler) | ||
{ | ||
handler.HandlePacketDestroyEntities(this); | ||
} | ||
|
||
public override void ReadPacketData(PacketBuffer buff) | ||
{ | ||
Length = buff.ReadByte(); | ||
IDList = new int[Length]; | ||
for (int i = 0; i < Length; i++) | ||
IDList[i] = buff.ReadInt(); | ||
} | ||
|
||
public override void WritePacketData(PacketBuffer buff) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using MoBot.Protocol.Handlers; | ||
|
||
namespace MoBot.Protocol.Packets.Play | ||
{ | ||
class PacketEntity : Packet | ||
{ | ||
public int EntityID; | ||
public double x, y, z; | ||
|
||
public override void HandlePacket(IHandler handler) | ||
{ | ||
handler.HandlePacketEntity(this); | ||
} | ||
|
||
public override void ReadPacketData(PacketBuffer buff) | ||
{ | ||
EntityID = buff.ReadInt(); | ||
} | ||
|
||
public override void WritePacketData(PacketBuffer buff) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public class PacketEntityMove : PacketEntity | ||
{ | ||
public override void ReadPacketData(PacketBuffer buff) | ||
{ | ||
base.ReadPacketData(buff); | ||
x = (sbyte)buff.ReadByte() / 32.0; | ||
y = (sbyte)buff.ReadByte() / 32.0; | ||
z = (sbyte)buff.ReadByte() / 32.0; | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.