本教程实现在我的世界1.13版本任意存档函数生成52个最紧凑村庄刷铁塔(非红石堆叠),效率大于2100铁/小时,建议在沼泽、海洋等biome中生成。
使用java代码实现mc函数代码的生成,见教程末尾。

高空俯视图, 村庄一个52个,4层,每层13个,
采用数据分析筛选出距离中心村庄位置最近的12个村庄,然后向上递增64层堆叠

筛选算法根据村庄机制实现,保证1个村庄的21个门到另一个村庄中心距离大于64,且村民位于村庄中心方块区域内即可。
筛选出的村庄坐标如下,每行13个,y轴相对位置为0、-64、64、-128:
[0,0,0] [-73,0,4] [-40,0,-61] [-33,0,65] [33,0,-65] [40,0,61] [73,0,-4] [-113,0,-58] [-106,0,70] [-7,0,-127] [7,0,127] [106,0,-70] [113,0,58]
[0,-64,0] [-73,-64,4] [-40,-64,-61] [-33,-64,65] [33,-64,-65] [40,-64,61] [73,-64,-4] [-113,-64,-58] [-106,-64,70] [-7,-64,-127] [7,-64,127] [106,-64,-70] [113,-64,58]
[0,64,0] [-73,64,4] [-40,64,-61] [-33,64,65] [33,64,-65] [40,64,61] [73,64,-4] [-113,64,-58] [-106,64,70] [-7,64,-127] [7,64,127] [106,64,-70] [113,64,58]
[0,128,0] [-73,128,4] [-40,128,-61] [-33,128,65] [33,128,-65] [40,128,61] [73,128,-4] [-113,128,-58] [-106,128,70] [-7,128,-127] [7,128,127] [106,128,-70] [113,128,58]

侧视图

底部物品传送

前3层生成的铁傀儡直接通过中间玻璃珠子坠落至最下层村庄的岩浆槽内

中心区域

村庄上层

村庄下层

生成傀儡

快速杀 死傀儡

一共13种村庄样式 以及13种玻璃颜色

传送铁块和花的装置

水道运送物品,代码使用了蓝冰加快物品运送速度

地下村庄防止岩浆的判断

村庄内部墙壁的生成,加入了水流、砂砾、岩浆、空气影响铁傀儡生成的判断
顶部判定还有海草、高海草、海带等,通过萤石替换

中心位置通过灵魂沙上水柱传送物品

收集装置,除物品展示框是手动加的,其余是指令生成的

