c++钟楼
#include <iostream> #include <string> #include "minecraft.h" using namespace std; TxMinecraft mc; int x,y,z,id,data; void a(){ //正方形 mc.fillBlocks(x,y-1,z,x+5,y-1,z+5,98,0); mc.fillBlocks(x+1,y-1,z+1,x+4,y-1,z+4,0,0); mc.fillBlocks(x,y-1,z+15,x+5,y-1,z+5+15,98,0); mc.fillBlocks(x+1,y-1,z+1+15,x+4,y-1,z+4+15,0,0); mc.fillBlocks(x+15,y-1,z,x+5+15,y-1,z+5,98,0); mc.fillBlocks(x+1+15,y-1,z+1,x+4+15,y-1,z+4,0,0); mc.fillBlocks(x+15,y-1,z+15,x+5+15,y-1,z+5+15,98,0); mc.fillBlocks(x+1+15,y-1,z+1+15,x+4+15,y-1,z+4+15,0,0); //边 mc.fillBlocks(x+1,y,z+5,x+1,y+2,z+15,98,0); mc.fillBlocks(x+1,y+3,z+5,x+1,y+3,z+15,109,0); mc.fillBlocks(x+19,y,z+5,x+19,y+2,z+15,98,0); mc.fillBlocks(x+19,y+3,z+5,x+19,y+3,z+15,109,1); mc.fillBlocks(x+5,y,z+1,x+15,y+2,z+1,98,0); mc.fillBlocks(x+5,y+3,z+1,x+15,y+3,z+1,109,2); mc.fillBlocks(x+5,y,z+19,x+15,y+2,z+19,98,0); mc.fillBlocks(x+5,y+3,z+19,x+15,y+3,z+19,109,3); } void b(){ mc.fillBlocks(x,y,z,x+5,y+1,z,98,0); mc.fillBlocks(x,y,z+20,x+5,y+1,z+20,98,0); mc.fillBlocks(x+15,y,z,x+5+15,y+1,z,98,0); mc.fillBlocks(x+20,y,z,x+20,y+1,z+5,98,0); mc.fillBlocks(x+15,y,z+20,x+5+15,y+1,z+20,98,0); mc.fillBlocks(x+20,y,z+15,x+20,y+1,z+5+15,98,0); mc.fillBlocks(x,y,z,x,y+1,z+5,98,0); mc.fillBlocks(x,y,z+15,x,y+1,z+5+15,98,0); //石英 mc.fillBlocks(x+2,y+2,z+2,x+18,y+5,z+18,155,0); mc.fillBlocks(x+3,y+2,z+3,x+17,y+5,z+17,0,0); //沙石 mc.fillBlocks(x+1,y+2,z+1,x+4,y+3+2,z+1,24,0); mc.fillBlocks(x+1,y+2,z+1,x+1,y+3+2,z+4,24,0); mc.fillBlocks(x+1,y+2,z+16,x+1,y+3+2,z+19,24,0); mc.fillBlocks(x+1,y+2,z+19,x+4,y+3+2,z+19,24,0); mc.fillBlocks(x+19,y+2,z+16,x+19,y+3+2,z+19,24,0); mc.fillBlocks(x+16,y+2,z+19,x+19,y+3+2,z+19,24,0); mc.fillBlocks(x+16,y+2,z+1,x+19,y+3+2,z+1,24,0); mc.fillBlocks(x+19,y+2,z+1,x+19,y+3+2,z+4,24,0); //台阶 mc.fillBlocks(x,y+2,z,x+5,y+2,z,109,1); mc.fillBlocks(x,y+2,z,x,y+2,z+5,109,3); mc.fillBlocks(x,y+2,z+20,x+5,y+2,z+20,109,1); mc.fillBlocks(x,y+2,z+20,x,y+2,z+20-5,109,2); mc.fillBlocks(x+20,y+2,z,x+20-5,y+2,z,109,0); mc.fillBlocks(x+20,y+2,z,x+20,y+2,z+5,109,3); mc.fillBlocks(x+20,y+2,z+20,x+20-5,y+2,z+20,109,0); mc.fillBlocks(x+20,y+2,z+20,x+20,y+2,z+20-5,109,1); mc.fillBlocks(x,y+2,z,x+4,y+2,z,109,2); mc.fillBlocks(x,y+2,z+20,x+4,y+2,z+20,109,3); mc.fillBlocks(x+15,y+2,z,x+15+4,y+2,z,109,2); mc.fillBlocks(x+20,y+2,z,x+20,y+2,z+4,109,1); mc.fillBlocks(x+15,y+2,z+20,x+15+4,y+2,z+20,109,3); mc.fillBlocks(x+20,y+2,z+20,x+20,y+2,z+20-4,109,1); mc.fillBlocks(x,y+2,z,x,y+2,z+4,109,0); mc.fillBlocks(x,y+2,z+15,x,y+2,z+15+4,109,0); } void c(){ //身体 mc.fillBlocks(x+1,y+5,z+1,x+1+3,y+5+12,z+1,24,0); mc.fillBlocks(x+1,y+5,z+1,x+1,y+5+12,z+1+3,24,0); mc.fillBlocks(x+1,y+5,z+19,x+1+3,y+5+12,z+19,24,0); mc.fillBlocks(x+1,y+5,z+19,x+1,y+5+12,z+19-3,24,0); mc.fillBlocks(x+16,y+5,z+1,x+16+3,y+5+12,z+1,24,0); mc.fillBlocks(x+19,y+5,z+1,x+19,y+5+12,z+1+3,24,0); mc.fillBlocks(x+19,y+5,z+19,x+19-3,y+5+12,z+19,24,0); mc.fillBlocks(x+19,y+5,z+19,x+19,y+5+12,z+19-3,24,0); mc.fillBlocks(x+2,y+5,z+2,x+2+16,y+5+12,z+2,24,0); mc.fillBlocks(x+2,y+5,z+18,x+2+16,y+5+12,z+18,24,0); mc.fillBlocks(x+18,y+5,z+2,x+18,y+5+12,z+2+16,24,0); mc.fillBlocks(x+2,y+5,z+2,x+2,y+5+12,z+2+16,24,0); } void d(){ mc.drawLine(x+1,y+6,z+1,x+1+3,y+6,z+1,128,2); mc.drawLine(x+1,y+6,z+19,x+1+3,y+6,z+19,128,3); mc.drawLine(x+16,y+6,z+1,x+3+16,y+6,z+1,128,2); mc.drawLine(x+19,y+6,z+1,x+19,y+6,z+1+3,128,1); mc.drawLine(x+16,y+6,z+19,x+16+3,y+6,z+19,128,3); mc.drawLine(x+19,y+6,z+19,x+19,y+6,z+19-3,128,1); mc.drawLine(x+1,y+6,z+1,x+1,y+6,z+1+3,128,0); mc.drawLine(x+1,y+6,z+16,x+1,y+6,z+16+3,128,0); for(int i=0;i<4;i++){ mc.setBlock(x+1,y+6+2+i*2,z+1,0,0); mc.setBlock(x+1,y+6+2+i*2,z+19,0,0); mc.setBlock(x+19,y+6+2+i*2,z+1,0,0); mc.setBlock(x+19,y+6+2+i*2,z+19,0,0); } id,data=156,0; //用石英楼梯围一圈 向上2格高度的位置 //在顶层也用倒置的石英楼梯围起来 for(int i=0;i<6;i++){ for(int temp_y=0;temp_y<30;temp_y++){ if(temp_y==5||temp_y==17){ if(i==5){ mc.setBlock(x+i,y+temp_y,z,id,data+1+4); mc.setBlock(x,y+temp_y,z+i,id,data+3+4); //2 mc.setBlock(x+i,y+temp_y,z+20,id,data+1+4); mc.setBlock(x,y+temp_y,z+20-i,id,data+2+4); //3 mc.setBlock(x+20-i,y+temp_y,z,id,data+4); //4 mc.setBlock(x+20,y+temp_y,z+i,id,data+3+4); //5 mc.setBlock(x+20-i,y+temp_y,z+20,id,data+4); //6 mc.setBlock(x+20,y+temp_y,z+20-i,id,data+2+4);} else{ //1 mc.setBlock(x+i,y+temp_y,z,id,data+2+4); //2 mc.setBlock(x+i,y+temp_y,z+20,id,data+3+4); //3 mc.setBlock(x+i+15,y+temp_y,z,id,data+2+4); mc.setBlock(x+20,y+temp_y,z+i,id,data+1+4); //4 mc.setBlock(x+i+15,y+temp_y,z+20,id,data+3+4); mc.setBlock(x+20,y+temp_y,z+20-i,id,data+1+4); //1 mc.setBlock(x,y+temp_y,z+i,id,data+4); //2 mc.setBlock(x,y+temp_y,z+15+i,id,data+4); } } } } //划4条连接线 for(int i=0;i<11;i++){ for(int temp_y=0;temp_y<30;temp_y++){ if(temp_y==5||temp_y==17){ //3 mc.setBlock(x+1,y+temp_y,z+5+i,id,data+4); //1 mc.setBlock(x+5+i,y+temp_y,z+1,id,data+2+4); //4 mc.setBlock(x+19,y+temp_y,z+5+i,id,data+1+4); //2 mc.setBlock(x+5+i,y+temp_y,z+19,id,data+3+4); }} } } int main() { bool com=mc.ConnectMinecraft("zk","919b005179e840e1bf78fef437b2f298"); if(!com){ cout<<"连接失败"; } bool fly=true; mc.setPlayerFly("陈若麟",fly); x=537;y=64;z=571; mc.fillBlocks(x,y,z,x+50,y+50,z+50,0,0); c(); a(); b(); d(); return 0; } /* mc.fillBlocks(x-6,y,z-6,x+5,y,z+5,155,0); mc.fillBlocks(x-5,y,z-5,x+4,y,z+4,0,0); mc.fillBlocks(x+15,y,z-6,x+26,y,z+5,155,0); mc.fillBlocks(x+16,y,z-5,x+25,y,z+4,0,0); mc.fillBlocks(x-6,y,z+15,x+5,y,z+26,155,0); mc.fillBlocks(x-5,y,z+16,x+4,y,z+25,0,0); mc.fillBlocks(x+15,y,z-6,x+26,y,z+5,155,0); mc.fillBlocks(x+16,y,z-5,x+25,y,z+4,0,0); mc.fillBlocks(x+15,y,z+15,x+26,y,z+26,155,0); mc.fillBlocks(x+16,y,z+16,x+25,y,z+25,0,0);