Add living entity packets

This commit is contained in:
2020-09-23 15:36:18 -06:00
parent 43f4eb3517
commit 0e616dc7c1
4 changed files with 94 additions and 10 deletions
+26 -3
View File
@@ -10,7 +10,17 @@ from panda3d.core import LPoint3f
from minecraft.networking.packets import Packet, clientbound, serverbound
from minecraft.networking.types import BlockFace
from protocol.packets import TimeUpdatePacket, SetSlotPacket, PlayerDiggingPacket, BlockBreakAnimationPacket, AcknowledgePlayerDiggingPacket, HeldItemChangePacket, PickItemPacket, OpenWindowPacket, ClickWindowPacket, CloseWindowPacket, ServerWindowConfirmationPacket, ClientWindowConfirmationPacket, EntityMetadataPacket
from protocol.packets import (
TimeUpdatePacket, SetSlotPacket, PlayerDiggingPacket,
BlockBreakAnimationPacket, AcknowledgePlayerDiggingPacket,
HeldItemChangePacket, PickItemPacket, OpenWindowPacket,
ClickWindowPacket, CloseWindowPacket, ServerWindowConfirmationPacket,
ClientWindowConfirmationPacket, EntityMetadataPacket,
SpawnLivingEntityPacket, EntityPositionPacket,
EntityPositionRotationPacket,
)
from protocol.types import Slot
import utils
@@ -190,6 +200,9 @@ class Game:
register(self.handle_window_confirmation, ClientWindowConfirmationPacket)
register(self.handle_spawn_object, clientbound.play.SpawnObjectPacket)
register(self.handle_entity_metadata, EntityMetadataPacket)
register(self.handle_spawn_living, SpawnLivingEntityPacket)
register(self.handle_entity_position, EntityPositionPacket)
register(self.handle_entity_position_rotation, EntityPositionRotationPacket)
#register(self.handle_packet, Packet, early=True)
@@ -497,13 +510,23 @@ class Game:
self.g.connection.write_packet(packet2)
def handle_spawn_object(self, packet):
return
print(packet)
print(packet.type_id)
def handle_entity_metadata(self, packet):
return
if packet.metadata and packet.metadata[0].index == 1: return
print(packet)
def handle_packet(self, packet):
def handle_spawn_living(self, packet):
print(packet)
def handle_entity_position(self, packet):
return
print(packet)
def handle_entity_position_rotation(self, packet):
return
print(packet)
def tick(self):