C++ 活塞代码

#include <iostream>
#include "minecraft.h"
using namespace std;
TxMinecraft mc;
int id,data;
void dizuo(int x,int y,int z){
	id = 251,data = 7;
	mc.fillBlocks(x,y,z,x+9,y+7,z+7,id,data);
	id = 4,data = 0;
	mc.fillBlocks(x+1,y+1,z+1,x+8,y+7,z+6,id,data);
	mc.fillBlocks(x+0,y+1,z+1,x+9,y+6,z+6,id,data);
	mc.fillBlocks(x+1,y+1,z+0,x+8,y+6,z+7,id,data);
}
void huosaibihe(int x,int y,int z){
	id = 251;
	mc.fillBlocks(x,y,z-1,x+9,y+7,z-2,id,data);
	id = 5;
	mc.fillBlocks(x+2,y,z-1,x+7,y+7,z-2,id,data);
	id = 251;
	mc.fillBlocks(x+4,y,z-1,x+5,y+7,z-2,id,data);
	id = 5;
	mc.fillBlocks(x,y+2,z-1,x+9,y+5,z-2,id,data);
	id = 251;
	mc.fillBlocks(x,y+3,z-1,x+9,y+4,z-2,id,data);
	id = 5;
	mc.fillBlocks(x+1,y+1,z-2,x+8,y+6,z-2,id,data);
}
int main() {
	bool con = mc.ConnectMinecraft("zk.makeblock.net.cn","4cd7d6e558c943c397a3a5243fa78e19");
	if(!con){
		cout<<"连接失败";
		return 1;
	}
	mc.setPlayerFly("wangyihang");
	cout<<"连接成功"; 
	int x = -541,y = 65,z = 218;
	dizuo(x,y,z);
	huosaibihe(x,y,z);
	return 0; 
}

  

posted @ 2022-11-19 19:30  王一行  阅读(32)  评论(0)    收藏  举报