当前位置: 首页>>代码示例>>Python>>正文


Python Block.blockID方法代码示例

本文整理汇总了Python中Block.Block.blockID方法的典型用法代码示例。如果您正苦于以下问题:Python Block.blockID方法的具体用法?Python Block.blockID怎么用?Python Block.blockID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Block.Block的用法示例。


在下文中一共展示了Block.blockID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Packet0x23

# 需要导入模块: from Block import Block [as 别名]
# 或者: from Block.Block import blockID [as 别名]
	def Packet0x23(self, buff):
		Location = buff.readPosition();
		BlockID = buff.readVarInt();
		
		block = Block();
		block.location = Location;
		block.blockID = BlockID;
		self.bot.world.blocks[Location.get()] = block;
		print("block: " + str(BlockID) + " - location: " + str(Location.get()));
开发者ID:natruiz3555,项目名称:dennis,代码行数:11,代码来源:packetDispatch.py

示例2: Packet0x22

# 需要导入模块: from Block import Block [as 别名]
# 或者: from Block.Block import blockID [as 别名]
	def Packet0x22(self, buff):
		ChunkX = buff.readInt()
		ChunkZ = buff.readInt()
		Recordcount = buff.readVarInt()
		
		for i in range(Recordcount):
			position = buff.readShort();
			x = position & 0xF000;
			y = position & 0x00FF;
			z = position & 0x0F00;
			BlockID = buff.readVarInt();
			block = Block();
			block.location.set(x+ChunkX, y, z+ChunkZ);
			block.blockID = BlockID;
			self.bot.world.blocks[(x+ChunkX, y, z+ChunkZ)] = block;
开发者ID:natruiz3555,项目名称:dennis,代码行数:17,代码来源:packetDispatch.py

示例3: Packet0x21

# 需要导入模块: from Block import Block [as 别名]
# 或者: from Block.Block import blockID [as 别名]
	def Packet0x21(self, buff):
		ChunkX = buff.readInt();
		ChunkZ = buff.readInt();
		GroundUpcontinuous = buff.readBool();	
		Primarybitmap = buff.readUnsignedByte();
		Size = buff.readVarInt();
		Data = "";
		for i in range(Size/12288):
			if Primarybitmap & (1 << i):
				for j in range(4096):
					blockID = (buff.readByte() << 8) + buff.readByte();
					metaData = BlockID & 15;
					blockID <<= 4;
					x = ChunckX+(j-(j%256)%4096);
					y = (i*16)+(j%16);
					z = ChunckZ+(j-(j%16)%256)-(j%256);
					z = position & 0x0F00;
					block = Block();
					block.location.set(x+ChunkX, y, z+ChunkZ);
					block.blockID = blockID;
					block.metaData = metaData;
					self.bot.world.blocks[(x+ChunkX, y, z+ChunkZ)] = block;
开发者ID:natruiz3555,项目名称:dennis,代码行数:24,代码来源:packetDispatch.py


注:本文中的Block.Block.blockID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。