首页 > 其他分享 >钟楼

钟楼

时间:2023-04-22 10:33:31浏览次数:21  
标签:钟楼 20 mc int fillBlocks data id

#include <iostream>
#include <string>
#include "minecraft.h"
using namespace std;
TxMinecraft mc;
void diji(int x,int y,int z,int id,int data){
    //4个小正方形 
    mc.fillBlocks(x,y-1,z,x+5,y-1,z+5,id,data);
    mc.fillBlocks(x+15,y-1,z,x+20,y-1,z+5,id,data);
    mc.fillBlocks(x,y-1,z+15,x+5,y-1,z+20,id,data);
    mc.fillBlocks(x+15,y-1,z+15,x+20,y-1,z+20,id,data);
    //填补草方块 
    id = 2;
    mc.fillBlocks(x+1,y-1,z+1,x+4,y-1,z+4,id,data);
    mc.fillBlocks(x+16,y-1,z+1,x+19,y-1,z+4,id,data);
    mc.fillBlocks(x+1,y-1,z+16,x+4,y-1,z+19,id,data);
    mc.fillBlocks(x+16,y-1,z+16,x+19,y-1,z+19,id,data);
    //石墙四周外围 
    id = 98;
    for(int i = -1;i<2;i++){
        mc.drawLine(x+5,y+i,z+1,x+15,y+i,z+1,id,data);
        mc.drawLine(x+5,y+i,z+19,x+15,y+i,z+19,id,data);
        mc.drawLine(x+1,y+i,z+5,x+1,y+i,z+15,id,data);
        mc.drawLine(x+19,y+i,z+5,x+19,y+i,z+15,id,data);
    }
    //上层台阶 
    id = 109;
    mc.drawLine(x+5,y+2,z+1,x+15,y+2,z+1,id,data+2);
    mc.drawLine(x+5,y+2,z+19,x+15,y+2,z+19,id,data+3);
    mc.drawLine(x+1,y+2,z+5,x+1,y+2,z+15,id,data);
    mc.drawLine(x+19,y+2,z+5,x+19,y+2,z+15,id,data+1);
}
void waiwei(int x,int y,int z,int id,int data){
    //石砖柱子
    mc.fillBlocks(x,y,z,x+5,y+1,z,id,data);//第一面
    mc.fillBlocks(x,y,z,x,y+1,z+5,id,data);//第一面
    mc.fillBlocks(x+15,y,z,x+20,y+1,z,id,data);//第二面
    mc.fillBlocks(x+20,y,z,x+20,y+1,z+5,id,data);//第二面
    mc.fillBlocks(x,y,z+20,x+5,y+1,z+20,id,data);//第三面
    mc.fillBlocks(x,y,z+15,x,y+1,z+20,id,data);//第三面
    mc.fillBlocks(x+20,y,z+15,x+20,y+1,z+20,id,data);//第四面
    mc.fillBlocks(x+15,y,z+20,x+20,y+1,z+20,id,data);//第四面
    //柱子旁边的楼梯围墙 
    id = 109;
    mc.fillBlocks(x,y+2,z,x+5,y+2,z,id,data+2);//第一面正方体 
    mc.fillBlocks(x,y+2,z,x,y+2,z+5,id,data);//第一面正方体 
    mc.setBlock(x+5,y+2,z,id,data+1);//转角 
    mc.setBlock(x,y+2,z+5,id,data+3);//转角 
    mc.fillBlocks(x+15,y+2,z,x+20,y+2,z,id,data+2);//第二面正方体 
    mc.fillBlocks(x+20,y+2,z,x+20,y+2,z+5,id,data+1);//第二面正方体 
    mc.setBlock(x+15,y+2,z,id,data);//转角 
    mc.setBlock(x+20,y+2,z+5,id,data+3);//转角 
    mc.fillBlocks(x,y+2,z+20,x+5,y+2,z+20,id,data+3);//第三面正方体 
    mc.fillBlocks(x,y+2,z+15,x,y+2,z+20,id,data);//第三面正方体 
    mc.setBlock(x+5,y+2,z+20,id,data+1);//转角 
    mc.setBlock(x,y+2,z+15,id,data+2);//转角 
    mc.fillBlocks(x+20,y+2,z+15,x+20,y+2,z+20,id,data+1);//第四面正方体 
    mc.fillBlocks(x+15,y+2,z+20,x+20,y+2,z+20,id,data+3);//第四面正方体 
    mc.setBlock(x+20,y+2,z+15,id,data+2);//转角 
    mc.setBlock(x+15,y+2,z+20,id,data);//转角 
    //砂石外围 
    id = 24;
    mc.fillBlocks(x+1,y+3,z+1,x+4,y+6,z+1,id,data);//第一面 
    mc.fillBlocks(x+1,y+3,z+1,x+1,y+6,z+4,id,data);//第一面 
    mc.fillBlocks(x+15,y+3,z+1,x+19,y+6,z+1,id,data);//第二面 
    mc.fillBlocks(x+19,y+3,z+1,x+19,y+6,z+4,id,data);//第二面 
    mc.fillBlocks(x+1,y+3,z+19,x+4,y+6,z+19,id,data);//第三面
    mc.fillBlocks(x+1,y+3,z+16,x+1,y+6,z+19,id,data);//第三面 
    mc.fillBlocks(x+19,y+3,z+16,x+19,y+6,z+19,id,data);//第四面 
    mc.fillBlocks(x+16,y+3,z+19,x+19,y+6,z+19,id,data);//第四面 
    //石英外围 
    id = 155;
    mc.fillBlocks(x+2,y+3,z+2,x+18,y+6,z+18,id,data);//大正方体 
    id = 0;
    mc.fillBlocks(x+3,y+3,z+3,x+17,y+6,z+17,id,data);//掏空 
}
void diyiceng(int x,int y,int z,int id,int data){
    //4个大正方形 
    mc.drawLine(x-1,y,z+5,x-6,y,z+5,id,data);//第一面第一条线 
    mc.drawLine(x-6,y,z+5,x-6,y,z-6,id,data);//第一面第二条线 
    mc.drawLine(x-6,y,z-6,x+5,y,z-6,id,data);//第一面第三条线 
    mc.drawLine(x+5,y,z-1,x+5,y,z-6,id,data);//第一面第四条线 
    mc.drawLine(x-1,y,z+15,x-6,y,z+15,id,data);//第二面第一条线 
    mc.drawLine(x-6,y,z+15,x-6,y,z+26,id,data);//第二面第二条线 
    mc.drawLine(x-6,y,z+26,x+5,y,z+26,id,data);//第二面第三条线 
    mc.drawLine(x+5,y,z+21,x+5,y,z+26,id,data);//第二面第四条线 
    mc.drawLine(x+21,y,z+5,x+26,y,z+5,id,data);//第三面第一条线 
    mc.drawLine(x+26,y,z+5,x+26,y,z-6,id,data);//第三面第二条线 
    mc.drawLine(x+26,y,z-6,x+15,y,z-6,id,data);//第三面第三条线 
    mc.drawLine(x+15,y,z-1,x+15,y,z-6,id,data);//第三面第四条线 
    mc.drawLine(x+21,y,z+15,x+26,y,z+15,id,data);//第四面第一条线 
    mc.drawLine(x+26,y,z+15,x+26,y,z+26,id,data);//第四面第二条线 
    mc.drawLine(x+26,y,z+26,x+15,y,z+26,id,data);//第四面第三条线 
    mc.drawLine(x+15,y,z+21,x+15,y,z+26,id,data);//第四面第四条线 
    //楼梯两侧 
    for(int i = 0;i<=2;i++){
        mc.drawLine(x+6,y+i,z-5+i,x+6,y+i,z+1,id,data);
    }
    for(int i = 0;i<=2;i++){
        mc.drawLine(x+14,y+i,z-5+i,x+14,y+i,z+1,id,data);
    }
    for(int i = 0;i<=2;i++){
        mc.drawLine(x-5+i,y+i,z+6,x+1,y+i,z+6,id,data);
    }
    for(int i = 0;i<=2;i++){
        mc.drawLine(x-5+i,y+i,z+14,x+1,y+i,z+14,id,data);
    }
    for(int i = 0;i<=2;i++){
        mc.drawLine(x+25-i,y+i,z+6,x+19,y+i,z+6,id,data);
    }
    for(int i = 0;i<=2;i++){
        mc.drawLine(x+25-i,y+i,z+14,x+19,y+i,z+14,id,data);
    }
    for(int i = 0;i<=2;i++){
        mc.drawLine(x+6,y+i,z+25-i,x+6,y+i,z+19,id,data);
    }
    for(int i = 0;i<=2;i++){
        mc.drawLine(x+14,y+i,z+25-i,x+14,y+i,z+19,id,data);
    }
    //苔石墙上升 
    id = 139,data = 1;
    mc.drawLine(x+6,y,z-6,x+6,y+3,z-2,id,data);
    mc.drawLine(x+6,y+3,z-3,x+6,y+3,z+1,id,data);
    mc.drawLine(x+14,y,z-6,x+14,y+3,z-3,id,data);
    mc.drawLine(x+14,y+3,z-3,x+14,y+3,z+1,id,data);
    mc.drawLine(x-6,y,z+6,x-3,y+3,z+6,id,data);
    mc.drawLine(x-3,y+3,z+6,x+1,y+3,z+6,id,data);
    mc.drawLine(x-6,y,z+14,x-3,y+3,z+14,id,data);
    mc.drawLine(x-3,y+3,z+14,x+1,y+3,z+14,id,data);
    mc.drawLine(x+26,y,z+6,x+23,y+3,z+6,id,data);
    mc.drawLine(x+23,y+3,z+6,x+19,y+3,z+6,id,data);
    mc.drawLine(x+26,y,z+14,x+23,y+3,z+14,id,data);
    mc.drawLine(x+23,y+3,z+14,x+19,y+3,z+14,id,data);
    mc.drawLine(x+6,y,z+26,x+6,y+3,z+23,id,data);
    mc.drawLine(x+6,y+3,z+23,x+6,y+3,z+19,id,data);
    mc.drawLine(x+14,y,z+26,x+14,y+3,z+23,id,data);
    mc.drawLine(x+14,y+3,z+23,x+14,y+3,z+19,id,data);
    //铺石英楼梯 
    id = 156,data = 0;
    for(int i = 0;i<=2;i++){
        mc.drawLine(x+7,y+i,z-5+i,x+13,y+i,z-5+i,id,data+2);
    }
    for(int i = 0;i<=2;i++){
        mc.drawLine(x-5+i,y+i,z+7,x-5+i,y+i,z+13,id,data);
    }
    for(int i = 0;i<=2;i++){
        mc.drawLine(x+25-i,y+i,z+7,x+25-i,y+i,z+13,id,data+1);
    }
    for(int i = 0;i<=2;i++){
        mc.drawLine(x+7,y+i,z+25-i,x+13,y+i,z+25-i,id,data+3);
    }
    //铺石英楼梯 
    id = 128,data = 0;
    for(int i = 0;i<=2;i++){
        mc.drawLine(x+8,y+i,z-5+i,x+8,y+i,z-5+i,id,data+2);
    }
    for(int i = 0;i<=2;i++){
        mc.drawLine(x-5+i,y+i,z+8,x-5+i,y+i,z+8,id,data);
    }
    for(int i = 0;i<=2;i++){
        mc.drawLine(x+25-i,y+i,z+8,x+25-i,y+i,z+8,id,data+1);
    }
    for(int i = 0;i<=2;i++){
        mc.drawLine(x+8,y+i,z+25-i,x+8,y+i,z+25-i,id,data+3);
    }
    for(int i = 0;i<=2;i++){
        mc.drawLine(x+12,y+i,z-5+i,x+12,y+i,z-5+i,id,data+2);
    }
    for(int i = 0;i<=2;i++){
        mc.drawLine(x-5+i,y+i,z+12,x-5+i,y+i,z+12,id,data);
    }
    for(int i = 0;i<=2;i++){
        mc.drawLine(x+25-i,y+i,z+12,x+25-i,y+i,z+12,id,data+1);
    }
    for(int i = 0;i<=2;i++){
        mc.drawLine(x+12,y+i,z+25-i,x+12,y+i,z+25-i,id,data+3);
    }
    id = 155;
    mc.fillBlocks(x+7,y+2,z-2,x+13,y+2,z+1,id,data);
    mc.fillBlocks(x-2,y+2,z+7,x+1,y+2,z+13,id,data);
    mc.fillBlocks(x+22,y+2,z+7,x+19,y+2,z+13,id,data);
    mc.fillBlocks(x+7,y+2,z+22,x+13,y+2,z+19,id,data);
    //铺砂石 
    id = 24;
    mc.fillBlocks(x+8,y+2,z-2,x+8,y+2,z+1,id,data);
    mc.fillBlocks(x-2,y+2,z+8,x+1,y+2,z+8,id,data);
    mc.fillBlocks(x+22,y+2,z+8,x+19,y+2,z+8,id,data);
    mc.fillBlocks(x+8,y+2,z+22,x+8,y+2,z+19,id,data);
    mc.fillBlocks(x+12,y+2,z-2,x+12,y+2,z+1,id,data);
    mc.fillBlocks(x-2,y+2,z+12,x+1,y+2,z+12,id,data);
    mc.fillBlocks(x+22,y+2,z+12,x+19,y+2,z+12,id,data);
    mc.fillBlocks(x+12,y+2,z+22,x+12,y+2,z+19,id,data);
}  
int main() {
    bool con = mc.ConnectMinecraft("zk.makeblock.net.cn","4cd7d6e558c943c397a3a5243fa78e19");
    if(!con){
        cout<<"连接失败";
    }                                                            
    cout<<"连接成功";
    mc.setPlayerFly("wangyihang");
    int x = 824,y = 4,z = 95,id,data;
    diji(x,y,z,98,0);
    waiwei(x,y,z,98,0);
    diyiceng(x,y,z,155,0);
    return 0;
}

 

标签:钟楼,20,mc,int,fillBlocks,data,id
From: https://www.cnblogs.com/wangyihang-xh/p/17342554.html

相关文章

  • 钟楼-c++
    #include<iostream>#include"minecraft.h"usingnamespacestd;TxMinecraftmc;intx,y,z,id,data;voidsix(intx,inty,intz){//地基四个6*6正方形空心id......
  • 钟楼(未完成)
    #include<iostream>#include<string>#include"minecraft.h"usingnamespacestd;TxMinecraftmc;intmain(intargc,char**argv){boolcon=#include<......
  • mc 钟楼
    #include<iostream>#include"minecraft.h"usingnamespacestd;TxMinecraftmc;intmain(intargc,char**argv){ boolcon=mc.ConnectMinecraft("zk.makeblock.......
  • c++钟楼
    #include<iostream>#include<string>#include"minecraft.h"usingnamespacestd;TxMinecraftmc;intx,y,z,id,data;voida(){ //正方形 mc.fillBlocks(x,y-1......
  • 钟楼
    #include<iostream>#include"minecraft.h"usingnamespacestd;TxMinecraftmc;voidno1(intx,inty,intz){intid,data;id=98;data=0;//台阶......