Skip to content

Instantly share code, notes, and snippets.

@TkTech
Created December 21, 2010 01:02
Show Gist options
  • Save TkTech/749317 to your computer and use it in GitHub Desktop.
Save TkTech/749317 to your computer and use it in GitHub Desktop.
# encoding: utf-8
#
# mobspawn.py
# pymc
#
# Created by Tyler Kennedy on 2010-12-20.
# Copyright 2010 Tyler Kennedy. All rights reserved.
#
from pymc.core.packets import Packets
from pymc.client.client import Client
@Client.add_handler(0x18, 'on_new_mob')
def MobSpawnHandler(sender):
with sender.reader.lock:
eid = sender.reader.read_int()
etype = sender.reader.read_byte()
pos = (
sender.reader.read_int(),
sender.reader.read_int(),
sender.reader.read_int()
)
yaw = sender.reader.read_byte()
pitch = sender.reader.read_byte()
sender.on_new_mob.fire(sender, eid, etype, pos, yaw, pitch)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment