Ejemplo n.º 1
0
def command(thread):
	print 'Player Block Placement'
	tuxcraft_tools.minecraft_read_int(thread.channel) # X
	tuxcraft_tools.minecraft_read_byte(thread.channel) # Y, Should be unsigned, but meh
	tuxcraft_tools.minecraft_read_int(thread.channel) # Z
	tuxcraft_tools.minecraft_read_byte(thread.channel) # Direction
	tuxcraft_tools.minecraft_read_slot(thread.channel) # Held item
	tuxcraft_tools.minecraft_read_byte(thread.channel) # Cursor X
	tuxcraft_tools.minecraft_read_byte(thread.channel) # Cursor Y
	tuxcraft_tools.minecraft_read_byte(thread.channel) # Cursor Z
Ejemplo n.º 2
0
def command(thread):

#	print 'Player Position'
	
	thread.X = tuxcraft_tools.minecraft_read_double(thread.channel)
	thread.Y = tuxcraft_tools.minecraft_read_double(thread.channel)
	thread.Stance = tuxcraft_tools.minecraft_read_double(thread.channel)
	thread.Z = tuxcraft_tools.minecraft_read_double(thread.channel)
	thread.OnGround = tuxcraft_tools.minecraft_read_byte(thread.channel)
	thread.chunker.trigger_move(thread)
Ejemplo n.º 3
0
def command(thread):
	print 'Handshake'
	thread.ProtocolVersion = tuxcraft_tools.minecraft_read_byte(thread.channel)

	thread.Username = tuxcraft_tools.minecraft_read_string(thread.channel)
	thread.ServerHost = tuxcraft_tools.minecraft_read_string(thread.channel)
	thread.ServerPort = tuxcraft_tools.minecraft_read_int(thread.channel)
	print thread.ProtocolVersion, thread.Username, thread.ServerHost, thread.ServerPort
	#thread.channel.send( b'\xff' + tuxcraft_tools.minecraft_string(u'Du identifierade dig') )
	#time.sleep(5) # The procol docs state that this is necessery due to a bug in the client
	thread.send( b'\x01' + struct.pack('>i', 1238) + tuxcraft_tools.minecraft_string(u'default') + b'\x00\x00\x00\x00\x08' )
Ejemplo n.º 4
0
def command(thread):
	print 'Player Digging'
	tuxcraft_tools.minecraft_read_byte(thread.channel) # Status
	tuxcraft_tools.minecraft_read_int(thread.channel)  # X
	tuxcraft_tools.minecraft_read_byte(thread.channel) # Y
	tuxcraft_tools.minecraft_read_int(thread.channel)  # Z
	tuxcraft_tools.minecraft_read_byte(thread.channel) # Face
Ejemplo n.º 5
0
def command(thread):
	print 'Locale and View Distance'
	thread.Locale = tuxcraft_tools.minecraft_read_string(thread.channel)
	thread.ViewDistance = tuxcraft_tools.minecraft_read_byte(thread.channel)
	thread.ChatFlags = tuxcraft_tools.minecraft_read_byte(thread.channel)
	thread.Difficulty = tuxcraft_tools.minecraft_read_byte(thread.channel)
	
	print thread.Locale, thread.ViewDistance, thread.ChatFlags, thread.Difficulty
	if thread.sent_chunks == 0:
		thread.sent_chunks = 1
		x = -7
		z = -7
		while True:
			thread.chunker.send_chunk(thread, x, z)
			x += 1
			if x == 8:
				x = -7
				z += 1 
			if z == 8:
				break
		thread.send(struct.pack('>biii', 0x06, 0, 128, 0))
		thread.send(struct.pack('>bddddffb', 0x0D, 0, 67.240000009536743, 128, 0, 0, 0, 1))
Ejemplo n.º 6
0
def command(thread):
	print 'Click Window'
	tuxcraft_tools.minecraft_read_byte(thread.channel) # Window id
	tuxcraft_tools.minecraft_read_short(thread.channel)  # Slot
	tuxcraft_tools.minecraft_read_byte(thread.channel) # Right-click
	tuxcraft_tools.minecraft_read_short(thread.channel)  # Action number
	tuxcraft_tools.minecraft_read_byte(thread.channel) # Shift
	tuxcraft_tools.minecraft_read_slot(thread.channel) # The item that was picked
Ejemplo n.º 7
0
def command(thread):
    # 	print 'Player'
    thread.OnGround = tuxcraft_tools.minecraft_read_byte(thread.channel)
Ejemplo n.º 8
0
def command(thread):
	#print 'Player Look'
	thread.Yaw = tuxcraft_tools.minecraft_read_float(thread.channel)
	thread.Pitch = tuxcraft_tools.minecraft_read_float(thread.channel)
	thread.OnGround = tuxcraft_tools.minecraft_read_byte(thread.channel)
Ejemplo n.º 9
0
def command(thread):
	print 'Animation'
	tuxcraft_tools.minecraft_read_int(thread.channel)
	thread.Animation = tuxcraft_tools.minecraft_read_byte(thread.channel)
	print thread.Animation
Ejemplo n.º 10
0
def command(thread):
	print 'Close Window ' +	str(tuxcraft_tools.minecraft_read_byte(thread.channel)) # Window id
Ejemplo n.º 11
0
def command(thread):
	#print 'Entity Action'
	tuxcraft_tools.minecraft_read_int(thread.channel) #EID
	tuxcraft_tools.minecraft_read_byte(thread.channel) #Action ID
Ejemplo n.º 12
0
def command(thread):
	print 'Client Statuses'
	input = tuxcraft_tools.minecraft_read_byte() # Bitfield