存档Nbt验证
将代码修改为自己的存档路径,以及要生成刷铁塔的位置,复制到java编辑器执行main即可生成函数 village.mcfunction。
在游戏中执行指令 /function datapack:village 即可生成,一共4000+条指令可能需要3至5分钟
- import java.io.File;
- import java.io.FileNotFoundException;
- import java.io.FileOutputStream;
- import java.io.PrintWriter;
- import java.util.ArrayList;
- import java.util.Arrays;
- import java.util.List;
- import java.util.Random;
- public class VillageSystem extends Village {
- public static void main(String[] args) {
- //游戏存档位置
- String gameDir = "F:\\mc\\mc13\\saves\\test\";
- //中间村庄西北上角方块位置
- new VillageSystem(-9, 82, -9, gameDir).draw();
- }
- private List<Village> villages = new ArrayList<>();
- private VillageSystem(int x, int y, int z, String gameDir) {
- super(x, y, z);
- try {
- String dirPath = gameDir +
- "datapacks\\datapack\\data\\datapack\\functions\";
- File folder = new File(dirPath);
- if (!folder.exists()) {
- folder.mkdirs();
- File packFile = new File(gameDir + "datapacks\\datapack\\pack.mcmeta");
- if (!packFile.exists()) {
- pw = new PrintWriter(packFile);
- pw.print("{\n "pack": {\n "pack_format": 3,\n "description": "Test"\n }\n}");
- pw.flush();
- pw.close();
- }
- }
- this.pw = new PrintWriter(new FileOutputStream(new File(dirPath + "village.mcfunction")));
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- }
- addVillage();
- }
- private void printGround() {
- int groundY = y - 20;
- println("fill ", x, " ", groundY, " ", z, " ", x + 17, " ", groundY, " ", z + 17, " grass_block replace");
- println("setblock ", x + 1, " ", groundY, " ", z + 1, " glowstone replace");
- println("setblock ", x + 1, " ", groundY, " ", z + 6, " glowstone replace");
- println("setblock ", x + 1, " ", groundY, " ", z + 11, " glowstone replace");
- println("setblock ", x + 1, " ", groundY, " ", z + 16, " glowstone replace");
- println("setblock ", x + 6, " ", groundY, " ", z + 1, " glowstone replace");
- println("setblock ", x + 6, " ", groundY, " ", z + 6, " glowstone replace");
- println("setblock ", x + 6, " ", groundY, " ", z + 11, " glowstone replace");
- println("setblock ", x + 6, " ", groundY, " ", z + 16, " glowstone replace");
- println("setblock ", x + 11, " ", groundY, " ", z + 1, " glowstone replace");
- println("setblock ", x + 11, " ", groundY, " ", z + 6, " glowstone replace");
- println("setblock ", x + 11, " ", groundY, " ", z + 11, " glowstone replace");
- println("setblock ", x + 11, " ", groundY, " ", z + 16, " glowstone replace");
- println("setblock ", x + 16, " ", groundY, " ", z + 1, " glowstone replace");
- println("setblock ", x + 16, " ", groundY, " ", z + 6, " glowstone replace");
- println("setblock ", x + 16, " ", groundY, " ", z + 11, " glowstone replace");
- println("setblock ", x + 16, " ", groundY, " ", z + 16, " glowstone replace");
- }
- private void addVillage() {
- villages.add(new Village(x, y + 128, z, pw, 0));
- villages.add(new Village(x - 73, y + 128, z + 4, pw, 1));
- villages.add(new Village(x - 40, y + 128, z - 61, pw, 2));
- villages.add(new Village(x - 33, y + 128, z + 65, pw, 3));
- villages.add(new Village(x + 33, y + 128, z - 65, pw, 4));
- villages.add(new Village(x + 40, y + 128, z + 61, pw, 5));
- villages.add(new Village(x + 73, y + 128, z - 4, pw, 6));
- villages.add(new Village(x - 113, y + 128, z - 58, pw, 7));
- villages.add(new Village(x - 106, y + 128, z + 70, pw, 8));
- villages.add(new Village(x - 7, y + 128, z - 127, pw, 9));
- villages.add(new Village(x + 7, y + 128, z + 127, pw, 10));
- villages.add(new Village(x + 106, y + 128, z - 70, pw, 11));
- villages.add(new Village(x + 113, y + 128, z + 58, pw, 12));
- villages.add(new Village(x, y + 64, z, pw, 0));
- villages.add(new Village(x - 73, y + 64, z + 4, pw, 1));
- villages.add(new Village(x - 40, y + 64, z - 61, pw, 2));
- villages.add(new Village(x - 33, y + 64, z + 65, pw, 3));
- villages.add(new Village(x + 33, y + 64, z - 65, pw, 4));
- villages.add(new Village(x + 40, y + 64, z + 61, pw, 5));
- villages.add(new Village(x + 73, y + 64, z - 4, pw, 6));
- villages.add(new Village(x - 113, y + 64, z - 58, pw, 7));
- villages.add(new Village(x - 106, y + 64, z + 70, pw, 8));
- villages.add(new Village(x - 7, y + 64, z - 127, pw, 9));
- villages.add(new Village(x + 7, y + 64, z + 127, pw, 10));
- villages.add(new Village(x + 106, y + 64, z - 70, pw, 11));
- villages.add(new Village(x + 113, y + 64, z + 58, pw, 12));
- villages.add(new Village(x, y - 64, z, pw, 0));
- villages.add(new Village(x - 73, y - 64, z + 4, pw, 1));
- villages.add(new Village(x - 40, y - 64, z - 61, pw, 2));
- villages.add(new Village(x - 33, y - 64, z + 65, pw, 3));
- villages.add(new Village(x + 33, y - 64, z - 65, pw, 4));
- villages.add(new Village(x + 40, y - 64, z + 61, pw, 5));
- villages.add(new Village(x + 73, y - 64, z - 4, pw, 6));
- villages.add(new Village(x - 113, y - 64, z - 58, pw, 7));
- villages.add(new Village(x - 106, y - 64, z + 70, pw, 8));
- villages.add(new Village(x - 7, y - 64, z - 127, pw, 9));
- villages.add(new Village(x + 7, y - 64, z + 127, pw, 10));
- villages.add(new Village(x + 106, y - 64, z - 70, pw, 11));
- villages.add(new Village(x + 113, y - 64, z + 58, pw, 12));
- villages.add(new Village(x, y, z, pw, 0));
- villages.add(new Village(x - 73, y, z + 4, pw, 1));
- villages.add(new Village(x - 40, y, z - 61, pw, 2));
- villages.add(new Village(x - 33, y, z + 65, pw, 3));
- villages.add(new Village(x + 33, y, z - 65, pw, 4));
- villages.add(new Village(x + 40, y, z + 61, pw, 5));
- villages.add(new Village(x + 73, y, z - 4, pw, 6));
- villages.add(new Village(x - 113, y, z - 58, pw, 7));
- villages.add(new Village(x - 106, y, z + 70, pw, 8));
- villages.add(new Village(x - 7, y, z - 127, pw, 9));
- villages.add(new Village(x + 7, y, z + 127, pw, 10));
- villages.add(new Village(x + 106, y, z - 70, pw, 11));
- villages.add(new Village(x + 113, y, z + 58, pw, 12));
- }
- public void draw() {
- printGround();
- villages.forEach(Village::draw);
- drawGlass();
- pw.flush();
- pw.close();
- }
- private void drawGlass() {
- //红色管道方块
- println("fill ", x - 63, " ", y - 72, " ", z + 12, " ", x - 3, " ", y - 72, " ", z + 12, " blue_ice replace");
- println("fill ", x - 63, " ", y - 71, " ", z + 12, " ", x - 3, " ", y - 71, " ", z + 12, " air replace");
- println("fill ", x - 63, " ", y - 70, " ", z + 12, " ", x - 3, " ", y - 70, " ", z + 12, " red_stained_glass replace");
- println("fill ", x - 62, " ", y - 71, " ", z + 13, " ", x - 3, " ", y - 71, " ", z + 13, " red_stained_glass replace");
- println("fill ", x - 63, " ", y - 71, " ", z + 11, " ", x - 3, " ", y - 71, " ", z + 11, " red_stained_glass replace");
- println("fill ", x - 3, " ", y - 71, " ", z + 6, " ", x - 3, " ", y - 71, " ", z + 10, " red_stained_glass replace");
- println("fill ", x - 1, " ", y - 71, " ", z + 13, " ", x - 1, " ", y - 71, " ", z + 6, " red_stained_glass replace");
- println("fill ", x - 2, " ", y - 70, " ", z + 13, " ", x - 2, " ", y - 70, " ", z + 8, " red_stained_glass replace");
- //蓝冰2管道方块
- println("fill ", x - 97, " ", y - 72, " ", z + 77, " ", x - 97, " ", y - 72, " ", z + 67, " blue_ice replace");
- println("fill ", x - 97, " ", y - 71, " ", z + 77, " ", x - 97, " ", y - 71, " ", z + 67, " air replace");
- println("fill ", x - 96, " ", y - 71, " ", z + 77, " ", x - 96, " ", y - 71, " ", z + 68, " light_blue_stained_glass replace");
- println("fill ", x - 98, " ", y - 71, " ", z + 77, " ", x - 98, " ", y - 71, " ", z + 66, " light_blue_stained_glass replace");
- println("fill ", x - 97, " ", y - 72, " ", z + 66, " ", x + 120, " ", y - 72, " ", z + 66, " blue_ice replace");
- println("fill ", x - 97, " ", y - 71, " ", z + 66, " ", x + 120, " ", y - 71, " ", z + 66, " air replace");
- println("fill ", x - 97, " ", y - 70, " ", z + 77, " ", x - 97, " ", y - 70, " ", z + 66, " light_blue_stained_glass replace");
- println("fill ", x - 98, " ", y - 71, " ", z + 65, " ", x - 26, " ", y - 71, " ", z + 65, " light_blue_stained_glass replace");
- println("fill ", x - 96, " ", y - 71, " ", z + 67, " ", x - 26, " ", y - 71, " ", z + 67, " light_blue_stained_glass replace");
- println("fill ", x - 96, " ", y - 70, " ", z + 66, " ", x - 26, " ", y - 70, " ", z + 66, " light_blue_stained_glass replace");
- //蓝冰3管道方块
- println("fill ", x - 24, " ", y - 72, " ", z + 72, " ", x - 24, " ", y - 72, " ", z + 67, " blue_ice replace");
- println("fill ", x - 24, " ", y - 71, " ", z + 72, " ", x - 24, " ", y - 71, " ", z + 67, " air replace");
- println("fill ", x - 24, " ", y - 70, " ", z + 72, " ", x - 24, " ", y - 70, " ", z + 67, " orange_stained_glass replace");
- println("fill ", x - 23, " ", y - 71, " ", z + 72, " ", x - 23, " ", y - 71, " ", z + 67, " orange_stained_glass replace");
- println("fill ", x - 25, " ", y - 71, " ", z + 71, " ", x - 25, " ", y - 71, " ", z + 67, " orange_stained_glass replace");
- println("fill ", x - 4, " ", y - 71, " ", z + 65, " ", x - 25, " ", y - 71, " ", z + 65, " orange_stained_glass replace");
- println("fill ", x - 22, " ", y - 71, " ", z + 67, " ", x - 4, " ", y - 71, " ", z + 67, " orange_stained_glass replace");
- println("fill ", x - 25, " ", y - 70, " ", z + 66, " ", x - 4, " ", y - 70, " ", z + 66, " orange_stained_glass replace");
- println("fill ", x - 12, " ", y - 72, " ", z + 66, " ", x - 5, " ", y - 72, " ", z + 66, " orange_stained_glass replace");
- println("fill ", x - 14, " ", y - 72, " ", z + 66, " ", x - 21, " ", y - 72, " ", z + 66, " orange_stained_glass replace");
- //浅绿色4管道方块
- println("fill ", x - 3, " ", y - 71, " ", z + 67, " ", x + 14, " ", y - 71, " ", z + 67, " lime_stained_glass replace");
- println("fill ", x, " ", y - 71, " ", z + 65, " ", x + 49, " ", y - 71, " ", z + 65, " lime_stained_glass replace");
- println("fill ", x + 48, " ", y - 72, " ", z + 68, " ", x + 48, " ", y - 72, " ", z + 67, " blue_ice replace");
- println("fill ", x + 48, " ", y - 71, " ", z + 68, " ", x + 48, " ", y - 71, " ", z + 67, " air replace");
- println("fill ", x + 48, " ", y - 70, " ", z + 68, " ", x + 48, " ", y - 70, " ", z + 67, " lime_stained_glass replace");
- println("setblock ", x + 49, " ", y - 71, " ", z + 67, " lime_stained_glass replace");
- println("setblock ", x + 47, " ", y - 71, " ", z + 68, " lime_stained_glass replace");
- println("fill ", x + 47, " ", y - 71, " ", z + 67, " ", x + 16, " ", y - 71, " ", z + 67, " lime_stained_glass replace");
- println("fill ", x - 3, " ", y - 70, " ", z + 66, " ", x + 49, " ", y - 70, " ", z + 66, " lime_stained_glass replace");
- println("fill ", x - 2, " ", y - 72, " ", z + 65, " ", x - 2, " ", y - 72, " ", z + 7, " blue_ice replace");
- println("fill ", x - 2, " ", y - 71, " ", z + 65, " ", x - 2, " ", y - 71, " ", z + 7, " air replace");
- println("fill ", x - 3, " ", y - 71, " ", z + 65, " ", x - 3, " ", y - 71, " ", z + 14, " lime_stained_glass replace");
- println("fill ", x - 1, " ", y - 71, " ", z + 65, " ", x - 1, " ", y - 71, " ", z + 14, " lime_stained_glass replace");
- println("setblock ", x + 47, " ", y - 71, " ", z + 68, " lime_stained_glass replace");
- println("fill ", x - 2, " ", y - 70, " ", z + 14, " ", x - 2, " ", y - 70, " ", z + 65, " lime_stained_glass replace");
- println("fill ", x + 9, " ", y - 72, " ", z + 66, " ", x + 2, " ", y - 72, " ", z + 66, " lime_stained_glass replace");
- //紫红色5管道方块
- println("fill ", x + 15, " ", y - 72, " ", z + 134, " ", x + 15, " ", y - 72, " ", z + 67, " blue_ice replace");
- println("fill ", x + 15, " ", y - 71, " ", z + 134, " ", x + 15, " ", y - 71, " ", z + 67, " air replace");
- println("fill ", x + 15, " ", y - 70, " ", z + 134, " ", x + 15, " ", y - 70, " ", z + 67, " magenta_stained_glass replace");
- println("fill ", x + 16, " ", y - 71, " ", z + 133, " ", x + 16, " ", y - 71, " ", z + 68, " magenta_stained_glass replace");
- println("fill ", x + 14, " ", y - 71, " ", z + 134, " ", x + 14, " ", y - 71, " ", z + 68, " magenta_stained_glass replace");
- //白色6管道方块
- println("fill ", x + 120, " ", y - 71, " ", z + 65, " ", x + 50, " ", y - 71, " ", z + 65, " white_stained_glass replace");
- println("fill ", x + 119, " ", y - 71, " ", z + 67, " ", x + 50, " ", y - 71, " ", z + 67, " white_stained_glass replace");
- //绿色7管道方块
- println("fill ", x + 81, " ", y - 72, " ", z + 6, " ", x - 1, " ", y - 72, " ", z + 6, " blue_ice replace");
- println("fill ", x + 81, " ", y - 71, " ", z + 6, " ", x - 1, " ", y - 71, " ", z + 6, " air replace");
- println("fill ", x + 81, " ", y - 70, " ", z + 6, " ", x + 10, " ", y - 70, " ", z + 6, " green_stained_glass replace");
- println("fill ", x + 81, " ", y - 71, " ", z + 7, " ", x + 10, " ", y - 71, " ", z + 7, " green_stained_glass replace");
- println("fill ", x + 79, " ", y - 71, " ", z + 5, " ", x + 10, " ", y - 71, " ", z + 5, " green_stained_glass replace");
- //青色8管道方块
- println("fill ", x - 103, " ", y - 72, " ", z - 49, " ", x + 114, " ", y - 72, " ", z - 49, " blue_ice replace");
- println("fill ", x - 103, " ", y - 71, " ", z - 49, " ", x + 114, " ", y - 71, " ", z - 49, " air replace");
- println("fill ", x - 103, " ", y - 70, " ", z - 49, " ", x - 33, " ", y - 70, " ", z - 49, " cyan_stained_glass replace");
- println("fill ", x - 103, " ", y - 71, " ", z - 48, " ", x - 33, " ", y - 71, " ", z - 48, " cyan_stained_glass replace");
- println("fill ", x - 102, " ", y - 71, " ", z - 50, " ", x - 33, " ", y - 71, " ", z - 50, " cyan_stained_glass replace");
- //无色管道方块
- println("setblock ", x + 8, " ", y - 72, " ", z + 7, " blue_ice replace");
- println("setblock ", x + 8, " ", y - 71, " ", z + 7, " air replace");
- println("fill ", x + 9, " ", y - 70, " ", z + 6, " ", x - 1, " ", y - 70, " ", z + 6, " glass replace");
- println("fill ", x + 7, " ", y - 71, " ", z + 7, " ", x - 2, " ", y - 71, " ", z + 7, " glass replace");
- println("fill ", x + 9, " ", y - 71, " ", z + 5, " ", x - 2, " ", y - 71, " ", z + 5, " glass replace");
- //分红9管道方块
- println("fill ", x - 31, " ", y - 72, " ", z - 51, " ", x - 31, " ", y - 72, " ", z - 50, " blue_ice replace");
- println("fill ", x - 31, " ", y - 71, " ", z - 51, " ", x - 31, " ", y - 71, " ", z - 50, " air replace");
- println("setblock ", x - 31, " ", y - 70, " ", z - 50, " pink_stained_glass replace");
- println("setblock ", x - 32, " ", y - 71, " ", z - 50, " pink_stained_glass replace");
- println("setblock ", x - 30, " ", y - 71, " ", z - 51, " pink_stained_glass replace");
- println("fill ", x - 32, " ", y - 71, " ", z - 48, " ", x - 1, " ", y - 71, " ", z - 48, " pink_stained_glass replace");
- println("fill ", x - 30, " ", y - 71, " ", z - 50, " ", x + 2, " ", y - 71, " ", z - 50, " pink_stained_glass replace");
- println("fill ", x + 1, " ", y - 70, " ", z - 50, " ", x + 1, " ", y - 70, " ", z + 5, " pink_stained_glass replace");
- println("fill ", x + 1, " ", y - 72, " ", z - 48, " ", x + 1, " ", y - 72, " ", z + 5, " blue_ice replace");
- println("fill ", x + 1, " ", y - 71, " ", z - 48, " ", x + 1, " ", y - 71, " ", z + 5, " air replace");
- println("fill ", x, " ", y - 71, " ", z - 48, " ", x, " ", y - 72, " ", z + 5, " pink_stained_glass replace");
- println("fill ", x + 2, " ", y - 71, " ", z - 48, " ", x + 2, " ", y - 72, " ", z + 5, " pink_stained_glass replace");
- println("fill ", x - 32, " ", y - 70, " ", z - 49, " ", x, " ", y - 70, " ", z - 49, " pink_stained_glass replace");
- println("fill ", x - 18, " ", y - 72, " ", z - 49, " ", x - 11, " ", y - 72, " ", z - 49, " pink_stained_glass replace");
- println("fill ", x - 8, " ", y - 72, " ", z - 49, " ", x - 1, " ", y - 72, " ", z - 49, " pink_stained_glass replace");
- //蓝色10管道方块
- println("fill ", x + 1, " ", y - 72, " ", z - 117, " ", x + 1, " ", y - 72, " ", z - 50, " blue_ice replace");
- println("fill ", x + 1, " ", y - 71, " ", z - 117, " ", x + 1, " ", y - 71, " ", z - 50, " air replace");
- println("fill ", x + 1, " ", y - 70, " ", z - 116, " ", x + 1, " ", y - 70, " ", z - 51, " blue_stained_glass replace");
- println("fill ", x, " ", y - 71, " ", z - 117, " ", x, " ", y - 71, " ", z - 51, " blue_stained_glass replace");
- println("fill ", x + 2, " ", y - 71, " ", z - 116, " ", x + 2, " ", y - 71, " ", z - 51, " blue_stained_glass replace");
- //黄色11管道方块
- println("fill ", x + 3, " ", y - 71, " ", z - 48, " ", x + 42, " ", y - 71, " ", z - 48, " yellow_stained_glass replace");
- println("fill ", x + 3, " ", y - 71, " ", z - 50, " ", x + 40, " ", y - 71, " ", z - 50, " yellow_stained_glass replace");
- println("fill ", x + 3, " ", y - 70, " ", z - 49, " ", x + 42, " ", y - 70, " ", z - 49, " yellow_stained_glass replace");
- println("fill ", x + 41, " ", y - 72, " ", z - 55, " ", x + 41, " ", y - 72, " ", z - 50, " blue_ice replace");
- println("fill ", x + 41, " ", y - 71, " ", z - 55, " ", x + 41, " ", y - 71, " ", z - 50, " air replace");
- println("fill ", x + 41, " ", y - 70, " ", z - 55, " ", x + 41, " ", y - 70, " ", z - 50, " yellow_stained_glass replace");
- println("fill ", x + 40, " ", y - 71, " ", z - 55, " ", x + 40, " ", y - 71, " ", z - 51, " yellow_stained_glass replace");
- println("fill ", x + 42, " ", y - 71, " ", z - 54, " ", x + 42, " ", y - 71, " ", z - 50, " yellow_stained_glass replace");
- println("fill ", x + 10, " ", y - 72, " ", z - 49, " ", x + 3, " ", y - 72, " ", z - 49, " yellow_stained_glass replace");
- println("fill ", x + 20, " ", y - 72, " ", z - 49, " ", x + 13, " ", y - 72, " ", z - 49, " yellow_stained_glass replace");
- //紫色12管道方块
- println("fill ", x + 114, " ", y - 72, " ", z - 60, " ", x + 114, " ", y - 72, " ", z - 50, " blue_ice replace");
- println("fill ", x + 114, " ", y - 71, " ", z - 60, " ", x + 114, " ", y - 71, " ", z - 50, " air replace");
- println("fill ", x + 114, " ", y - 70, " ", z - 60, " ", x + 114, " ", y - 70, " ", z - 50, " purple_stained_glass replace");
- println("fill ", x + 113, " ", y - 71, " ", z - 60, " ", x + 113, " ", y - 71, " ", z - 51, " purple_stained_glass replace");
- println("fill ", x + 115, " ", y - 71, " ", z - 59, " ", x + 115, " ", y - 71, " ", z - 49, " purple_stained_glass replace");
- println("fill ", x + 115, " ", y - 71, " ", z - 48, " ", x + 43, " ", y - 71, " ", z - 48, " purple_stained_glass replace");
- println("fill ", x + 113, " ", y - 71, " ", z - 50, " ", x + 43, " ", y - 71, " ", z - 50, " purple_stained_glass replace");
- println("fill ", x + 114, " ", y - 70, " ", z - 49, " ", x + 43, " ", y - 70, " ", z - 49, " purple_stained_glass replace");
- //1 红色管道传送
- println("setblock ", x - 65, " ", y - 71, " ", z + 13, " water");
- println("setblock ", x - 58, " ", y - 71, " ", z + 12, " iron_trapdoor[half=top]");
- println("setblock ", x - 57, " ", y - 71, " ", z + 12, " water");
- println("setblock ", x - 49, " ", y - 71, " ", z + 12, " iron_trapdoor[half=top]");
- println("setblock ", x - 48, " ", y - 71, " ", z + 12, " water");
- println("setblock ", x - 40, " ", y - 71, " ", z + 12, " iron_trapdoor[half=top]");
- println("setblock ", x - 39, " ", y - 71, " ", z + 12, " water");
- println("setblock ", x - 31, " ", y - 71, " ", z + 12, " iron_trapdoor[half=top]");
- println("setblock ", x - 30, " ", y - 71, " ", z + 12, " water");
- println("setblock ", x - 22, " ", y - 71, " ", z + 12, " iron_trapdoor[half=top]");
- println("setblock ", x - 21, " ", y - 71, " ", z + 12, " water");
- println("setblock ", x - 13, " ", y - 71, " ", z + 12, " iron_trapdoor[half=top]");
- println("setblock ", x - 12, " ", y - 71, " ", z + 12, " water");
- println("setblock ", x - 3, " ", y - 71, " ", z + 12, " iron_trapdoor[half=top]");
- //2 淡蓝色管道传送
- println("setblock ", x - 98, " ", y - 71, " ", z + 79, " water");
- println("setblock ", x - 97, " ", y - 71, " ", z + 72, " iron_trapdoor[half=top]");
- println("setblock ", x - 97, " ", y - 71, " ", z + 71, " water");
- println("setblock ", x - 94, " ", y - 71, " ", z + 66, " iron_trapdoor[half=top]");
- println("setblock ", x - 93, " ", y - 71, " ", z + 66, " water");
- println("setblock ", x - 85, " ", y - 71, " ", z + 66, " iron_trapdoor[half=top]");
- println("setblock ", x - 84, " ", y - 71, " ", z + 66, " water");
- println("setblock ", x - 76, " ", y - 71, " ", z + 66, " iron_trapdoor[half=top]");
- println("setblock ", x - 75, " ", y - 71, " ", z + 66, " water");
- println("setblock ", x - 67, " ", y - 71, " ", z + 66, " iron_trapdoor[half=top]");
- println("setblock ", x - 66, " ", y - 71, " ", z + 66, " water");
- println("setblock ", x - 58, " ", y - 71, " ", z + 66, " iron_trapdoor[half=top]");
- println("setblock ", x - 57, " ", y - 71, " ", z + 66, " water");
- println("setblock ", x - 49, " ", y - 71, " ", z + 66, " iron_trapdoor[half=top]");
- println("setblock ", x - 48, " ", y - 71, " ", z + 66, " water");
- println("setblock ", x - 40, " ", y - 71, " ", z + 66, " iron_trapdoor[half=top]");
- println("setblock ", x - 39, " ", y - 71, " ", z + 66, " water");
- println("setblock ", x - 31, " ", y - 71, " ", z + 66, " iron_trapdoor[half=top]");
- println("setblock ", x - 30, " ", y - 71, " ", z + 66, " water");
- println("setblock ", x - 24, " ", y - 71, " ", z + 67, " iron_trapdoor[half=top]");
- println("setblock ", x - 25, " ", y - 71, " ", z + 74, " water");
- println("setblock ", x - 22, " ", y - 71, " ", z + 66, " iron_trapdoor[half=top]");
- println("setblock ", x - 21, " ", y - 71, " ", z + 66, " water");
- println("setblock ", x - 13, " ", y - 71, " ", z + 66, " iron_trapdoor[half=top]");
- println("setblock ", x - 12, " ", y - 71, " ", z + 66, " water");
- //白色管道传送
- println("setblock ", x + 122, " ", y - 71, " ", z + 67, " water");
- println("setblock ", x + 115, " ", y - 71, " ", z + 66, " iron_trapdoor[half=top]");
- println("setblock ", x + 114, " ", y - 71, " ", z + 66, " water");
- println("setblock ", x + 106, " ", y - 71, " ", z + 66, " iron_trapdoor[half=top]");
- println("setblock ", x + 105, " ", y - 71, " ", z + 66, " water");
- println("setblock ", x + 97, " ", y - 71, " ", z + 66, " iron_trapdoor[half=top]");
- println("setblock ", x + 96, " ", y - 71, " ", z + 66, " water");
- println("setblock ", x + 88, " ", y - 71, " ", z + 66, " iron_trapdoor[half=top]");
- println("setblock ", x + 87, " ", y - 71, " ", z + 66, " water");
- println("setblock ", x + 79, " ", y - 71, " ", z + 66, " iron_trapdoor[half=top]");
- println("setblock ", x + 78, " ", y - 71, " ", z + 66, " water");
- println("setblock ", x + 70, " ", y - 71, " ", z + 66, " iron_trapdoor[half=top]");
- println("setblock ", x + 69, " ", y - 71, " ", z + 66, " water");
- println("setblock ", x + 61, " ", y - 71, " ", z + 66, " iron_trapdoor[half=top]");
- println("setblock ", x + 60, " ", y - 71, " ", z + 66, " water");
- //粉红管道传送
- println("setblock ", x + 16, " ", y - 71, " ", z + 136, " water");
- println("setblock ", x + 15, " ", y - 71, " ", z + 129, " iron_trapdoor[half=top]");
- println("setblock ", x + 15, " ", y - 71, " ", z + 128, " water");
- println("setblock ", x + 15, " ", y - 71, " ", z + 120, " iron_trapdoor[half=top]");
- println("setblock ", x + 15, " ", y - 71, " ", z + 119, " water");
- println("setblock ", x + 15, " ", y - 71, " ", z + 111, " iron_trapdoor[half=top]");
- println("setblock ", x + 15, " ", y - 71, " ", z + 110, " water");
- println("setblock ", x + 15, " ", y - 71, " ", z + 102, " iron_trapdoor[half=top]");
- println("setblock ", x + 15, " ", y - 71, " ", z + 101, " water");
- println("setblock ", x + 15, " ", y - 71, " ", z + 93, " iron_trapdoor[half=top]");
- println("setblock ", x + 15, " ", y - 71, " ", z + 92, " water");
- println("setblock ", x + 15, " ", y - 71, " ", z + 84, " iron_trapdoor[half=top]");
- println("setblock ", x + 15, " ", y - 71, " ", z + 83, " water");
- println("setblock ", x + 15, " ", y - 71, " ", z + 75, " iron_trapdoor[half=top]");
- println("setblock ", x + 15, " ", y - 71, " ", z + 74, " water");
- println("setblock ", x + 15, " ", y - 71, " ", z + 67, " iron_trapdoor[half=top]");
- //浅绿管道传送
- println("setblock ", x + 49, " ", y - 71, " ", z + 66, " iron_trapdoor[half=top]");
- println("setblock ", x + 49, " ", y - 71, " ", z + 70, " water");
- println("setblock ", x + 45, " ", y - 71, " ", z + 66, " iron_trapdoor[half=top]");
- println("setblock ", x + 44, " ", y - 71, " ", z + 66, " water");
- println("setblock ", x + 36, " ", y - 71, " ", z + 66, " iron_trapdoor[half=top]");
- println("setblock ", x + 35, " ", y - 71, " ", z + 66, " water");
- println("setblock ", x + 28, " ", y - 71, " ", z + 66, " iron_trapdoor[half=top]");
- println("setblock ", x + 27, " ", y - 71, " ", z + 66, " water");
- println("setblock ", x + 19, " ", y - 71, " ", z + 66, " iron_trapdoor[half=top]");
- println("setblock ", x + 18, " ", y - 71, " ", z + 66, " water");
- println("setblock ", x + 10, " ", y - 71, " ", z + 66, " iron_trapdoor[half=top]");
- println("setblock ", x + 9, " ", y - 71, " ", z + 66, " water");
- println("setblock ", x + 1, " ", y - 71, " ", z + 66, " iron_trapdoor[half=top]");
- println("setblock ", x, " ", y - 71, " ", z + 66, " water");
- println("setblock ", x - 3, " ", y - 71, " ", z + 66, " iron_trapdoor[half=top]");
- println("setblock ", x - 2, " ", y - 71, " ", z + 60, " iron_trapdoor[half=top]");
- println("setblock ", x - 2, " ", y - 71, " ", z + 59, " water");
- println("setblock ", x - 2, " ", y - 71, " ", z + 51, " iron_trapdoor[half=top]");
- println("setblock ", x - 2, " ", y - 71, " ", z + 50, " water");
- println("setblock ", x - 2, " ", y - 71, " ", z + 42, " iron_trapdoor[half=top]");
- println("setblock ", x - 2, " ", y - 71, " ", z + 41, " water");
- println("setblock ", x - 2, " ", y - 71, " ", z + 33, " iron_trapdoor[half=top]");
- println("setblock ", x - 2, " ", y - 71, " ", z + 32, " water");
- println("setblock ", x - 2, " ", y - 71, " ", z + 24, " iron_trapdoor[half=top]");
- println("setblock ", x - 2, " ", y - 71, " ", z + 23, " water");
- println("setblock ", x - 2, " ", y - 71, " ", z + 15, " iron_trapdoor[half=top]");
- println("setblock ", x - 2, " ", y - 71, " ", z + 14, " water");
- //绿色管道传送
- println("setblock ", x + 82, " ", y - 71, " ", z + 4, " water");
- println("setblock ", x + 76, " ", y - 71, " ", z + 6, " iron_trapdoor[half=top]");
- println("setblock ", x + 75, " ", y - 71, " ", z + 6, " water");
- println("setblock ", x + 67, " ", y - 71, " ", z + 6, " iron_trapdoor[half=top]");
- println("setblock ", x + 66, " ", y - 71, " ", z + 6, " water");
- println("setblock ", x + 58, " ", y - 71, " ", z + 6, " iron_trapdoor[half=top]");
- println("setblock ", x + 57, " ", y - 71, " ", z + 6, " water");
- println("setblock ", x + 49, " ", y - 71, " ", z + 6, " iron_trapdoor[half=top]");
- println("setblock ", x + 48, " ", y - 71, " ", z + 6, " water");
- println("setblock ", x + 40, " ", y - 71, " ", z + 6, " iron_trapdoor[half=top]");
- println("setblock ", x + 39, " ", y - 71, " ", z + 6, " water");
- println("setblock ", x + 31, " ", y - 71, " ", z + 6, " iron_trapdoor[half=top]");
- println("setblock ", x + 30, " ", y - 71, " ", z + 6, " water");
- println("setblock ", x + 22, " ", y - 71, " ", z + 6, " iron_trapdoor[half=top]");
- println("setblock ", x + 21, " ", y - 71, " ", z + 6, " water");
- println("setblock ", x + 13, " ", y - 71, " ", z + 6, " iron_trapdoor[half=top]");
- println("setblock ", x + 12, " ", y - 71, " ", z + 6, " water");
- println("setblock ", x + 4, " ", y - 71, " ", z + 6, " iron_trapdoor[half=top]");
- println("setblock ", x + 3, " ", y - 71, " ", z + 6, " water");
- //无色管道传送
- println("setblock ", x + 8, " ", y - 71, " ", z + 7, " iron_trapdoor[half=top]");
- println("setblock ", x + 9, " ", y - 71, " ", z + 9, " water");
- //青色管道传送
- println("setblock ", x - 105, " ", y - 71, " ", z - 50, " water");
- println("setblock ", x - 98, " ", y - 71, " ", z - 49, " iron_trapdoor[half=top]");
- println("setblock ", x - 97, " ", y - 71, " ", z - 49, " water");
- println("setblock ", x - 89, " ", y - 71, " ", z - 49, " iron_trapdoor[half=top]");
- println("setblock ", x - 88, " ", y - 71, " ", z - 49, " water");
- println("setblock ", x - 80, " ", y - 71, " ", z - 49, " iron_trapdoor[half=top]");
- println("setblock ", x - 79, " ", y - 71, " ", z - 49, " water");
- println("setblock ", x - 71, " ", y - 71, " ", z - 49, " iron_trapdoor[half=top]");
- println("setblock ", x - 70, " ", y - 71, " ", z - 49, " water");
- println("setblock ", x - 62, " ", y - 71, " ", z - 49, " iron_trapdoor[half=top]");
- println("setblock ", x - 61, " ", y - 71, " ", z - 49, " water");
- println("setblock ", x - 53, " ", y - 71, " ", z - 49, " iron_trapdoor[half=top]");
- println("setblock ", x - 52, " ", y - 71, " ", z - 49, " water");
- println("setblock ", x - 44, " ", y - 71, " ", z - 49, " iron_trapdoor[half=top]");
- println("setblock ", x - 43, " ", y - 71, " ", z - 49, " water");
- println("setblock ", x - 32, " ", y - 71, " ", z - 49, " iron_trapdoor[half=top]");
- //粉红色管道传送
- println("setblock ", x - 32, " ", y - 71, " ", z - 53, " water");
- println("setblock ", x - 28, " ", y - 71, " ", z - 49, " iron_trapdoor[half=top]");
- println("setblock ", x - 27, " ", y - 71, " ", z - 49, " water");
- println("setblock ", x - 19, " ", y - 71, " ", z - 49, " iron_trapdoor[half=top]");
- println("setblock ", x - 18, " ", y - 71, " ", z - 49, " water");
- println("setblock ", x - 9, " ", y - 71, " ", z - 49, " iron_trapdoor[half=top]");
- println("setblock ", x - 8, " ", y - 71, " ", z - 49, " water");
- println("setblock ", x, " ", y - 71, " ", z - 49, " iron_trapdoor[half=top]");
- //蓝色管道传送
- println("setblock ", x + 2, " ", y - 71, " ", z - 119, " water");
- println("setblock ", x + 1, " ", y - 71, " ", z - 112, " iron_trapdoor[half=top]");
- println("setblock ", x + 1, " ", y - 71, " ", z - 111, " water");
- println("setblock ", x + 1, " ", y - 71, " ", z - 103, " iron_trapdoor[half=top]");
- println("setblock ", x + 1, " ", y - 71, " ", z - 102, " water");
- println("setblock ", x + 1, " ", y - 71, " ", z - 94, " iron_trapdoor[half=top]");
- println("setblock ", x + 1, " ", y - 71, " ", z - 93, " water");
- println("setblock ", x + 1, " ", y - 71, " ", z - 85, " iron_trapdoor[half=top]");
- println("setblock ", x + 1, " ", y - 71, " ", z - 84, " water");
- println("setblock ", x + 1, " ", y - 71, " ", z - 76, " iron_trapdoor[half=top]");
- println("setblock ", x + 1, " ", y - 71, " ", z - 75, " water");
- println("setblock ", x + 1, " ", y - 71, " ", z - 67, " iron_trapdoor[half=top]");
- println("setblock ", x + 1, " ", y - 71, " ", z - 66, " water");
- println("setblock ", x + 1, " ", y - 71, " ", z - 58, " iron_trapdoor[half=top]");
- println("setblock ", x + 1, " ", y - 71, " ", z - 57, " water");
- println("setblock ", x + 1, " ", y - 71, " ", z - 51, " iron_trapdoor[half=top]");
- println("setblock ", x + 1, " ", y - 71, " ", z - 50, " water");
- println("setblock ", x + 1, " ", y - 71, " ", z - 42, " iron_trapdoor[half=top]");
- println("setblock ", x + 1, " ", y - 71, " ", z - 41, " water");
- println("setblock ", x + 1, " ", y - 71, " ", z - 33, " iron_trapdoor[half=top]");
- println("setblock ", x + 1, " ", y - 71, " ", z - 32, " water");
- println("setblock ", x + 1, " ", y - 71, " ", z - 24, " iron_trapdoor[half=top]");
- println("setblock ", x + 1, " ", y - 71, " ", z - 23, " water");
- println("setblock ", x + 1, " ", y - 71, " ", z - 15, " iron_trapdoor[half=top]");
- println("setblock ", x + 1, " ", y - 71, " ", z - 14, " water");
- println("setblock ", x + 1, " ", y - 71, " ", z - 6, " iron_trapdoor[half=top]");
- println("setblock ", x + 1, " ", y - 71, " ", z - 5, " water");
- println("setblock ", x + 1, " ", y - 71, " ", z + 5, " iron_trapdoor[half=top]");
- //紫色管道传送
- println("setblock ", x + 115, " ", y - 71, " ", z - 62, " water");
- println("setblock ", x + 114, " ", y - 71, " ", z - 55, " iron_trapdoor[half=top]");
- println("setblock ", x + 114, " ", y - 71, " ", z - 54, " water");
- println("setblock ", x + 111, " ", y - 71, " ", z - 49, " iron_trapdoor[half=top]");
- println("setblock ", x + 110, " ", y - 71, " ", z - 49, " water");
- println("setblock ", x + 102, " ", y - 71, " ", z - 49, " iron_trapdoor[half=top]");
- println("setblock ", x + 101, " ", y - 71, " ", z - 49, " water");
- println("setblock ", x + 93, " ", y - 71, " ", z - 49, " iron_trapdoor[half=top]");
- println("setblock ", x + 92, " ", y - 71, " ", z - 49, " water");
- println("setblock ", x + 84, " ", y - 71, " ", z - 49, " iron_trapdoor[half=top]");
- println("setblock ", x + 83, " ", y - 71, " ", z - 49, " water");
- println("setblock ", x + 75, " ", y - 71, " ", z - 49, " iron_trapdoor[half=top]");
- println("setblock ", x + 74, " ", y - 71, " ", z - 49, " water");
- println("setblock ", x + 66, " ", y - 71, " ", z - 49, " iron_trapdoor[half=top]");
- println("setblock ", x + 65, " ", y - 71, " ", z - 49, " water");
- println("setblock ", x + 58, " ", y - 71, " ", z - 49, " iron_trapdoor[half=top]");
- println("setblock ", x + 57, " ", y - 71, " ", z - 49, " water");
- println("setblock ", x + 49, " ", y - 71, " ", z - 49, " iron_trapdoor[half=top]");
- println("setblock ", x + 48, " ", y - 71, " ", z - 49, " water");
- //黄色管道传送
- println("setblock ", x + 42, " ", y - 71, " ", z - 57, " water");
- println("setblock ", x + 40, " ", y - 71, " ", z - 49, " iron_trapdoor[half=top]");
- println("setblock ", x + 39, " ", y - 71, " ", z - 49, " water");
- println("setblock ", x + 31, " ", y - 71, " ", z - 49, " iron_trapdoor[half=top]");
- println("setblock ", x + 30, " ", y - 71, " ", z - 49, " water");
- println("setblock ", x + 21, " ", y - 71, " ", z - 49, " iron_trapdoor[half=top]");
- println("setblock ", x + 20, " ", y - 71, " ", z - 49, " water");
- println("setblock ", x + 11, " ", y - 71, " ", z - 49, " iron_trapdoor[half=top]");
- println("setblock ", x + 10, " ", y - 71, " ", z - 49, " water");
- println("setblock ", x + 2, " ", y - 71, " ", z - 49, " iron_trapdoor[half=top]");
- println("setblock ", x - 1, " ", y - 71, " ", z + 6, " oak_fence_gate[open=true]");
- println("setblock ", x - 2, " ", y - 71, " ", z + 7, " oak_fence_gate[open=true]");
- println("fill ", x - 1, " ", y - 16, " ", z + 6, " ", x - 3, " ", y - 70, " ", z + 6, " glass replace");
- println("fill ", x - 2, " ", y - 16, " ", z + 7, " ", x - 2, " ", y - 70, " ", z + 5, " glass replace");
- println("setblock ", x - 2, " ", y - 72, " ", z + 6, " soul_sand replace");
- println("fill ", x - 2, " ", y - 71, " ", z + 6, " ", x - 2, " ", y - 16, " ", z + 6, " water replace");
- println("setblock ", x - 2, " ", y - 15, " ", z + 6, " sea_lantern replace");
- println("setblock ", x - 1, " ", y - 16, " ", z + 5, " oak_fence_gate[open=true]");
- println("setblock ", x - 1, " ", y - 16, " ", z + 7, " oak_fence_gate[open=true]");
- println("setblock ", x + 1, " ", y - 72, " ", z - 49, " soul_sand replace");
- println("setblock ", x, " ", y - 16, " ", z + 6, " glass");
- println("setblock ", x - 1, " ", y - 16, " ", z + 6, " air replace");
- println("fill ", x - 1, " ", y - 19, " ", z + 6, " ", x - 1, " ", y - 17, " ", z + 6, " hopper[facing=east] replace");
- println("setblock ", x, " ", y - 19, " ", z + 6, " chest[type=single] replace");
- println("setblock ", x, " ", y - 18, " ", z + 6, " chest[type=single] replace");
- println("setblock ", x, " ", y - 17, " ", z + 6, " chest[type=single] replace");
- println("setblock ", x + 1, " ", y - 19, " ", z + 6, " chest[type=right] replace");
- println("setblock ", x + 1, " ", y - 18, " ", z + 6, " chest[type=right] replace");
- println("setblock ", x + 1, " ", y - 17, " ", z + 6, " chest[type=right] replace");
- }
- }
- class Village {
- protected static final String[] GLASSES = {
- "glass",
- "red_stained_glass",
- "pink_stained_glass",
- "orange_stained_glass",
- "yellow_stained_glass",
- "lime_stained_glass",
- "green_stained_glass",
- "cyan_stained_glass",
- "light_blue_stained_glass",
- "blue_stained_glass",
- "magenta_stained_glass",
- "purple_stained_glass",
- "white_stained_glass",
- };
- protected int x;
- protected int y;
- protected int z;
- protected PrintWriter pw;
- private int index;
- private String block;
- private String stairs;
- private String door;
- private String slab;
- private String blockBak;
- private String glass;
- protected Village() {
- }
- protected Village(int x, int y, int z) {
- this.x = x;
- this.y = y;
- this.z = z;
- }
- public Village(int x, int y, int z, PrintWriter pw, int index) {
- this(x, y, z);
- this.index = index;
- this.pw=pw;
- Stone stone = Stone.get(index);
- Stone door = Stone.door(index);
- this.block = stone.getBlock();
- this.slab = stone.getSlab();
- this.stairs = stone.getStairs();
- this.blockBak = stone.getBakBlock();
- this.door = door.getDoor();
- glass = GLASSES[index % 13];
- }
- private boolean underground() {
- return y < 63;
- }
- private static String chain(Object... objs) {
- StringBuilder sb = new StringBuilder();
- for (Object obj : objs) {
- sb.append(obj == null ? "" : obj);
- }
- return sb.toString();
- }
- protected void println(Object... objs) {
- pw.println(chain(objs));
- }
- private Village drawPeople() {
- Random random = new Random();
- println("summon villager ", x + 16, " ", y - 3, " ", z + 16, makeVillager(random));
- println("summon villager ", x + 16, " ", y - 3, " ", z + 16, makeVillager(random));
- println("summon villager ", x + 16, " ", y - 3, " ", z + 16, makeVillager(random));
- println("summon villager ", x + 1, " ", y - 3, " ", z + 16, makeVillager(random));
- println("summon villager ", x + 1, " ", y - 3, " ", z + 16, makeVillager(random));
- println("summon villager ", x + 1, " ", y - 3, " ", z + 1, makeVillager(random));
- println("summon villager ", x + 1, " ", y - 3, " ", z + 1, makeVillager(random));
- println("summon villager ", x + 1, " ", y - 3, " ", z + 1, makeVillager(random));
- println("summon villager ", x + 16, " ", y - 3, " ", z + 1, makeVillager(random));
- println("summon villager ", x + 16, " ", y - 3, " ", z + 1, makeVillager(random));
- return this;
- }
- private Village drawWall() {
- drawNorth();
- drawSouth();
- drawWest();
- drawEast();
- return this;
- }
- public void draw() {
- fillAir().drawUpFloor().drawDownFloor().drawWall().drawPeople();
- }
- /**
- * 填充空气
- */
- private Village fillAir() {
- //如果在地下
- if (underground()) {
- println("fill ", x - 2, " ", y + 5, " ", z - 2, " ", x + 19, " ", y - 7, " ", z + 19, " ", glass, " replace lava");
- println("fill ", x - 3, " ", y + 4, " ", z - 3, " ", x + 20, " ", y - 7, " ", z + 20, " glowstone replace mossy_cobblestone");
- //设置天花板
- println("fill ", x - 2, " ", y + 4, " ", z - 2, " ", x + 19, " ", y + 4, " ", z + 19, " glowstone keep");
- println("fill ", x - 2, " ", y + 3, " ", z - 2, " ", x + 19, " ", y + 1, " ", z + 19, " ", glass, " replace");
- println("fill ", x - 2, " ", y + 4, " ", z - 2, " ", x + 19, " ", y + 3, " ", z + 19, " glowstone replace lava");
- println("fill ", x - 2, " ", y + 4, " ", z - 2, " ", x + 19, " ", y + 3, " ", z + 19, " glowstone replace water");
- println("fill ", x - 2, " ", y + 4, " ", z - 2, " ", x + 19, " ", y + 3, " ", z + 19, " glowstone replace seagrass");
- println("fill ", x - 2, " ", y + 4, " ", z - 2, " ", x + 19, " ", y + 3, " ", z + 19, " glowstone replace tall_seagrass");
- println("fill ", x - 2, " ", y + 4, " ", z - 2, " ", x + 19, " ", y + 3, " ", z + 19, " glowstone replace kelp_plant");
- println("fill ", x, " ", y + 4, " ", z, " ", x + 17, " ", y + 3, " ", z + 17, " glowstone replace gravel");
- //防止岩浆穿透
- println("fill ", x + 19, " ", y, " ", z + 6, " ", x + 8, " ", y - 4, " ", z + 11, " ", glass, " replace lava");
- println("fill ", x + 11, " ", y, " ", z + 19, " ", x + 6, " ", y - 4, " ", z + 18, " ", glass, " replace lava");
- println("fill ", x - 2, " ", y, " ", z + 11, " ", x - 1, " ", y - 4, " ", z + 7, " ", glass, " replace lava");
- println("fill ", x + 7, " ", y, " ", z - 2, " ", x + 11, " ", y - 4, " ", z - 1, " ", glass, " replace lava");
- int top = index == 0 ? 63 : 62;
- //垂直贯穿 东
- println("fill ", x + 19, " ", top, " ", z + 12, " ", x + 17, " ", y - 4, " ", z + 6, " ", glass, " replace");
- println("fill ", x + 18, " ", 72, " ", z + 11, " ", x + 18, " ", y - 4, " ", z + 7, " air replace");
- //垂直贯穿北
- println("fill ", x + 12, " ", top, " ", z - 2, " ", x + 6, " ", y - 4, " ", z, " ", glass, " replace");
- println("fill ", x + 11, " ", 72, " ", z - 1, " ", x + 7, " ", y - 4, " ", z - 1, " air replace");
- //垂直贯穿 西
- println("fill ", x, " ", top, " ", z + 6, " ", x - 2, " ", y - 4, " ", z + 12, " ", glass, " replace");
- println("fill ", x - 1, " ", 72, " ", z + 7, " ", x - 1, " ", y - 4, " ", z + 11, " air replace");
- //垂直贯穿 南
- println("fill ", x + 6, " ", top, " ", z + 17, " ", x + 13, " ", y - 4, " ", z + 19, " ", glass, " replace");
- println("fill ", x + 7, " ", 72, " ", z + 18, " ", x + 12, " ", y - 4, " ", z + 18, " air replace");
- }
- //填充空气
- println("fill ", x, " ", y + 3, " ", z, " ", x + 17, " ", y - 4, " ", z + 17, " air replace");
- return this;
- }
- private Village drawUpFloor() {
- println("fill ", x + 1, " ", y - 1, " ", z + 1, " ", x + 16, " ", y - 1, " ", z + 16, " ", slab, "[type=top] replace");
- println("fill ", x + 8, " ", y - 1, " ", z + 8, " ", x + 9, " ", y - 1, " ", z + 9, " air replace");
- return this;
- }
- private Village drawDownFloor() {
- println("fill ", x + 1, " ", y - 5, " ", z + 1, " ", x + 16, " ", y - 5, " ", z + 16, " packed_ice replace");
- println("fill ", x + 8, " ", y - 5, " ", z + 8, " ", x + 9, " ", y - 5, " ", z + 9, " air replace");
- println("fill ", x + 1, " ", y, " ", z + 1, " ", x + 1, " ", y, " ", z + 1, " glowstone replace");
- println("fill ", x + 1, " ", y - 4, " ", z + 1, " ", x + 1, " ", y - 4, " ", z + 1, " glowstone replace");
- println("fill ", x + 1, " ", y - 2, " ", z + 2, " ", x + 1, " ", y - 3, " ", z + 2, " ", glass, " replace");
- println("fill ", x + 2, " ", y - 2, " ", z + 1, " ", x + 2, " ", y - 3, " ", z + 1, " ", glass, " replace");
- println("fill ", x + 16, " ", y, " ", z + 1, " ", x + 16, " ", y, " ", z + 1, " glowstone replace");
- println("fill ", x + 16, " ", y - 4, " ", z + 1, " ", x + 16, " ", y - 4, " ", z + 1, " glowstone replace");
- println("fill ", x + 16, " ", y - 2, " ", z + 2, " ", x + 16, " ", y - 3, " ", z + 2, " ", glass, " replace");
- println("fill ", x + 15, " ", y - 2, " ", z + 1, " ", x + 15, " ", y - 3, " ", z + 1, " ", glass, " replace");
- println("fill ", x + 1, " ", y, " ", z + 16, " ", x + 1, " ", y, " ", z + 16, " glowstone replace");
- println("fill ", x + 1, " ", y - 4, " ", z + 16, " ", x + 1, " ", y - 4, " ", z + 16, " glowstone replace");
- println("fill ", x + 2, " ", y - 2, " ", z + 16, " ", x + 2, " ", y - 3, " ", z + 16, " ", glass, " replace");
- println("fill ", x + 1, " ", y - 2, " ", z + 15, " ", x + 1, " ", y - 3, " ", z + 15, " ", glass, " replace");
- println("fill ", x + 16, " ", y, " ", z + 16, " ", x + 16, " ", y, " ", z + 16, " glowstone replace");
- println("fill ", x + 16, " ", y - 4, " ", z + 16, " ", x + 16, " ", y - 4, " ", z + 16, " glowstone replace");
- println("fill ", x + 16, " ", y - 2, " ", z + 15, " ", x + 16, " ", y - 3, " ", z + 15, " ", glass, " replace");
- println("fill ", x + 15, " ", y - 2, " ", z + 16, " ", x + 15, " ", y - 3, " ", z + 16, " ", glass, " replace");
- if (underground()) {
- println("fill ", x + 9, " ", y - 6, " ", z + 10, " ", x + 8, " ", y - 7, " ", z + 10, " ", glass, " replace");
- println("fill ", x + 9, " ", y - 6, " ", z + 7, " ", x + 8, " ", y - 7, " ", z + 7, " ", glass, " replace");
- println("fill ", x + 10, " ", y - 6, " ", z + 8, " ", x + 10, " ", y - 7, " ", z + 9, " ", glass, " replace");
- println("fill ", x + 7, " ", y - 6, " ", z + 8, " ", x + 7, " ", y - 7, " ", z + 9, " ", glass, " replace");
- println("fill ", x + 9, " ", y - 8, " ", z + 9, " ", x + 8, " ", y - 8, " ", z + 8, " blue_ice replace");
- println("fill ", x + 9, " ", y - 6, " ", z + 9, " ", x + 8, " ", y - 7, " ", z + 8, " air replace");
- println("fill ", x + 8, " ", y - 6, " ", z + 8, " ", x + 9, " ", y - 6, " ", z + 8, " wall_sign[facing=south] replace");
- println("fill ", x + 8, " ", y - 6, " ", z + 9, " ", x + 9, " ", y - 6, " ", z + 9, " wall_sign[facing=north] replace");
- println("fill ", x + 8, " ", y - 5, " ", z + 8, " ", x + 9, " ", y - 5, " ", z + 9, " lava replace");
- } else {
- println("fill ", x + 9, " ", y - 6, " ", z + 10, " ", x + 8, " ", y - 60, " ", z + 10, " ", glass, " replace");
- println("fill ", x + 9, " ", y - 6, " ", z + 7, " ", x + 8, " ", y - 60, " ", z + 7, " ", glass, " replace");
- println("fill ", x + 10, " ", y - 6, " ", z + 8, " ", x + 10, " ", y - 60, " ", z + 9, " ", glass, " replace");
- println("fill ", x + 7, " ", y - 6, " ", z + 8, " ", x + 7, " ", y - 60, " ", z + 9, " ", glass, " replace");
- println("fill ", x + 9, " ", y - 6, " ", z + 9, " ", x + 8, " ", y - 60, " ", z + 8, " air replace");
- }
- return this;
- }
- private void drawNorth() {
- println("fill ", x, " ", y, " ", z, " ", x + 17, " ", y, " ", z, " ", stairs, "[facing=north,waterlogged=true] replace");
- println("fill ", x, " ", y - 1, " ", z, " ", x + 17, " ", y - 3, " ", z, " ", block, " replace");
- println("fill ", x, " ", y - 4, " ", z, " ", x + 17, " ", y - 4, " ", z, " ", stairs, "[facing=north,waterlogged=true] replace");
- println("fill ", x, " ", y - 5, " ", z, " ", x + 17, " ", y - 5, " ", z, " ", blockBak, " replace");
- println("fill ", x + 7, " ", y - 1, " ", z, " ", x + 11, " ", y - 1, " ", z, " ", door, "[facing=south,half=upper] replace");
- println("fill ", x + 7, " ", y - 2, " ", z, " ", x + 11, " ", y - 2, " ", z, " ", door, "[facing=south,half=lower] replace");
- println("setblock ", x + 7, " ", y - 4, " ", z - 1, " wall_torch[facing=north] replace");
- println("setblock ", x + 11, " ", y - 4, " ", z - 1, " wall_torch[facing=north] replace");
- }
- private void drawSouth() {
- println("fill ", x, " ", y, " ", z + 17, " ", x + 17, " ", y, " ", z + 17, " ", stairs, "[facing=south,waterlogged=true] replace");
- println("fill ", x, " ", y - 1, " ", z + 17, " ", x + 17, " ", y - 3, " ", z + 17, " ", block, " replace");
- println("fill ", x, " ", y - 4, " ", z + 17, " ", x + 17, " ", y - 4, " ", z + 17, " ", stairs, "[facing=south,waterlogged=true] replace");
- println("fill ", x, " ", y - 5, " ", z + 17, " ", x + 17, " ", y - 5, " ", z + 17, " ", blockBak, " replace");
- println("fill ", x + 7, " ", y - 1, " ", z + 17, " ", x + 12, " ", y - 1, " ", z + 17, " ", door, "[facing=north,half=upper] replace");
- println("fill ", x + 7, " ", y - 2, " ", z + 17, " ", x + 12, " ", y - 2, " ", z + 17, " ", door, "[facing=north,half=lower] replace");
- println("setblock ", x + 7, " ", y - 4, " ", z + 18, " wall_torch[facing=south] replace");
- println("setblock ", x + 12, " ", y - 4, " ", z + 18, " wall_torch[facing=south] replace");
- }
- private void drawWest() {
- println("fill ", x, " ", y, " ", z + 1, " ", x, " ", y, " ", z + 16, " ", stairs, "[facing=west,waterlogged=true] replace");
- println("fill ", x, " ", y - 1, " ", z + 1, " ", x, " ", y - 3, " ", z + 16, " ", block, " replace");
- println("fill ", x, " ", y - 4, " ", z + 1, " ", x, " ", y - 4, " ", z + 16, " ", stairs, "[facing=west,waterlogged=true] replace");
- println("fill ", x, " ", y - 5, " ", z + 1, " ", x, " ", y - 5, " ", z + 16, " ", blockBak, " replace");
- println("fill ", x, " ", y - 1, " ", z + 7, " ", x, " ", y - 1, " ", z + 11, " ", door, "[facing=east,half=upper] replace");
- println("fill ", x, " ", y - 2, " ", z + 7, " ", x, " ", y - 2, " ", z + 11, " ", door, "[facing=east,half=lower] replace");
- println("setblock ", x - 1, " ", y - 4, " ", z + 7, " wall_torch[facing=west] replace");
- println("setblock ", x - 1, " ", y - 4, " ", z + 11, " wall_torch[facing=west] replace");
- }
- private void drawEast() {
- println("fill ", x + 17, " ", y, " ", z, " ", x + 17, " ", y, " ", z + 16, " ", stairs, "[facing=east,waterlogged=true] replace");
- println("fill ", x + 17, " ", y - 1, " ", z, " ", x + 17, " ", y - 3, " ", z + 16, " ", block, " replace");
- println("fill ", x + 17, " ", y - 4, " ", z, " ", x + 17, " ", y - 4, " ", z + 16, " ", stairs, "[facing=east,waterlogged=true] replace");
- println("fill ", x + 17, " ", y - 5, " ", z, " ", x + 17, " ", y - 5, " ", z + 16, " ", blockBak, " replace");
- println("fill ", x + 17, " ", y - 1, " ", z + 7, " ", x + 17, " ", y - 1, " ", z + 11, " ", door, "[facing=west,half=upper] replace");
- println("fill ", x + 17, " ", y - 2, " ", z + 7, " ", x + 17, " ", y - 2, " ", z + 11, " ", door, "[facing=west,half=lower] replace");
- println("setblock ", x + 18, " ", y - 4, " ", z + 11, " wall_torch[facing=east] replace");
- println("setblock ", x + 18, " ", y - 4, " ", z + 7, " wall_torch[facing=east] replace");
- }
- private String makeVillager(Random random) {
- int profession = random.nextInt(5);
- int career = 1;
- switch (profession) {
- case 0:
- career = random.nextInt(4) + 1;
- break;
- case 1:
- case 4:
- career = random.nextInt(2) + 1;
- break;
- case 2:
- career = 1;
- break;
- case 3:
- career = random.nextInt(3) + 1;
- break;
- default:
- break;
- }
- return chain(" {PersistenceRequired:1,Profession:", profession, ",Career:", career, ",CareerLevel:0}");
- }
- }
- enum Stone {
- oak("oak_planks", "oak_stairs", "oak_slab", "oak_door", "stripped_oak_log", "橡木"),
- spruce("spruce_planks", "spruce_stairs", "spruce_slab", "spruce_door", "stripped_spruce_log", "云杉木"),
- birch("birch_planks", "birch_stairs", "birch_slab", "birch_door", "stripped_birch_log", "白桦木"),
- jungle("jungle_planks", "jungle_stairs", "jungle_slab", "jungle_door", "stripped_jungle_log", "丛林木"),
- acacia("acacia_planks", "acacia_stairs", "acacia_slab", "acacia_door", "stripped_acacia_log", "合欢金木"),
- dark_oak("dark_oak_planks", "dark_oak_stairs", "dark_oak_slab", "dark_oak_door", "stripped_dark_oak_log", "深色橡木"),
- stone_bricks("stone_bricks", "stone_brick_stairs", "stone_brick_slab", null, "chiseled_stone_bricks", "石砖"),
- bricks("bricks", "brick_stairs", "brick_slab", null, "polished_granite", "砖"),
- cut_red_sandstone("cut_red_sandstone", "red_sandstone_stairs", "red_sandstone_slab", null, "chiseled_red_sandstone", "红砂岩"),
- cut_sandstone("cut_sandstone", "sandstone_stairs", "sandstone_slab", null, "chiseled_sandstone", "砂岩"),
- quartz("smooth_quartz", "quartz_stairs", "quartz_slab", null, "chiseled_quartz_block", "石英"),
- prismarine_brick("prismarine_bricks", "prismarine_brick_stairs", "prismarine_brick_slab", null, "green_concrete", "海晶石砖"),
- purpur("purpur_block", "purpur_stairs", "purpur_slab", null, "purpur_pillar", "紫柏");
- Stone(String block, String stairs, String slab, String door, String bakBlock, String desc) {
- this.block = block;
- this.stairs = stairs;
- this.slab = slab;
- this.door = door;
- this.bakBlock = bakBlock;
- this.desc = desc;
- this.inflammable = door != null;
- }
- private String block;
- private String stairs;
- private String slab;
- private String door;
- private String desc;
- private String bakBlock;
- private boolean inflammable;
- private static final List<Stone> VALUES = Arrays.asList(values());
- public static Stone get(int i) {
- return VALUES.get(i % 13);
- }
- public static Stone door(int i) {
- return VALUES.get(i % 6);
- }
- public String getBlock() {
- return block;
- }
- public String getStairs() {
- return stairs;
- }
- public String getSlab() {
- return slab;
- }
- public String getDoor() {
- return door;
- }
- public String getBakBlock() {
- return bakBlock;
- }
- public boolean isInflammable() {
- return inflammable;
- }
- }
代码24行和31行被网站转义了, 分别是 "datapacks\\datapack\\data\\datapack\\functions\\";
和pw.print("{\n \"pack\": {\n \"pack_format\": 3,\n \"description\": \"Test\"\n }\n}");
网站展示的空白字符 \U+00A0 编辑器报错,请自行替换
铁块理论生成量为:
52村庄*3600秒*20刻*一次4个铁块/7000标准生成几率=2139.43个
和pw.print("{\n \"pack\": {\n \"pack_format\": 3,\n \"description\": \"Test\"\n }\n}");
网站展示的空白字符 \U+00A0 编辑器报错,请自行替换
铁块理论生成量为:
52村庄*3600秒*20刻*一次4个铁块/7000标准生成几率=2139.43个
好长,不过是1.13的问题不是1.12的
现在的新人都是怪物.jpg
不如发个github
厉害啊!虽然不大懂。
。。。代码完全看不懂