编程语言
首页 > 编程语言> > C++ 第一课钻石铲代码

C++ 第一课钻石铲代码

作者:互联网

#include <iostream>
#include <string>
#include <Windows.h>
#include "minecraft.h"
using namespace std;
TxMinecraft tongxin;
int main(int arcg,char**argv){
	cout<<"准备开始"<<endl;
	string Server = "tk.makeblock.net.cn";
	string Key = "4cd7d6e558c943c397a3a5243fa78e19";
	bool con = tongxin.ConnectMinecraft(Server,Key);
	if(!con){
		cout<<"连接失败:"<<tongxin.Back_data<<endl;
		return 0;
	}
	int x=7668,y=92,z=5603;
	int id=0,data=0;
	//握把 
	id=251,data=12;
	tongxin.drawLine(x+11,y,z,x+4,y+7,z,id,data);
	id=252,data=12;
	tongxin.drawLine(x+11,y+1,z,x+5,y+8,z,id,data);
	id=251,data=12;
	tongxin.drawLine(x+12,y+1,z,x+5,y+8,z,id,data);
	tongxin.setBlock(x+12,y+2,z,id,data);
	tongxin.setBlock(x+10,y,z,id,data);
	//铲一圈 
	id=251,data=3;
	tongxin.drawLine(x+3,y+6,z,x,y+9,z,id,data);
	tongxin.drawLine(x,y+10,z,x+3,y+12,z,id,data);
	tongxin.setBlock(x,y+12,z,id,data);
	tongxin.setBlock(x+1,y+12,z,id,data);
	tongxin.drawLine(x+6,y+9,z,x+3,y+12,z,id,data);
	tongxin.drawLine(x+4,y+8,z,x+2,y+10,z,id,data);
	//填充内部
	id=252,data=3; 
	tongxin.drawLine(x+3,y+7,z,x+1,y+9,z,id,data);
	tongxin.drawLine(x+3,y+8,z,x+1,y+10,z,id,data);
	tongxin.drawLine(x+4,y+9,z,x+2,y+11,z,id,data);
	tongxin.drawLine(x+5,y+9,z,x+3,y+10,z,id,data);
	//断开连接 
	tongxin.CloseMinecraft();
	cout<<"断开连接 "<<endl;
	return 0;
}

  

标签:钻石,std,TxMinecraft,main,int,C++,第一课,include
来源: https://www.cnblogs.com/wangyihang/p/16684531.html