本文整理汇总了Python中Block.Block.metaData方法的典型用法代码示例。如果您正苦于以下问题:Python Block.metaData方法的具体用法?Python Block.metaData怎么用?Python Block.metaData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Block.Block
的用法示例。
在下文中一共展示了Block.metaData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Packet0x21
# 需要导入模块: from Block import Block [as 别名]
# 或者: from Block.Block import metaData [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;