當前位置: 首頁>>代碼示例>>Python>>正文


Python Vehicle.setVehicle方法代碼示例

本文整理匯總了Python中vehicle.Vehicle.setVehicle方法的典型用法代碼示例。如果您正苦於以下問題:Python Vehicle.setVehicle方法的具體用法?Python Vehicle.setVehicle怎麽用?Python Vehicle.setVehicle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在vehicle.Vehicle的用法示例。


在下文中一共展示了Vehicle.setVehicle方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: len

# 需要導入模塊: from vehicle import Vehicle [as 別名]
# 或者: from vehicle.Vehicle import setVehicle [as 別名]
if len(sys.argv) == 8:
    corner1 = int(sys.argv[2]),int(sys.argv[3]),int(sys.argv[4])
    corner2 = int(sys.argv[5]),int(sys.argv[6]),int(sys.argv[7])
elif len(sys.argv) == 2:
    corner1,corner2 = getArea(basePos,0)
elif len(sys.argv) == 3:
    if sys.argv[2].startswith('r'):
        restore(vehicle,sys.argv[1],basePos)
        exit()
    corner1,corner2 = getArea(basePos,int(sys.argv[2]))
else:
    mc.postToChat("scan vehiclename x1 y1 z1 x2 y2 z2")
    mc.postToChat("scan vehiclename depth [then right-click with sword on other corner]")
    mc.postToChat("scan vehiclename restore")
    mc.postToChat("scan vehiclename [then right-click with sword on other corner]")
    mc.postToChat("All coordinates are relative to player")
    exit()

mc.postToChat("Scanning region "+str(corner1)+"-"+str(corner2))
dict = {}
for x in range(corner1[0],corner2[0]+1):
    for y in range(corner1[1],corner2[1]+1):
        for z in range(corner1[2],corner2[2]+1):
            block = vehicle.getBlockWithData(basePos.x+x,basePos.y+y,basePos.z+z)
            if block.id != AIR.id:
                dict[(x,y,z)] = block
mc.postToChat("Scanned "+str(len(dict))+" blocks")
vehicle.setVehicle(dict, rot)
save(vehicle,sys.argv[1])
開發者ID:spavle,項目名稱:mcpipy,代碼行數:31,代碼來源:scan.py


注:本文中的vehicle.Vehicle.setVehicle方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。