├── .github └── workflows │ └── build.yml ├── .gitignore ├── LICENSE ├── README.md ├── build_script ├── IRR.py ├── build.py ├── idLister.py ├── imageLister.py └── imageSizer.py ├── guide ├── readme.md ├── stage │ └── before_early_stage.md └── version │ ├── 1.0.0.md │ ├── 1.1.0.md │ ├── 1.1.1.md │ ├── 1.1.2.md │ ├── 1.1.3.md │ ├── 1.1.4.md │ ├── 1.1.5.md │ ├── 1.2.0.md │ ├── 1.3.0.md │ ├── 1.4.0.md │ └── 1.4.1.md ├── image ├── 不锈钢板.png ├── 不锈钢粉.png ├── 不锈钢粒.png ├── 不锈钢锤子.png ├── 不锈钢锭.png ├── 不锈钢齿轮.png ├── 光电板.png ├── 农场管理机.png ├── 坡莫合金板.png ├── 坡莫合金粉.png ├── 坡莫合金粒.png ├── 坡莫合金锭.png ├── 坡莫合金齿轮.png ├── 太阳能发电机.png ├── 孔雀石矿.png ├── 导热片.png ├── 小撮不锈钢粉.png ├── 小撮坡莫合金粉.png ├── 小撮煤粉.png ├── 小撮硫粉.png ├── 小撮金粉.png ├── 小撮钻石粉.png ├── 小撮铁粉.png ├── 小撮铅粉.png ├── 小撮铜粉.png ├── 小撮铬粉.png ├── 小撮银粉.png ├── 小撮锡粉.png ├── 小撮锰粉.png ├── 小撮镍粉.png ├── 小撮青金石粉.png ├── 小撮青铜粉.png ├── 挖掘机.png ├── 方铅矿石.png ├── 木锤子.png ├── 木齿轮.png ├── 淘金碗.png ├── 火力发电机.png ├── 煤板.png ├── 煤粉.png ├── 煤粒.png ├── 煤齿轮.png ├── 电动马达.png ├── 电磁铁.png ├── 石墨矿石.png ├── 石锤子.png ├── 石齿轮.png ├── 硫板.png ├── 硫粉.png ├── 硫粒.png ├── 磁化不锈钢锭.png ├── 磁铁矿.png ├── 空木桶.png ├── 粉碎的孔雀石矿.png ├── 粉碎的方铅矿.png ├── 粉碎的煤矿.png ├── 粉碎的磁铁矿.png ├── 粉碎的红石矿.png ├── 粉碎的绿宝石矿.png ├── 粉碎的金矿.png ├── 粉碎的钻石矿.png ├── 粉碎的铁矿.png ├── 粉碎的铜矿.png ├── 粉碎的铝矿.png ├── 粉碎的铬矿.png ├── 粉碎的银矿.png ├── 粉碎的锌矿.png ├── 粉碎的锡矿.png ├── 粉碎的锰矿.png ├── 粉碎的镍矿.png ├── 粉碎的青金石矿.png ├── 精煤.png ├── 精煤粒.png ├── 红石电池箱.png ├── 装水木桶.png ├── 金板.png ├── 金粉.png ├── 金齿轮.png ├── 钻石板.png ├── 钻石粉.png ├── 钻石粒.png ├── 钻石锤子.png ├── 钻石齿轮.png ├── 铁板.png ├── 铁粉.png ├── 铁锤子.png ├── 铁齿轮.png ├── 铅板.png ├── 铅矿石.png ├── 铅粉.png ├── 铅粒.png ├── 铅锭.png ├── 铜板.png ├── 铜矿石.png ├── 铜粉.png ├── 铜粒.png ├── 铜线圈.png ├── 铜锤子.png ├── 铜锭.png ├── 铜齿轮.png ├── 铝矿石.png ├── 铬板.png ├── 铬粉.png ├── 铬粒.png ├── 铬锭.png ├── 铬齿轮.png ├── 银板.png ├── 银矿石.png ├── 银粉.png ├── 银粒.png ├── 银锭.png ├── 银齿轮.png ├── 锌矿石.png ├── 锡板.png ├── 锡矿石.png ├── 锡粉.png ├── 锡粒.png ├── 锡锭.png ├── 锡齿轮.png ├── 锰板.png ├── 锰粉.png ├── 锰粒.png ├── 锰锭.png ├── 锰齿轮.png ├── 锻造模板.png ├── 锻造模板_齿轮.png ├── 镍板.png ├── 镍矿石.png ├── 镍粉.png ├── 镍粒.png ├── 镍锭.png ├── 镍齿轮.png ├── 青金石板.png ├── 青金石粉.png ├── 青金石粒.png ├── 青金石齿轮.png ├── 青铜板.png ├── 青铜粉.png ├── 青铜粒.png ├── 青铜锭.png ├── 青铜齿轮.png └── 高炉.png ├── model ├── electromagnet │ ├── electromagnet.json │ └── electromagnet.png ├── farmManager │ ├── farmManager.json │ └── farmManager.png ├── fuelGenerator │ ├── fuelGenerator.json │ ├── fuelGenerator.png │ ├── fuelGenerator_working.json │ └── fuelGenerator_working.png ├── miner │ ├── miner.json │ └── miner.png ├── redStoneBatteryBox │ ├── redStoneBatteryBox.json │ └── redStoneBatteryBox.png ├── shaftFurnace │ ├── shaftFurnace.json │ └── shaftFurnace.png └── solarGenerator │ ├── solarGenerator.json │ └── solarGenerator.png └── src ├── TechDawn_config.js ├── TechDawn_main.js ├── TechDawn_saver.js ├── TechDawn_texture.js ├── TechDawn_translate.js ├── build.json ├── items ├── TechDawn_item.js ├── TechDawn_machine.js └── TechDawn_tool.js ├── loot └── TechDawn_lootPanning.js └── machine ├── TechDawn_anvil.js ├── TechDawn_cauldron.js ├── TechDawn_electromagnet.js ├── TechDawn_farmManager.js ├── TechDawn_fuelGenerator.js ├── TechDawn_miner.js ├── TechDawn_redStoneBatteryBox.js ├── TechDawn_shaftFurnace.js ├── TechDawn_solarGenerator.js ├── mutiBlock └── TechDawn_coalStack.js └── power └── TechDawn_power.js /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: bnpx build 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | workflow_dispatch: null 9 | 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Checkout code 15 | uses: actions/checkout@v2 16 | 17 | - name: Build bnpx package 18 | run: python3 ./build_script/build.py 19 | 20 | - name: Upload bnpx package file 21 | uses: actions/upload-artifact@v2 22 | with: 23 | name: TechDawn 24 | path: out/TechDawn.bnpx 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | out/ 2 | bn.d.ts 3 | .vscode 4 | 32x/ 5 | 128x/ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TechDawn 2 | 3 | ## 简介 4 | 5 | 科技黎明 (TechDawn) 是一个运行在PowerNukkit上的科技模组,为原版游戏添加了许多不可思议的新玩法,爆肝++。 6 | 7 | ## 特点 8 | 9 | - 矿物筛出 10 | - 木桶 11 | - 木炭堆 12 | - 铁砧合成 13 | - 炼药锅淘洗 14 | - 电路系统 15 | - 机器交互 16 | 17 | ## 安装 18 | 19 | 1. 下载[BlocklyNukkit.jar](https://tools.blocklynukkit.com/BlocklyNukkit.jar)作为前置,放入`plugins`文件夹 20 | 2. 前往[Action](https://github.com/BlocklyNukkit/TechDawn/actions)下载科技黎明插件最新构建,解压,将压缩包中的`TechDawn.bnpx`放入`plugins`文件夹中 21 | 3. 重启您的`PowerNukkit`服务器,开始游戏吧 22 | 23 | ## 教程 24 | 25 | [McMod](https://www.mcmod.cn/class/4337.html) 26 | 27 | ## 物品id 28 | 29 | |id|英文名|中文名| 30 | |-|-|-| 31 | |3501|Crushed Magnetite Ore|粉碎的磁铁矿| 32 | |3502|Crushed Gelenite Ore|粉碎的方铅矿| 33 | |3503|Crushed Gold Ore|粉碎的金矿| 34 | |3504|Crushed Malachite Ore|粉碎的孔雀石矿| 35 | |3505|Crushed Aluminium Ore|粉碎的铝矿| 36 | |3506|Crushed Emerald Ore|粉碎的绿宝石矿| 37 | |3507|Crushed Coal Ore|粉碎的煤矿| 38 | |3508|Crushed Iron Ore|粉碎的铁矿| 39 | |3509|Crushed Copper Ore|粉碎的铜矿| 40 | |3510|Crushed Tin Ore|粉碎的锡矿| 41 | |3511|Crushed Zinc Ore|粉碎的锌矿| 42 | |3512|Crushed Silver Ore|粉碎的银矿| 43 | |3513|Crushed Diamond Ore|粉碎的钻石矿| 44 | |3514|Crushed Redstone Ore|粉碎的红石矿| 45 | |3515|Crushed Lapis Ore|粉碎的青金石矿| 46 | |3516|Crushed Nickel Ore|粉碎的镍矿| 47 | |3517|Crushed Chromium Ore|粉碎的铬矿| 48 | |3518|Crushed Manganese Ore|粉碎的软锰矿| 49 | |3721|Stainless Steel Ingot|不锈钢锭| 50 | |3722|Chromium Ingot|铬锭| 51 | |3723|Manganese Ingot|锰锭| 52 | |3724|Lead Ingot|铅锭| 53 | |3725|Bronze Ingot|青铜锭| 54 | |3726|Copper Ingot|铜锭| 55 | |3727|Tin Ingot|锡锭| 56 | |3728|Silver Ingot|银锭| 57 | |3729|Clean Coal|精煤| 58 | |3730|Nickel Ingot|镍锭| 59 | |3731|Magnetized Stainless Steel Ingot|磁化不锈钢锭| 60 | |3732|Permalloy Ingot|坡莫合金锭| 61 | |3521|Stainless Steel Dust|不锈钢粉| 62 | |3522|Chromi Dust|铬粉| 63 | |3523|Gold Dust|金粉| 64 | |3524|Sulfur Dust|硫粉| 65 | |3525|Coal Dust|煤粉| 66 | |3526|Manganese Dust|锰粉| 67 | |3527|Nickel Dust|镍粉| 68 | |3528|Lead Dust|铅粉| 69 | |3529|Lapis Dust|青金石粉| 70 | |3530|Bronze Dust|青铜粉| 71 | |3531|Iron Dust|铁粉| 72 | |3532|Copper Dust|铜粉| 73 | |3533|Tin Dust|锡粉| 74 | |3534|Silver Dust|银粉| 75 | |3535|Diamond Dust|钻石粉| 76 | |3536|Permalloy Dust|坡莫合金粉| 77 | |3581|Tiny Stainl Steel Dust|小撮不锈钢粉| 78 | |3582|Tiny Chromium Dust|小撮铬粉| 79 | |3583|Tiny Gold Dust|小撮金粉| 80 | |3584|Tiny Sulfur Dust|小撮硫粉| 81 | |3585|Tiny Coal Dust|小撮煤粉| 82 | |3586|Tiny Manganese Dust|小撮锰粉| 83 | |3587|Tiny Nickel Dust|小撮镍粉| 84 | |3588|Tiny Lead Dust|小撮铅粉| 85 | |3589|Tiny Lapis Dust|小撮青金石粉| 86 | |3590|Tiny Bronze Dust|小撮青铜粉| 87 | |3591|Tiny Iron Dust|小撮铁粉| 88 | |3592|Tiny Copper Dust|小撮铜粉| 89 | |3593|Tiny Tin Dust|小撮锡粉| 90 | |3594|Tiny Silver Dust|小撮银粉| 91 | |3595|Tiny Diamond Dust|小撮钻石粉| 92 | |3596|Tiny Permalloy Dust|小撮坡莫合金粉| 93 | |3771|Stainless Steel Nugget|不锈钢粒| 94 | |3772|Chromium Nugget|铬粒| 95 | |3773|Sulfur Nugget|硫粒| 96 | |3774|Coal Nugget|煤粒| 97 | |3775|Manganese Nugget|锰粒| 98 | |3776|Nickel Nugget|镍粒| 99 | |3777|Lead Nugget|铅粒| 100 | |3778|Lapis Nugget|青金石粒| 101 | |3779|Bronze Nugget|青铜粒| 102 | |3780|Copper Nugget|铜粒| 103 | |3781|Tin Nugget|锡粒| 104 | |3782|Silver Nugget|银粒| 105 | |3783|Diamond Nugget|钻石粒| 106 | |3784|Clean Coal Nugget|精煤粒| 107 | |3785|Permalloy Nugget|坡莫合金粒| 108 | |3681|Stainless Steel Plate|不锈钢板| 109 | |3682|Chromium Plate|铬板| 110 | |3683|Gold Plate|金板| 111 | |3684|Sulfur Plate|硫板| 112 | |3685|Coal Plate|煤板| 113 | |3686|Manganese Plate|锰板| 114 | |3687|Nickel Plate|镍板| 115 | |3688|Lead Plate|铅板| 116 | |3689|Lapis Plate|青金石板| 117 | |3690|Bronze Plate|青铜板| 118 | |3691|Iron Plate|铁板| 119 | |3692|Copper Plate|铜板| 120 | |3693|Tin Plate|锡板| 121 | |3694|Silver Plate|银板| 122 | |3695|Diamond Plate|钻石板| 123 | |3696|Permalloy Plate|坡莫合金板| 124 | |3641|Stainless Steel Gear|不锈钢齿轮| 125 | |3642|Chromium Gear|铬齿轮| 126 | |3643|Gold Gear|金齿轮| 127 | |3644|Coal Gear|煤齿轮| 128 | |3645|Manganese Gear|锰齿轮| 129 | |3646|Wood Gear|木齿轮| 130 | |3647|Nickel Gear|镍齿轮| 131 | |3649|Lapis Gear|青金石齿轮| 132 | |3650|Bronze Gear|青铜齿轮| 133 | |3651|Stone Gear|石齿轮| 134 | |3652|Iron Gear|铁齿轮| 135 | |3653|Copper Gear|铜齿轮| 136 | |3654|Tin Gear|锡齿轮| 137 | |3655|Silver Gear|银齿轮| 138 | |3656|Diamond Gear|钻石齿轮| 139 | |3657|Permallo Gear|坡莫合金齿轮| 140 | |3402|Empty Wood Bucket|空木桶| 141 | |3403|Watered Wood Bucket|装水木桶| 142 | |3409|Forging Template|锻造模板| 143 | |3410|Forging Template Gear|齿轮锻造模板| 144 | |3411|Heat Conducting Sheet|导热片| 145 | |3412|Motor|电动马达| 146 | |3351|Fuel Generator|火力发电机| 147 | |3352|Redstone Battery Box|红石电池箱| 148 | |3353|Shaft Furnace|高炉| 149 | |3354|Miner|挖掘机| 150 | 151 | ## 开发者 152 | 153 | - 超神的冰凉 (Superice666) 154 | - Lt-Name 155 | -------------------------------------------------------------------------------- /build_script/IRR.py: -------------------------------------------------------------------------------- 1 | #coding=utf-8 2 | import json 3 | import os 4 | import base64 5 | import codecs 6 | 7 | itemContent = '' 8 | toolContent = '' 9 | output = [] 10 | 11 | idFile = open("./src/items/TechDawn_item.js", "r", encoding="utf-8") 12 | itemContent += idFile.read() 13 | idFile.close() 14 | 15 | idFile2 = open("./src/items/TechDawn_tool.js", "r", encoding="utf-8") 16 | toolContent += idFile2.read() 17 | idFile2.close() 18 | 19 | idFile3 = open("./src/items/TechDawn_machine.js", "r", encoding="utf-8") 20 | itemContent += idFile3.read() 21 | idFile3.close() 22 | 23 | ant = 0 24 | 25 | for x in itemContent.split("\n"): 26 | if x.startswith("new ItemInfo"): 27 | tokens = x.replace("new ItemInfo(","").replace('"',"").replace(")", "").split(", ") 28 | print(tokens) 29 | ant+=1 30 | 31 | picName = os.path.basename(tokens[4]) 32 | smIcon = '' 33 | lgIcon = '' 34 | with open("./32x/"+picName, "rb") as tf: 35 | smIcon = base64.b64encode(tf.read()) 36 | with open("./128x/"+picName, "rb") as tf: 37 | lgIcon = base64.b64encode(tf.read()) 38 | 39 | tmp = { 40 | 'name': tokens[3], 41 | 'englishName': tokens[2], 42 | 'registerName': 'blocklynukkit:'+tokens[1], 43 | 'CreativeTabName': '自然', 44 | "type": "Item", 45 | "maxDurability": 1, 46 | 'maxStackSize': int(tokens[5]), 47 | 'smallIcon': str(smIcon).replace('b\'', '').replace("'", ''), 48 | 'largeIcon': str(lgIcon).replace('b\'', '').replace("'", '') 49 | } 50 | output.append(tmp) 51 | 52 | for x in toolContent.split("\n"): 53 | if x.startswith("new ToolInfo"): 54 | tokens = x.replace("new ToolInfo(","").replace('"',"").replace(")", "").split(", ") 55 | print(tokens) 56 | ant+=1 57 | 58 | picName = os.path.basename(tokens[4]) 59 | smIcon = '' 60 | lgIcon = '' 61 | with open("./32x/"+picName, "rb") as tf: 62 | smIcon = base64.b64encode(tf.read()) 63 | with open("./128x/"+picName, "rb") as tf: 64 | lgIcon = base64.b64encode(tf.read()) 65 | 66 | tmp = { 67 | 'name': tokens[3], 68 | 'englishName': tokens[2], 69 | 'registerName': 'blocklynukkit:'+tokens[1], 70 | 'CreativeTabName': '工具', 71 | "type": "Item", 72 | "maxDurability": int(tokens[7]), 73 | 'maxStackSize': 1, 74 | 'smallIcon': str(smIcon).replace('b\'', '').replace("'", ''), 75 | 'largeIcon': str(lgIcon).replace('b\'', '').replace("'", '') 76 | } 77 | output.append(tmp) 78 | 79 | 80 | with open('./out/techdawn_items.json', 'w+', encoding="utf-8") as tf: 81 | itemsjson = '' 82 | for each in output: 83 | itemsjson += (json.dumps(each, ensure_ascii=False) + '\n') 84 | tf.write(itemsjson) 85 | print(ant, "finished") -------------------------------------------------------------------------------- /build_script/build.py: -------------------------------------------------------------------------------- 1 | # -*- coding: UTF-8 -*- 2 | import json 3 | import os 4 | import gzip 5 | import sys 6 | from shutil import copyfile 7 | 8 | buildFile = open("./src/build.json", "r",encoding="utf-8") 9 | buildConfig = json.load(buildFile) 10 | buildFile.close() 11 | 12 | out = "bnp" 13 | for fileName in buildConfig["plugins"]: 14 | pluginFile = open(fileName,"r",encoding="utf-8") 15 | pluginContent = pluginFile.read() 16 | pluginFile.close() 17 | out += "-->$newPlugin@" 18 | out += os.path.split(fileName)[1] 19 | out += "#->:" 20 | out += pluginContent 21 | 22 | if not os.path.exists("./out"): 23 | os.mkdir("./out") 24 | 25 | if buildConfig["compress"]: 26 | outputFile = gzip.open("./out/"+buildConfig["name"]+".bnpx","wb") 27 | outputFile.write(out.encode(encoding="utf-8")) 28 | outputFile.close() 29 | else: 30 | outputFile = open("./out/"+buildConfig["name"]+".bnp","w",encoding="utf-8") 31 | outputFile.write(out) 32 | outputFile.close() 33 | 34 | if(len(sys.argv) >= 2): 35 | if(sys.argv[1].startswith("--copy:")): 36 | copyfile("./out/"+buildConfig["name"]+".bnpx", sys.argv[1].replace("--copy:","",1)+buildConfig["name"]+".bnpx") 37 | -------------------------------------------------------------------------------- /build_script/idLister.py: -------------------------------------------------------------------------------- 1 | # -*- coding: UTF-8 -*- 2 | 3 | idFile = open("./src/items/TechDawn_item.js", "r",encoding="utf-8") 4 | content = idFile.read() 5 | idFile.close() 6 | 7 | idFile2 = open("./src/items/TechDawn_tool.js", "r", encoding="utf-8") 8 | content += idFile2.read() 9 | idFile2.close() 10 | 11 | idFile3 = open("./src/items/TechDawn_machine.js", "r", encoding="utf-8") 12 | content += idFile3.read() 13 | idFile3.close() 14 | 15 | ant = 0 16 | 17 | for x in content.split("\n"): 18 | if x.startswith("new ItemInfo"): 19 | tokens = x.replace("new ItemInfo(","").replace('"',"").split(", ") 20 | ant+=1 21 | print("|"+tokens[0]+"|"+tokens[2]+"|"+tokens[3]+"|") 22 | 23 | print(ant) -------------------------------------------------------------------------------- /build_script/imageLister.py: -------------------------------------------------------------------------------- 1 | # -*- coding: UTF-8 -*- 2 | import json 3 | import os 4 | 5 | images = [] 6 | for root, dirs, files in os.walk("./image"): 7 | for each in files: 8 | images.append(each) 9 | 10 | print("[") 11 | for each in images: 12 | print(" '"+each+"',") 13 | print("]") -------------------------------------------------------------------------------- /build_script/imageSizer.py: -------------------------------------------------------------------------------- 1 | from PIL import Image 2 | import os 3 | import sys 4 | 5 | def resize_image(size, path, file, outpath): 6 | img = Image.open(path+"/"+file) 7 | print(img.size) 8 | (image_x,image_y) = img.size 9 | if not (image_x == size and image_y == size): 10 | if (image_x/image_y) > 1: 11 | new_image_x = size 12 | new_image_y = size * image_y // image_x 13 | else: 14 | new_image_y = size 15 | new_image_x = size * image_x // image_y 16 | else: 17 | new_image_x = image_x 18 | new_image_y = image_y 19 | 20 | new_image_size = (new_image_x,new_image_y) 21 | print(new_image_size) 22 | 23 | new_img = img.resize(new_image_size,Image.NEAREST) 24 | new_img.save(outpath+file, quality=100) 25 | 26 | 27 | 28 | if __name__ == "__main__": 29 | path = sys.argv[1] 30 | files = os.listdir(path) 31 | 32 | size = 16 33 | if len(sys.argv) >= 3: 34 | size = int(sys.argv[2]) 35 | 36 | outpath = './' + str(size) + 'x/' 37 | isExists=os.path.exists(outpath) 38 | if not isExists: 39 | os.makedirs(outpath) 40 | 41 | for file in files: 42 | filename,filetype = os.path.splitext(file) 43 | if filetype == '.jpeg' or filetype == '.jpg' or filetype == '.png': 44 | print(file) 45 | resize_image(size, path, file, outpath) -------------------------------------------------------------------------------- /guide/readme.md: -------------------------------------------------------------------------------- 1 | # 总览 2 | 3 | 科技黎明的玩法主要是以材料和机器为核心主线,制作自动化流水线以解放生产力的过程。 4 | (人话:让你躺着获取资源) 5 | 6 | ## 发展阶段 7 | 8 | 1. 大前期:获得淘金碗之前 9 | 2. 前期:获取第一块金属锭之前 10 | 3. 初期:制作出铁砧、炼药锅并使用之前 11 | 4. 中期:使用火力发电机驱动基础机器 12 | 5. 后期:大量自动化的生产线 13 | 14 | ## 合成 15 | 16 | - 工具 17 | - 矿物、金属与合金 18 | - 机械零件和机械 19 | - 工业原料 20 | - 铁砧合成 21 | - 炼药锅合成 22 | 23 | ## 多方块结构 24 | 25 | - 木炭堆 26 | - 红石电网 27 | 28 | ## 机械使用 29 | 30 | ### 发电机 31 | 32 | - 火力发电机 33 | 34 | ### 储电设备 35 | 36 | - 红石储电箱 37 | 38 | ### 耗电机械 39 | 40 | - 高炉 41 | - 挖掘机 42 | 43 | # 更新日志 44 | 45 | - [1.0.0](version/1.0.0.md) 46 | - [1.1.0](version/1.1.0.md) 47 | - [1.1.1](version/1.1.1.md) 48 | - [1.1.2](version/1.1.2.md) 49 | - [1.1.3](version/1.1.3.md) 50 | - [1.1.4](version/1.1.4.md) 51 | - [1.1.5](version/1.1.5.md) 52 | 53 | -------------------------------------------------------------------------------- /guide/stage/before_early_stage.md: -------------------------------------------------------------------------------- 1 | # 大前期指引 2 | 3 | 汞锡铌,来到了这个由PowerNukkit驱动的世界。 4 | 5 | 你可以玩原版生存,但是这个教程并不是教你去玩原版生存的,虽说如此,你在游玩本模组之前,应该已经对原版生存较为熟练。 6 | 7 | ## 获取淘金碗 8 | 9 | 淘金碗是科技黎明中一个十分重要的工具,用于获取大量矿物资源。 10 | 11 | 要制作淘金碗,你需要先获取圆石,在熔炉中烧成石头,然后按照如下方式在工作台中摆放以合成淘金碗: 12 | 13 | -------------------------------------------------------------------------------- /guide/version/1.0.0.md: -------------------------------------------------------------------------------- 1 | # 1.0.0: 2 | ## 包含以下内容: 3 | ### 新物品 4 | |id|英文名|中文名| 5 | |-|-|-| 6 | |3501|Crushed Magnetite Ore|粉碎的磁铁矿| 7 | |3502|Crushed Gelenite Ore|粉碎的方铅矿| 8 | |3503|Crushed Gold Ore|粉碎的金矿| 9 | |3504|Crushed Malachite Ore|粉碎的孔雀石矿| 10 | |3505|Crushed Aluminium Ore|粉碎的铝矿| 11 | |3506|Crushed Emerald Ore|粉碎的绿宝石矿| 12 | |3507|Crushed Coal Ore|粉碎的煤矿| 13 | |3508|Crushed Iron Ore|粉碎的铁矿| 14 | |3509|Crushed Copper Ore|粉碎的铜矿| 15 | |3510|Crushed Tin Ore|粉碎的锡矿| 16 | |3511|Crushed Zinc Ore|粉碎的锌矿| 17 | |3512|Crushed Silver Ore|粉碎的银矿| 18 | |3513|Crushed Diamond Ore|粉碎的钻石矿| 19 | |3514|Crushed Redstone Ore|粉碎的红石矿| 20 | |3515|Crushed Lapis Ore|粉碎的青金石矿| 21 | |3516|Crushed Nickel Ore|粉碎的镍矿| 22 | |3517|Crushed Chromium Ore|粉碎的铬矿| 23 | |3518|Crushed Manganese Ore|粉碎的软锰矿| 24 | |3721|Stainless Steel Ingot|不锈钢锭| 25 | |3722|Chromium Ingot|铬锭| 26 | |3723|Manganese Ingot|锰锭| 27 | |3724|Lead Ingot|铅锭| 28 | |3725|Bronze Ingot|青铜锭| 29 | |3726|Copper Ingot|铜锭| 30 | |3727|Tin Ingot|锡锭| 31 | |3728|Silver Ingot|银锭| 32 | |3729|Clean Coal|精煤| 33 | |3730|Nickel Ingot|镍锭| 34 | |3521|Stainless Steel Dust|不锈钢粉| 35 | |3522|Chromi Dust|铬粉| 36 | |3523|Gold Dust|金粉| 37 | |3524|Sulfur Dust|硫粉| 38 | |3525|Coal Dust|煤粉| 39 | |3526|Manganese Dust|锰粉| 40 | |3527|Nickel Dust|镍粉| 41 | |3528|Lead Dust|铅粉| 42 | |3529|Lapis Dust|青金石粉| 43 | |3530|Bronze Dust|青铜粉| 44 | |3531|Iron Dust|铁粉| 45 | |3532|Copper Dust|铜粉| 46 | |3533|Tin Dust|锡粉| 47 | |3534|Silver Dust|银粉| 48 | |3535|Diamond Dust|钻石粉| 49 | |3581|Tiny Stainl Steel Dust|小撮不锈钢粉| 50 | |3582|Tiny Chromium Dust|小撮铬粉| 51 | |3583|Tiny Gold Dust|小撮金粉| 52 | |3584|Tiny Sulfur Dust|小撮硫粉| 53 | |3585|Tiny Coal Dust|小撮煤粉| 54 | |3586|Tiny Manganese Dust|小撮锰粉| 55 | |3587|Tiny Nickel Dust|小撮镍粉| 56 | |3588|Tiny Lead Dust|小撮铅粉| 57 | |3589|Tiny Lapis Dust|小撮青金石粉| 58 | |3590|Tiny Bronze Dust|小撮青铜粉| 59 | |3591|Tiny Iron Dust|小撮铁粉| 60 | |3592|Tiny Copper Dust|小撮铜粉| 61 | |3593|Tiny Tin Dust|小撮锡粉| 62 | |3594|Tiny Silver Dust|小撮银粉| 63 | |3595|Tiny Diamond Dust|小撮钻石粉| 64 | |3771|Stainless Steel Nugget|不锈钢粒| 65 | |3772|Chromium Nugget|铬粒| 66 | |3773|Sulfur Nugget|硫粒| 67 | |3774|Coal Nugget|煤粒| 68 | |3775|Manganese Nugget|锰粒| 69 | |3776|Nickel Nugget|镍粒| 70 | |3777|Lead Nugget|铅粒| 71 | |3778|Lapis Nugget|青金石粒| 72 | |3779|Bronze Nugget|青铜粒| 73 | |3780|Copper Nugget|铜粒| 74 | |3781|Tin Nugget|锡粒| 75 | |3782|Silver Nugget|银粒| 76 | |3783|Diamond Nugget|钻石粒| 77 | |3784|Clean Coal Nugget|精煤粒| 78 | |3681|Stainless Steel Plate|不锈钢板| 79 | |3682|Chromium Plate|铬板| 80 | |3683|Gold Plate|金板| 81 | |3684|Sulfur Plate|硫板| 82 | |3685|Coal Plate|煤板| 83 | |3686|Manganese Plate|锰板| 84 | |3687|Nickel Plate|镍板| 85 | |3688|Lead Plate|铅板| 86 | |3689|Lapis Plate|青金石板| 87 | |3690|Bronze Plate|青铜板| 88 | |3691|Iron Plate|铁板| 89 | |3692|Copper Plate|铜板| 90 | |3693|Tin Plate|锡板| 91 | |3694|Silver Plate|银板| 92 | |3695|Diamond Plate|钻石板| 93 | |3641|Stainless Steel Gear|不锈钢齿轮| 94 | |3642|Chromium Gear|铬齿轮| 95 | |3643|Gold Gear|金齿轮| 96 | |3644|Coal Gear|煤齿轮| 97 | |3645|Manganese Gear|锰齿轮| 98 | |3646|Wood Gear|木齿轮| 99 | |3647|Nickel Gear|镍齿轮| 100 | |3649|Lapis Gear|青金石齿轮| 101 | |3650|Bronze Gear|青铜齿轮| 102 | |3651|Stone Gear|石齿轮| 103 | |3652|Iron Gear|铁齿轮| 104 | |3653|Copper Gear|铜齿轮| 105 | |3654|Tin Gear|锡齿轮| 106 | |3655|Silver Gear|银齿轮| 107 | |3656|Diamond Gear|钻石齿轮| 108 | |3402|Empty Wood Bucket|空木桶| 109 | |3403|Watered Wood Bucket|装水木桶| 110 | |3409|Forging Template|锻造模板| 111 | |3410|Forging Template Gear|齿轮锻造模板| 112 | |3411|Heat Conducting Sheet|导热片| 113 | |3351|Fuel Generator|火力发电机| 114 | |3352|Redstone Battery Box|红石电池箱| 115 | |3353|Shaft Furnace|高炉| 116 | 117 | ### 新机制 118 | #### 矿物筛出 119 | 手持淘金碗,破坏沙砾/沙子/红沙方块,即可获得粉碎矿石,不同的粉碎矿石爆出的概率不同 120 | #### 木桶 121 | 木桶可以和铁桶一样使用,不同的是,空木桶可以堆叠64个,装水木桶可以堆叠16个,木桶不能装岩浆 122 | #### 木炭堆 123 | 木炭堆是用于高效制作木炭的多方块结构,最下方为一层砖块,上面用原木堆成任意高度的长方体,最上方覆盖一层泥土,泥土层中央为一个向下的活塞,手持火把点击活塞开始烧炼,一段时间后,每个原木变为2-6个木炭 124 | #### 铁砧合成 125 | 潜行右键铁砧即可将手持物品放在铁砧上面,潜行状态下手持锤子右键铁砧即可进行捶打合成,消耗锤子耐久。 126 | 可以使用铁板合成锻造模板,锻造模板通过捶打合成切换模式,手持特定模式的锻造模板进行捶打合成可以合成出对应的物品,普通的捶打合成无需锻造模板。 127 | #### 炼药锅淘洗 128 | 手持要淘洗的物品右键装水的炼药锅即可进行淘洗合成,消耗炼药锅中的一层水。 129 | #### 电路系统 130 | 科技黎明中提供了电力的概念,单位为`RF`(红石通量,Redstone Flux),通过红石线进行传导,最多可以传导约200格。 131 | 发电机、储电箱、用电器只需要右键红石线即可放置。 132 | 发电机会优先为可传导范围内同一电网中储电量最少的设备进行充电,电力传导没有损耗。 133 | 电力传输中使用的时间单位为T,相当于16个游戏刻,0.8秒,过程单位为P,即一次处理过程 134 | 下面给出当前版本的机器数据: 135 | |机器|类别|储电量|发电量|耗电量|接受物品|输出物品| 136 | |-|-|-|-|-|-|-| 137 | |火力发电机|发电机|0RF|20RF/T|0RF/P|木炭(6T)、精煤(10T)|无| 138 | |红石电池箱|储电箱|8000RF|60RF/T|0RF/P|无|无| 139 | |电力高炉|用电器|480RF|0RF/T|160RF/P|可熔炉冶炼的物品|冶炼结果| 140 | #### 机器交互 141 | 手持物品右键即可将此物品作为输入物品与机器交互。 142 | 右键储电箱即可打开gui查看内部电量 143 | 将发射器/投掷器发射面对着机器置于机器旁边,激活后发射出的物品也将作为输入物品与机器交互,如果此物品并非机器允许的输入物品,就不会发生交互 144 | 145 | ### 相关合成 146 | #### 锭 147 | 锭可以由对应的矿物粉或者粉碎矿石在熔炉/高炉/电力高炉中冶炼获得 148 | 或者由对应的矿物粒在工作台中9:1合成 149 | #### 粒 150 | 粒由对应的矿物锭在工作台中1:9合成 151 | #### 小撮粉 152 | 由对应的矿物粒进行捶打合成获得 153 | 或者由对应的矿物粉在工作台中1:9合成 154 | #### 粉 155 | 由对应的小撮粉在工作台中1:9合成 156 | #### 板 157 | 由对应的锭进行捶打合成获得 158 | #### 齿轮 159 | 金属齿轮由对应的板在手持齿轮锻造模板的情况下捶打合成获得 160 | 木齿轮合成: 161 | ![image](https://user-images.githubusercontent.com/51087818/123402016-e6b25b00-d5d9-11eb-86a9-96bddc99c808.png) 162 | 石齿轮合成: 163 | ![image](https://user-images.githubusercontent.com/51087818/123402104-f9c52b00-d5d9-11eb-93b6-3b33405da562.png) 164 | #### 精煤 165 | 由精煤粒在工作台9:1合成获得,精煤粒由煤粒进行洗练合成获得,煤粒由煤炭在工作台1:9合成获得 166 | #### 锤子 167 | 由对应材料的原物(锭或钻石或木板或石头)在工作台以如下形式合成 168 | | |x|y|z| 169 | |-|-|-|-| 170 | |1|原物|原物|原物| 171 | |2|原物|木棍|原物 172 | |3| |木棍| | 173 | #### 淘金碗 174 | ![image](https://user-images.githubusercontent.com/51087818/123402570-748e4600-d5da-11eb-9bfd-9710c38b35c3.png) 175 | #### 木桶 176 | ![image](https://user-images.githubusercontent.com/51087818/123402626-8243cb80-d5da-11eb-861c-c271e6babe88.png) 177 | #### 导热片 178 | ![image](https://user-images.githubusercontent.com/51087818/123402686-94256e80-d5da-11eb-9ad7-479cbac65174.png) 179 | #### 火力发电机 180 | ![image](https://user-images.githubusercontent.com/51087818/123402770-ad2e1f80-d5da-11eb-9cde-6d334dd6d267.png) 181 | #### 红石储电箱 182 | ![image](https://user-images.githubusercontent.com/51087818/123402877-c8992a80-d5da-11eb-94cf-0e65ddc3c05c.png) 183 | #### 高炉 184 | ![image](https://user-images.githubusercontent.com/51087818/123402962-dfd81800-d5da-11eb-940f-916545499c00.png) 185 | 186 | ## 温馨提示 187 | - 需要安装BlocklyNukkit才能使用,推荐安装1.2.9.5beta-r1以上版本,获得更好的性能 188 | - 加载本插件时,低配服务器或者面板服可能需要几十秒才能加载完成,请耐心等待 189 | - 进服必须下载材质包,否则客户端会不显示物品材质,有可能崩端 190 | - 使用本插件后,本插件工作期间内机器停留过的地图在卸载后会炸图、背包内有本插件物品的玩家在插件卸载后会无法进服 191 | 192 | ## 最后 193 | 感谢各位的游玩,欢迎up主/实况主录制视频,感谢各位服主的选择 194 | 195 | 196 | 197 | 198 | -------------------------------------------------------------------------------- /guide/version/1.1.0.md: -------------------------------------------------------------------------------- 1 | # 1.1.0 2 | 3 | ## 新增 4 | 5 | ### 自定义配置 6 | 7 | 自定义配置文件将位于`./plugins/TechDawn/config.yml`,您可以配置以下内容 8 | - 数组 enableLevel => 允许科技黎明运行的世界 9 | - 数字 maxPowerConductLength => 电网电能传递长度最大值 10 | 11 | ### 定时机器保存 12 | 13 | 所有机器相关数据将每10分钟进行一次保存,避免关服出错或者突然断电导致数据丢失。 14 | 15 | ### 导热片堆叠 16 | 17 | 导热片现在可以64个为一组进行堆叠了。 18 | 19 | ### 坡莫合金 20 | 21 | 新增了坡莫合金相关物品,包括锭、粒、齿轮、板、粉、小撮粉。 22 | 坡莫合金粉通过 三个镍粉 + 一个铁粉 在工作台无序合成获得。 23 | 24 | ### 磁化不锈钢锭 25 | 26 | 新增了磁化不锈钢锭,通过 4个红石粉 + 1个不锈钢锭 在工作台无序合成获得。 27 | 28 | ### 电动马达 29 | 30 | 新增了电动马达,按下图所示合成获得: 31 | [![RzFAzj.png](https://z3.ax1x.com/2021/07/09/RzFAzj.png)](https://imgtu.com/i/RzFAzj) 32 | 33 | ### 挖掘机 34 | 35 | 挖掘机是一种新的机械,消耗电能自动挖掘指定水平方向上的一格方块。 36 | 其挖掘的方块是放置后黄黑条纹所对的面方向上毗邻的方块,只要电能足够,将会一直尝试挖掘,其只能挖掘挖掘等级为铁镐等级及以下的方块,成功挖掘消耗电能,不成功不会消耗电能。 37 | 38 | 合成: 39 | [![RzFUw6.png](https://z3.ax1x.com/2021/07/09/RzFUw6.png)](https://imgtu.com/i/RzFUw6) 40 | 41 | 相关信息: 42 | 43 | |机器|类别|储电量|发电量|耗电量|接受物品|输出物品| 44 | |-|-|-|-|-|-|-| 45 | |挖掘机|用电器|120RF|0RF|10RF/P|无|无| 46 | 47 | ## 修复 48 | 49 | ### 材质类 50 | 51 | - 修复火力发电机空材质bug 52 | - 修复坡莫合金材质黑框bug 53 | 54 | ### 技术类 55 | 56 | - 修复机器异常丢失bug 57 | - 修复模块导入错误导致的火力发电机变红石电池盒bug 58 | 59 | -------------------------------------------------------------------------------- /guide/version/1.1.1.md: -------------------------------------------------------------------------------- 1 | # 1.1.1 2 | ## 修复 3 | 4 | - 淘金盘对沙砾无效bug 5 | -------------------------------------------------------------------------------- /guide/version/1.1.2.md: -------------------------------------------------------------------------------- 1 | # 1.1.2 2 | ## 修复 3 | 4 | - 修复了挖掘机挖方块错位问题 5 | 6 | -------------------------------------------------------------------------------- /guide/version/1.1.3.md: -------------------------------------------------------------------------------- 1 | # 1.1.3 2 | ## 修复 3 | 4 | - 修复了木桶可以收集非水源错误 5 | - 修复了1.17.10更新导致的火力发电机粒子错误 6 | -------------------------------------------------------------------------------- /guide/version/1.1.4.md: -------------------------------------------------------------------------------- 1 | # 1.1.4 2 | ## 修复 3 | 4 | - 现在机器被奇奇怪怪的东西攻击会直接爆炸 5 | - 修复了粉碎的铜矿烧出铅锭的错误 6 | -------------------------------------------------------------------------------- /guide/version/1.1.5.md: -------------------------------------------------------------------------------- 1 | # 1.1.5 2 | ## 修复 3 | 4 | - 铁砧被破坏后,上面摆放的物品会掉落了 5 | -------------------------------------------------------------------------------- /guide/version/1.2.0.md: -------------------------------------------------------------------------------- 1 | # 1.2.0 2 | 3 | ## 新增 4 | 5 | ### 农场管理机 6 | 7 | 农场管理机可以监测自身周围指定区域的农作物(小麦、马铃薯、甜菜根、胡萝卜、下界疣)是否成熟并收割,收割完后会自动补种,并为其施肥一次。 8 | 9 | 合成方式: 10 | 11 | ![fCe8d1.png](https://z3.ax1x.com/2021/08/02/fCe8d1.png) 12 | 13 | 右键点击(触屏用户长按)打开农场管理机管理界面,可以选择工作区域: 14 | 15 | ![fCeYi6.png](https://z3.ax1x.com/2021/08/02/fCeYi6.png) 16 | 17 | 点击提交即可切换工作模式,切换后会有绿色粒子提示工作范围。 18 | 不同工作范围会消耗不同的电量,如下表所示: 19 | 20 | |模式(工作范围)|耗电| 21 | |-|-| 22 | |3x3|2RF/P| 23 | |5x5|4RF/P| 24 | |7x7|6RF/P| 25 | |9x9|8RF/P| 26 | 27 | 28 | 相关信息: 29 | 30 | |机器|类别|储电量|发电量|耗电量|接受物品|输出物品| 31 | |-|-|-|-|-|-|-| 32 | |农场管理机|用电器|120RF|0RF|2~8RF/P|无|无| 33 | 34 | ### 配置文件 35 | 36 | 新增`machineCheckTime`配置项,默认为`60`。 37 | 该配置项决定了科技黎明每隔多少秒检测一次机器是否被nk服务器当作垃圾清除,如果清除,将重新生成机器。 38 | 39 | ## 修复 40 | 41 | - 修复了机器被火烧不爆炸的bug 42 | - 修复了机器遇到岩浆不爆炸的bug 43 | - 修复了机器被tnt炸不爆炸的bug 44 | - 修复了火力发电机燃烧时间异常少量缩短bug 45 | -------------------------------------------------------------------------------- /guide/version/1.3.0.md: -------------------------------------------------------------------------------- 1 | # 1.3.0 2 | 3 | ## 新增 4 | 5 | ### 电磁铁 6 | 7 | 电磁铁是用来吸引掉落物的机器,工作时,将会将工作范围中的掉落物吸引到自身。 8 | 电磁铁有240RF的内部储能空间,单次功能最多接受20RF。 9 | 右键点击(触屏用户长按)打开农场管理机管理界面,可以选择工作区域,选择完成后点击提交即可生效,会有绿色粒子提示工作范围。 10 | 11 | 电磁铁工作时,每8刻(0.4秒)消耗一次电力,每次消耗的能源为 (工作范围半径 - 1) * 0.5 12 | -------------------------------------------------------------------------------- /guide/version/1.4.0.md: -------------------------------------------------------------------------------- 1 | # 1.4.0 2 | 3 | ## 新增 4 | 5 | ### 太阳能发电机 6 | 7 | 太阳能发电机是一种无需额外燃料的发电设备,工作时可以提供2RF/P的能量输出。 8 | 手持其物品右击、可将其放置在世界中。 9 | 太阳能发电机只能在白天的无遮挡处发电,夜晚或其正上方有方块阻挡时不会发电。 10 | -------------------------------------------------------------------------------- /guide/version/1.4.1.md: -------------------------------------------------------------------------------- 1 | # 1.4.1 2 | 3 | ## 新增 4 | 5 | - 青金石板现在由3个青金石在工作台横排摆放合成 6 | 7 | ## 修复 8 | 9 | - 修复了太阳能发电机合成处电磁铁的bug 10 | -------------------------------------------------------------------------------- /image/不锈钢板.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/不锈钢板.png -------------------------------------------------------------------------------- /image/不锈钢粉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/不锈钢粉.png -------------------------------------------------------------------------------- /image/不锈钢粒.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/不锈钢粒.png -------------------------------------------------------------------------------- /image/不锈钢锤子.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/不锈钢锤子.png -------------------------------------------------------------------------------- /image/不锈钢锭.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/不锈钢锭.png -------------------------------------------------------------------------------- /image/不锈钢齿轮.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/不锈钢齿轮.png -------------------------------------------------------------------------------- /image/光电板.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/光电板.png -------------------------------------------------------------------------------- /image/农场管理机.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/农场管理机.png -------------------------------------------------------------------------------- /image/坡莫合金板.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/坡莫合金板.png -------------------------------------------------------------------------------- /image/坡莫合金粉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/坡莫合金粉.png -------------------------------------------------------------------------------- /image/坡莫合金粒.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/坡莫合金粒.png -------------------------------------------------------------------------------- /image/坡莫合金锭.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/坡莫合金锭.png -------------------------------------------------------------------------------- /image/坡莫合金齿轮.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/坡莫合金齿轮.png -------------------------------------------------------------------------------- /image/太阳能发电机.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/太阳能发电机.png -------------------------------------------------------------------------------- /image/孔雀石矿.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/孔雀石矿.png -------------------------------------------------------------------------------- /image/导热片.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/导热片.png -------------------------------------------------------------------------------- /image/小撮不锈钢粉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/小撮不锈钢粉.png -------------------------------------------------------------------------------- /image/小撮坡莫合金粉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/小撮坡莫合金粉.png -------------------------------------------------------------------------------- /image/小撮煤粉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/小撮煤粉.png -------------------------------------------------------------------------------- /image/小撮硫粉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/小撮硫粉.png -------------------------------------------------------------------------------- /image/小撮金粉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/小撮金粉.png -------------------------------------------------------------------------------- /image/小撮钻石粉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/小撮钻石粉.png -------------------------------------------------------------------------------- /image/小撮铁粉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/小撮铁粉.png -------------------------------------------------------------------------------- /image/小撮铅粉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/小撮铅粉.png -------------------------------------------------------------------------------- /image/小撮铜粉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/小撮铜粉.png -------------------------------------------------------------------------------- /image/小撮铬粉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/小撮铬粉.png -------------------------------------------------------------------------------- /image/小撮银粉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/小撮银粉.png -------------------------------------------------------------------------------- /image/小撮锡粉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/小撮锡粉.png -------------------------------------------------------------------------------- /image/小撮锰粉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/小撮锰粉.png -------------------------------------------------------------------------------- /image/小撮镍粉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/小撮镍粉.png -------------------------------------------------------------------------------- /image/小撮青金石粉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/小撮青金石粉.png -------------------------------------------------------------------------------- /image/小撮青铜粉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/小撮青铜粉.png -------------------------------------------------------------------------------- /image/挖掘机.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/挖掘机.png -------------------------------------------------------------------------------- /image/方铅矿石.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/方铅矿石.png -------------------------------------------------------------------------------- /image/木锤子.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/木锤子.png -------------------------------------------------------------------------------- /image/木齿轮.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/木齿轮.png -------------------------------------------------------------------------------- /image/淘金碗.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/淘金碗.png -------------------------------------------------------------------------------- /image/火力发电机.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/火力发电机.png -------------------------------------------------------------------------------- /image/煤板.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/煤板.png -------------------------------------------------------------------------------- /image/煤粉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/煤粉.png -------------------------------------------------------------------------------- /image/煤粒.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/煤粒.png -------------------------------------------------------------------------------- /image/煤齿轮.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/煤齿轮.png -------------------------------------------------------------------------------- /image/电动马达.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/电动马达.png -------------------------------------------------------------------------------- /image/电磁铁.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/电磁铁.png -------------------------------------------------------------------------------- /image/石墨矿石.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/石墨矿石.png -------------------------------------------------------------------------------- /image/石锤子.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/石锤子.png -------------------------------------------------------------------------------- /image/石齿轮.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/石齿轮.png -------------------------------------------------------------------------------- /image/硫板.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/硫板.png -------------------------------------------------------------------------------- /image/硫粉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/硫粉.png -------------------------------------------------------------------------------- /image/硫粒.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/硫粒.png -------------------------------------------------------------------------------- /image/磁化不锈钢锭.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/磁化不锈钢锭.png -------------------------------------------------------------------------------- /image/磁铁矿.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/磁铁矿.png -------------------------------------------------------------------------------- /image/空木桶.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/空木桶.png -------------------------------------------------------------------------------- /image/粉碎的孔雀石矿.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/粉碎的孔雀石矿.png -------------------------------------------------------------------------------- /image/粉碎的方铅矿.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/粉碎的方铅矿.png -------------------------------------------------------------------------------- /image/粉碎的煤矿.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/粉碎的煤矿.png -------------------------------------------------------------------------------- /image/粉碎的磁铁矿.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/粉碎的磁铁矿.png -------------------------------------------------------------------------------- /image/粉碎的红石矿.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/粉碎的红石矿.png -------------------------------------------------------------------------------- /image/粉碎的绿宝石矿.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/粉碎的绿宝石矿.png -------------------------------------------------------------------------------- /image/粉碎的金矿.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/粉碎的金矿.png -------------------------------------------------------------------------------- /image/粉碎的钻石矿.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/粉碎的钻石矿.png -------------------------------------------------------------------------------- /image/粉碎的铁矿.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/粉碎的铁矿.png -------------------------------------------------------------------------------- /image/粉碎的铜矿.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/粉碎的铜矿.png -------------------------------------------------------------------------------- /image/粉碎的铝矿.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/粉碎的铝矿.png -------------------------------------------------------------------------------- /image/粉碎的铬矿.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/粉碎的铬矿.png -------------------------------------------------------------------------------- /image/粉碎的银矿.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/粉碎的银矿.png -------------------------------------------------------------------------------- /image/粉碎的锌矿.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/粉碎的锌矿.png -------------------------------------------------------------------------------- /image/粉碎的锡矿.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/粉碎的锡矿.png -------------------------------------------------------------------------------- /image/粉碎的锰矿.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/粉碎的锰矿.png -------------------------------------------------------------------------------- /image/粉碎的镍矿.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/粉碎的镍矿.png -------------------------------------------------------------------------------- /image/粉碎的青金石矿.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/粉碎的青金石矿.png -------------------------------------------------------------------------------- /image/精煤.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/精煤.png -------------------------------------------------------------------------------- /image/精煤粒.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/精煤粒.png -------------------------------------------------------------------------------- /image/红石电池箱.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/红石电池箱.png -------------------------------------------------------------------------------- /image/装水木桶.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/装水木桶.png -------------------------------------------------------------------------------- /image/金板.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/金板.png -------------------------------------------------------------------------------- /image/金粉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/金粉.png -------------------------------------------------------------------------------- /image/金齿轮.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/金齿轮.png -------------------------------------------------------------------------------- /image/钻石板.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/钻石板.png -------------------------------------------------------------------------------- /image/钻石粉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/钻石粉.png -------------------------------------------------------------------------------- /image/钻石粒.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/钻石粒.png -------------------------------------------------------------------------------- /image/钻石锤子.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/钻石锤子.png -------------------------------------------------------------------------------- /image/钻石齿轮.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/钻石齿轮.png -------------------------------------------------------------------------------- /image/铁板.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/铁板.png -------------------------------------------------------------------------------- /image/铁粉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/铁粉.png -------------------------------------------------------------------------------- /image/铁锤子.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/铁锤子.png -------------------------------------------------------------------------------- /image/铁齿轮.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/铁齿轮.png -------------------------------------------------------------------------------- /image/铅板.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/铅板.png -------------------------------------------------------------------------------- /image/铅矿石.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/铅矿石.png -------------------------------------------------------------------------------- /image/铅粉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/铅粉.png -------------------------------------------------------------------------------- /image/铅粒.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/铅粒.png -------------------------------------------------------------------------------- /image/铅锭.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/铅锭.png -------------------------------------------------------------------------------- /image/铜板.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/铜板.png -------------------------------------------------------------------------------- /image/铜矿石.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/铜矿石.png -------------------------------------------------------------------------------- /image/铜粉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/铜粉.png -------------------------------------------------------------------------------- /image/铜粒.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/铜粒.png -------------------------------------------------------------------------------- /image/铜线圈.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/铜线圈.png -------------------------------------------------------------------------------- /image/铜锤子.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/铜锤子.png -------------------------------------------------------------------------------- /image/铜锭.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/铜锭.png -------------------------------------------------------------------------------- /image/铜齿轮.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/铜齿轮.png -------------------------------------------------------------------------------- /image/铝矿石.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/铝矿石.png -------------------------------------------------------------------------------- /image/铬板.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/铬板.png -------------------------------------------------------------------------------- /image/铬粉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/铬粉.png -------------------------------------------------------------------------------- /image/铬粒.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/铬粒.png -------------------------------------------------------------------------------- /image/铬锭.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/铬锭.png -------------------------------------------------------------------------------- /image/铬齿轮.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/铬齿轮.png -------------------------------------------------------------------------------- /image/银板.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/银板.png -------------------------------------------------------------------------------- /image/银矿石.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/银矿石.png -------------------------------------------------------------------------------- /image/银粉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/银粉.png -------------------------------------------------------------------------------- /image/银粒.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/银粒.png -------------------------------------------------------------------------------- /image/银锭.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/银锭.png -------------------------------------------------------------------------------- /image/银齿轮.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/银齿轮.png -------------------------------------------------------------------------------- /image/锌矿石.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/锌矿石.png -------------------------------------------------------------------------------- /image/锡板.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/锡板.png -------------------------------------------------------------------------------- /image/锡矿石.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/锡矿石.png -------------------------------------------------------------------------------- /image/锡粉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/锡粉.png -------------------------------------------------------------------------------- /image/锡粒.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/锡粒.png -------------------------------------------------------------------------------- /image/锡锭.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/锡锭.png -------------------------------------------------------------------------------- /image/锡齿轮.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/锡齿轮.png -------------------------------------------------------------------------------- /image/锰板.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/锰板.png -------------------------------------------------------------------------------- /image/锰粉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/锰粉.png -------------------------------------------------------------------------------- /image/锰粒.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/锰粒.png -------------------------------------------------------------------------------- /image/锰锭.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/锰锭.png -------------------------------------------------------------------------------- /image/锰齿轮.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/锰齿轮.png -------------------------------------------------------------------------------- /image/锻造模板.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/锻造模板.png -------------------------------------------------------------------------------- /image/锻造模板_齿轮.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/锻造模板_齿轮.png -------------------------------------------------------------------------------- /image/镍板.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/镍板.png -------------------------------------------------------------------------------- /image/镍矿石.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/镍矿石.png -------------------------------------------------------------------------------- /image/镍粉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/镍粉.png -------------------------------------------------------------------------------- /image/镍粒.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/镍粒.png -------------------------------------------------------------------------------- /image/镍锭.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/镍锭.png -------------------------------------------------------------------------------- /image/镍齿轮.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/镍齿轮.png -------------------------------------------------------------------------------- /image/青金石板.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/青金石板.png -------------------------------------------------------------------------------- /image/青金石粉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/青金石粉.png -------------------------------------------------------------------------------- /image/青金石粒.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/青金石粒.png -------------------------------------------------------------------------------- /image/青金石齿轮.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/青金石齿轮.png -------------------------------------------------------------------------------- /image/青铜板.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/青铜板.png -------------------------------------------------------------------------------- /image/青铜粉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/青铜粉.png -------------------------------------------------------------------------------- /image/青铜粒.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/青铜粒.png -------------------------------------------------------------------------------- /image/青铜锭.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/青铜锭.png -------------------------------------------------------------------------------- /image/青铜齿轮.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/青铜齿轮.png -------------------------------------------------------------------------------- /image/高炉.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/image/高炉.png -------------------------------------------------------------------------------- /model/electromagnet/electromagnet.json: -------------------------------------------------------------------------------- 1 | { 2 | "geometry.electromagnet": { 3 | "bones": [ 4 | { 5 | "name": "head", 6 | "pivot": [0.0, 0.0, 0.0], 7 | "cubes": [{ 8 | "origin": [-8.0, 0.0, -8.0], 9 | "size": [16, 16, 16], 10 | "uv": [0, 0] 11 | }] 12 | } 13 | ] 14 | } 15 | } -------------------------------------------------------------------------------- /model/electromagnet/electromagnet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/model/electromagnet/electromagnet.png -------------------------------------------------------------------------------- /model/farmManager/farmManager.json: -------------------------------------------------------------------------------- 1 | { 2 | "geometry.farmmanager": { 3 | "bones": [ 4 | { 5 | "name": "head", 6 | "pivot": [0.0, 0.0, 0.0], 7 | "cubes": [{ 8 | "origin": [-8.0, 0.0, -8.0], 9 | "size": [16, 16, 16], 10 | "uv": [0, 0] 11 | }] 12 | } 13 | ] 14 | } 15 | } -------------------------------------------------------------------------------- /model/farmManager/farmManager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/model/farmManager/farmManager.png -------------------------------------------------------------------------------- /model/fuelGenerator/fuelGenerator.json: -------------------------------------------------------------------------------- 1 | { 2 | "geometry.fuelgenerator": { 3 | "bones": [ 4 | { 5 | "name": "head", 6 | "pivot": [0.0, 0.0, 0.0], 7 | "cubes": [{ 8 | "origin": [-8.0, 0.0, -8.0], 9 | "size": [16, 16, 16], 10 | "uv": [0, 0] 11 | }] 12 | } 13 | ] 14 | } 15 | } -------------------------------------------------------------------------------- /model/fuelGenerator/fuelGenerator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/model/fuelGenerator/fuelGenerator.png -------------------------------------------------------------------------------- /model/fuelGenerator/fuelGenerator_working.json: -------------------------------------------------------------------------------- 1 | { 2 | "geometry.fuelgenerator_working": { 3 | "bones": [ 4 | { 5 | "name": "head", 6 | "pivot": [0.0, 0.0, 0.0], 7 | "cubes": [{ 8 | "origin": [-8.0, 0.0, -8.0], 9 | "size": [16, 16, 16], 10 | "uv": [0, 0] 11 | }] 12 | } 13 | ] 14 | } 15 | } -------------------------------------------------------------------------------- /model/fuelGenerator/fuelGenerator_working.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/model/fuelGenerator/fuelGenerator_working.png -------------------------------------------------------------------------------- /model/miner/miner.json: -------------------------------------------------------------------------------- 1 | { 2 | "geometry.miner": { 3 | "bones": [ 4 | { 5 | "name": "head", 6 | "pivot": [0.0, 0.0, 0.0], 7 | "cubes": [{ 8 | "origin": [-8.0, 0.0, -8.0], 9 | "size": [16, 16, 16], 10 | "uv": [0, 0] 11 | }] 12 | } 13 | ] 14 | } 15 | } -------------------------------------------------------------------------------- /model/miner/miner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/model/miner/miner.png -------------------------------------------------------------------------------- /model/redStoneBatteryBox/redStoneBatteryBox.json: -------------------------------------------------------------------------------- 1 | { 2 | "geometry.redstonebattreybox": { 3 | "bones": [ 4 | { 5 | "name": "head", 6 | "pivot": [0.0, 0.0, 0.0], 7 | "cubes": [{ 8 | "origin": [-8.0, 0.0, -8.0], 9 | "size": [16, 16, 16], 10 | "uv": [0, 0] 11 | }] 12 | } 13 | ] 14 | } 15 | } -------------------------------------------------------------------------------- /model/redStoneBatteryBox/redStoneBatteryBox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/model/redStoneBatteryBox/redStoneBatteryBox.png -------------------------------------------------------------------------------- /model/shaftFurnace/shaftFurnace.json: -------------------------------------------------------------------------------- 1 | { 2 | "geometry.shaftfurnace": { 3 | "bones": [ 4 | { 5 | "name": "head", 6 | "pivot": [0.0, 0.0, 0.0], 7 | "cubes": [{ 8 | "origin": [-8.0, 0.0, -8.0], 9 | "size": [16, 16, 16], 10 | "uv": [0, 0] 11 | }] 12 | } 13 | ] 14 | } 15 | } -------------------------------------------------------------------------------- /model/shaftFurnace/shaftFurnace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/model/shaftFurnace/shaftFurnace.png -------------------------------------------------------------------------------- /model/solarGenerator/solarGenerator.json: -------------------------------------------------------------------------------- 1 | { 2 | "geometry.solorgenerator": { 3 | "bones": [ 4 | { 5 | "name": "head", 6 | "pivot": [0.0, 0.0, 0.0], 7 | "cubes": [{ 8 | "origin": [-8.0, 0.0, -8.0], 9 | "size": [16, 16, 16], 10 | "uv": [0, 0] 11 | }] 12 | } 13 | ] 14 | } 15 | } -------------------------------------------------------------------------------- /model/solarGenerator/solarGenerator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BlocklyNukkit/TechDawn/ce639f97dcb2a641cefc2871d7107e91faa8c489/model/solarGenerator/solarGenerator.png -------------------------------------------------------------------------------- /src/TechDawn_config.js: -------------------------------------------------------------------------------- 1 | //pragma js 2 | //pragma module TechDawnConfig 3 | 4 | /** 5 | * @author Superice666(超神的冰凉) 6 | * @copyright TechDawn_Project 7 | * @fileoverview 科技黎明插件配置文件模块 8 | */ 9 | 10 | /** 11 | * @description 配置文件路径 12 | */ 13 | const configPath = "./plugins/TechDawn/config.yml"; 14 | 15 | /** 16 | * @description 默认配置文件对象 17 | */ 18 | const defaultConfig = { 19 | /** @type {string[]} */ 20 | enableLevel: [], 21 | /** @type {int} */ 22 | maxPowerConductLength: 256, 23 | /** @type {int} */ 24 | machineCheckTime: 60 25 | }; 26 | 27 | /** 28 | * @description 配置文件对象 29 | */ 30 | var config = defaultConfig; 31 | 32 | /** 33 | * @description 启动时执行的内容 34 | */ 35 | { 36 | loadConfig(); 37 | checkConfig(); 38 | //导入翻译模块 39 | const TechDawnTranslate = require("TechDawnTranslate"); 40 | //创建权限节点 41 | manager.createPermission("techDawn.reloadConfig", TechDawnTranslate.translate("permission_reload_config"), "OP"); 42 | //创建命令 43 | manager.createCommand("reloadtechdawnconfig", TechDawnTranslate.translate("reload_techdawn_config_command"), F((sender, args) => { 44 | //检测玩家是否有权访问命令 45 | if(sender.isPlayer()){ 46 | let player = server.getPlayer(sender.getName()); 47 | if(!manager.checkPlayerPermission("techDawn.reloadConfig", player)){ 48 | player.sendMessage(TechDawnTranslate.translate("no_permission_for_command")); 49 | } 50 | } 51 | //有权访问则重载配置文件 52 | loadConfig(); 53 | sender.sendMessage(TechDawnTranslate.translate("reload_techdawn_config_command_finish")); 54 | })) 55 | } 56 | 57 | /** 58 | * @description 加载配置文件 59 | */ 60 | function loadConfig(){ 61 | let content = manager.readFile(configPath); 62 | if(content == "FILE NOT FOUND"){ 63 | manager.writeFile(configPath, manager.JSONtoYAML(JSON.stringify(config))); 64 | }else{ 65 | config = JSON.parse(manager.YAMLtoJSON(content)); 66 | } 67 | } 68 | 69 | /** 70 | * @description 检查配置文件是否完整 71 | */ 72 | function checkConfig(){ 73 | let full = true; 74 | for (let key in defaultConfig) { 75 | if (Object.hasOwnProperty.call(defaultConfig, key)) { 76 | if(!(config[key])){ 77 | config[key] = defaultConfig[key]; 78 | full = false; 79 | } 80 | } 81 | } 82 | if(!full){ 83 | manager.writeFile(configPath, manager.JSONtoYAML(JSON.stringify(config))); 84 | } 85 | } 86 | 87 | /** 88 | * @description 检查世界是否允许执行科技 89 | * @param {string} levelName 世界名 90 | * @returns {boolean} 91 | */ 92 | export function isLevelEnabled(levelName){ 93 | if(config.enableLevel.length == 0){ 94 | return true; 95 | } 96 | return config.enableLevel.indexOf(levelName) != -1; 97 | } 98 | 99 | /** 100 | * @description 获取最大电网递归次数 101 | * @returns {int} 102 | */ 103 | export function getMaxPowerConductLength(){ 104 | return config.maxPowerConductLength; 105 | } 106 | 107 | /** 108 | * @description 获取机器状态检查间隔时间 109 | * @returns {int} 110 | */ 111 | export function getMachineCheckTime(){ 112 | return config.machineCheckTime; 113 | } -------------------------------------------------------------------------------- /src/TechDawn_main.js: -------------------------------------------------------------------------------- 1 | //pragma js 2 | //pragma module TechDawnMain 3 | 4 | /** 5 | * @author Superice666(超神的冰凉) 6 | * @copyright TechDawn_Project 7 | * @fileoverview 科技黎明插件主模块 8 | */ 9 | 10 | /** @description 翻译模块 @type {Object} */ 11 | var Translate; 12 | /** @description 翻译函数 @type {(toTranslate: string) => string} */ 13 | var T; 14 | /** @description 翻译函数 @type {(toTranslate: string, format: string[]) => string} */ 15 | var TF; 16 | 17 | /** 18 | * @description BN初始化完成事件 19 | */ 20 | function BNInitializedEvent(/**@type {com.blocklynukkit.loader.script.event.BNInitializedEvent}*/event){ 21 | //引入其他模块 22 | Translate = require("TechDawnTranslate"); 23 | //导出翻译函数 24 | T = Translate.translate; 25 | TF = Translate.translateFormat; 26 | 27 | //开始初始化 28 | logger.info(T("init")); 29 | } -------------------------------------------------------------------------------- /src/TechDawn_saver.js: -------------------------------------------------------------------------------- 1 | //pragma js 2 | //pragma module TechDawnSaver 3 | 4 | /** 5 | * @author Superice666(超神的冰凉) 6 | * @copyright TechDawn_Project 7 | * @fileoverview 科技黎明插件数据保存模块 8 | */ 9 | 10 | /** 11 | * @description 科技黎明机器储存 12 | */ 13 | const Long2ObjectOpenHashMap = require("it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap"); 14 | const machineData = new Long2ObjectOpenHashMap(); 15 | 16 | /** 17 | * @description 添加机器 18 | * @param {com.blocklynukkit.loader.other.Entities.BNModel} model 19 | */ 20 | export function addMachine(model) { 21 | machineData.put(model.getId(), model); 22 | } 23 | 24 | /** 25 | * @description 移除机器 26 | * @param {com.blocklynukkit.loader.other.Entities.BNModel} model 27 | */ 28 | export function removeMachine(model) { 29 | machineData.remove(model.getId()); 30 | } 31 | 32 | /** 33 | * @description 保存所有黎明科技机器数据 34 | */ 35 | function BNClosedEvent(/**@type {com.blocklynukkit.loader.script.event.BNClosedEvent}*/event) { 36 | var mainDatas = []; 37 | for (let each of machineData.values()) { 38 | /** @type {com.blocklynukkit.loader.other.Entities.BNModel} */ 39 | let model = each; 40 | let data = {}; 41 | data["x"] = model.getX(); 42 | data["y"] = model.getY(); 43 | data["z"] = model.getZ(); 44 | data["level"] = model.getLevel().getName(); 45 | data["yaw"] = model.getYaw(); 46 | data["pitch"] = model.getPitch(); 47 | data["type"] = model.dataStorage.getItem("name"); 48 | let tmpStorage = {}; 49 | for (let key of model.dataStorage.getKeys()) { 50 | tmpStorage[key] = model.dataStorage.getItem(key); 51 | } 52 | data["dataStorage"] = tmpStorage; 53 | mainDatas.push(data); 54 | model.close(); 55 | } 56 | manager.writeFile("./plugins/TechDawn/machines.json", JSON.stringify(mainDatas)); 57 | } 58 | 59 | /** 60 | * @description 载入所有黎明科技机器 61 | */ 62 | function BNInitializedEvent(/**@type {com.blocklynukkit.loader.script.event.BNInitializedEvent}*/event) { 63 | //导入模块 64 | const TechDawnMachineFuelGenerator = require("TechDawnMachineFuelGenerator"); 65 | const TechDawnMachineRedStoneBatteryBox = require("TechDawnMachineRedStoneBatteryBox"); 66 | const TechDawnMachineShaftFurnace = require("TechDawnMachineShaftFurnace"); 67 | const TechDawnMachineMiner = require("TechDawnMachineMiner"); 68 | const TechDawnMachineFarmManager = require("TechDawnMachineFarmManager"); 69 | const TechDawnElectromagnet = require("TechDawnElectromagnet"); 70 | const TechDawnMachineSolarGenerator = require("TechDawnMachineSolarGenerator"); 71 | const TechDawnConfig = require("TechDawnConfig"); 72 | //解析数据 73 | var data = manager.readFile("./plugins/TechDawn/machines.json"); 74 | if (data == "FILE NOT FOUND") { 75 | return; 76 | } 77 | var mainDatas = JSON.parse(data); 78 | for (let entry of mainDatas) { 79 | let pos = algorithm.buildPosition(entry["x"], entry["y"], entry["z"], server.getLevelByName(entry["level"])); 80 | switch (entry["type"]) { 81 | case "fuelGenerator": 82 | TechDawnMachineFuelGenerator.place(pos, null, entry); break; 83 | case "redStoneBatteryBox": 84 | TechDawnMachineRedStoneBatteryBox.place(pos, null, entry); break; 85 | case "shaftFurnace": 86 | TechDawnMachineShaftFurnace.place(pos, null, entry); break; 87 | case "miner": 88 | TechDawnMachineMiner.place(pos, null, entry); break; 89 | case "farmManager": 90 | TechDawnMachineFarmManager.place(pos, null, entry); break; 91 | case "electromagnet": 92 | TechDawnElectromagnet.place(pos, null, entry); break; 93 | case "solarGenerator": 94 | TechDawnMachineSolarGenerator.place(pos, null, entry); break; 95 | } 96 | } 97 | /** 98 | * @description 定时保存机器数据 99 | */ 100 | manager.createLoopTask(F((tick) => { 101 | var mainDatas = []; 102 | for (let each of machineData.values()) { 103 | /** @type {com.blocklynukkit.loader.other.Entities.BNModel} */ 104 | let model = each; 105 | let data = {}; 106 | data["x"] = model.getX(); 107 | data["y"] = model.getY(); 108 | data["z"] = model.getZ(); 109 | data["level"] = model.getLevel().getName(); 110 | data["yaw"] = model.getYaw(); 111 | data["pitch"] = model.getPitch(); 112 | data["type"] = model.dataStorage.getItem("name"); 113 | let tmpStorage = {}; 114 | for (let key of model.dataStorage.getKeys()) { 115 | tmpStorage[key] = model.dataStorage.getItem(key); 116 | } 117 | data["dataStorage"] = tmpStorage; 118 | mainDatas.push(data); 119 | } 120 | manager.writeFile("./plugins/TechDawn/machines.json", JSON.stringify(mainDatas)); 121 | }), 20 * 60 * 10); 122 | /** 123 | * @description 定时检查机器状态,消失了重新启动 124 | */ 125 | manager.createLoopTask(F(tick => { 126 | for (let each of machineData.values()) { 127 | /** @type {com.blocklynukkit.loader.other.Entities.BNModel} */ 128 | let model = each; 129 | if (model.isClosed()) { 130 | model.spawnToAll(); 131 | } 132 | } 133 | }), 20 * TechDawnConfig.getMachineCheckTime()); 134 | } -------------------------------------------------------------------------------- /src/TechDawn_texture.js: -------------------------------------------------------------------------------- 1 | //pragma js 2 | //pragma module TechDawnTexture 3 | 4 | /** 5 | * @author Superice666(超神的冰凉) 6 | * @copyright TechDawn_Project 7 | * @fileoverview 科技黎明插件材质模块,启动时将所有贴图写入硬盘 8 | */ 9 | 10 | const textureList = [ 11 | '不锈钢板.png', 12 | '不锈钢粉.png', 13 | '不锈钢粒.png', 14 | '不锈钢锤子.png', 15 | '不锈钢锭.png', 16 | '不锈钢齿轮.png', 17 | '孔雀石矿.png', 18 | '小撮不锈钢粉.png', 19 | '小撮煤粉.png', 20 | '小撮硫粉.png', 21 | '小撮金粉.png', 22 | '小撮钻石粉.png', 23 | '小撮铁粉.png', 24 | '小撮铅粉.png', 25 | '小撮铜粉.png', 26 | '小撮铬粉.png', 27 | '小撮银粉.png', 28 | '小撮锡粉.png', 29 | '小撮锰粉.png', 30 | '小撮镍粉.png', 31 | '小撮青金石粉.png', 32 | '小撮青铜粉.png', 33 | '方铅矿石.png', 34 | '木锤子.png', 35 | '木齿轮.png', 36 | '淘金碗.png', 37 | '煤板.png', 38 | '煤粉.png', 39 | '煤粒.png', 40 | '煤齿轮.png', 41 | '石墨矿石.png', 42 | '石锤子.png', 43 | '石齿轮.png', 44 | '硫板.png', 45 | '硫粉.png', 46 | '硫粒.png', 47 | '磁铁矿.png', 48 | '空木桶.png', 49 | '粉碎的孔雀石矿.png', 50 | '粉碎的方铅矿.png', 51 | '粉碎的煤矿.png', 52 | '粉碎的磁铁矿.png', 53 | '粉碎的红石矿.png', 54 | '粉碎的绿宝石矿.png', 55 | '粉碎的金矿.png', 56 | '粉碎的钻石矿.png', 57 | '粉碎的铁矿.png', 58 | '粉碎的铜矿.png', 59 | '粉碎的铝矿.png', 60 | '粉碎的银矿.png', 61 | '粉碎的锌矿.png', 62 | '粉碎的锡矿.png', 63 | '粉碎的青金石矿.png', 64 | '粉碎的镍矿.png', 65 | '粉碎的铬矿.png', 66 | '粉碎的锰矿.png', 67 | '装水木桶.png', 68 | '金板.png', 69 | '金粉.png', 70 | '金齿轮.png', 71 | '钻石板.png', 72 | '钻石粉.png', 73 | '钻石粒.png', 74 | '钻石锤子.png', 75 | '钻石齿轮.png', 76 | '铁板.png', 77 | '铁粉.png', 78 | '铁锤子.png', 79 | '铁齿轮.png', 80 | '铅板.png', 81 | '铅矿石.png', 82 | '铅粉.png', 83 | '铅粒.png', 84 | '铅锭.png', 85 | '铜板.png', 86 | '铜矿石.png', 87 | '铜粉.png', 88 | '铜粒.png', 89 | '铜锤子.png', 90 | '铜锭.png', 91 | '铜齿轮.png', 92 | '铝矿石.png', 93 | '铬板.png', 94 | '铬粉.png', 95 | '铬粒.png', 96 | '铬锭.png', 97 | '铬齿轮.png', 98 | '银板.png', 99 | '银矿石.png', 100 | '银粉.png', 101 | '银粒.png', 102 | '银锭.png', 103 | '银齿轮.png', 104 | '锌矿石.png', 105 | '锡板.png', 106 | '锡矿石.png', 107 | '锡粉.png', 108 | '锡粒.png', 109 | '锡锭.png', 110 | '锡齿轮.png', 111 | '锰板.png', 112 | '锰粉.png', 113 | '锰粒.png', 114 | '锰锭.png', 115 | '锰齿轮.png', 116 | '镍板.png', 117 | '镍矿石.png', 118 | '镍粉.png', 119 | '镍粒.png', 120 | '镍锭.png', 121 | '镍齿轮.png', 122 | '青金石板.png', 123 | '青金石粉.png', 124 | '青金石粒.png', 125 | '青金石齿轮.png', 126 | '青铜板.png', 127 | '青铜粉.png', 128 | '青铜粒.png', 129 | '青铜锭.png', 130 | '青铜齿轮.png', 131 | '锻造模板.png', 132 | '锻造模板_齿轮.png', 133 | '精煤.png', 134 | '精煤粒.png', 135 | '火力发电机.png', 136 | '红石电池箱.png', 137 | '高炉.png', 138 | '导热片.png', 139 | '磁化不锈钢锭.png', 140 | '坡莫合金锭.png', 141 | '坡莫合金粉.png', 142 | '坡莫合金粒.png', 143 | '坡莫合金齿轮.png', 144 | '坡莫合金板.png', 145 | '小撮坡莫合金粉.png', 146 | '电动马达.png', 147 | '挖掘机.png', 148 | '农场管理机.png', 149 | '铜线圈.png', 150 | '电磁铁.png', 151 | '光电板.png', 152 | '太阳能发电机.png', 153 | ] 154 | 155 | const modelList = [ 156 | {path: "fuelGenerator/fuelGenerator.json", name: "fuelGenerator.json"}, 157 | {path: "fuelGenerator/fuelGenerator.png", name: "fuelGenerator.png"}, 158 | {path: "fuelGenerator/fuelGenerator_working.json", name: "fuelGenerator_working.json"}, 159 | {path: "fuelGenerator/fuelGenerator_working.png", name: "fuelGenerator_working.png"}, 160 | {path: "redStoneBatteryBox/redStoneBatteryBox.json", name: "redStoneBatteryBox.json"}, 161 | {path: "redStoneBatteryBox/redStoneBatteryBox.png", name: "redStoneBatteryBox.png"}, 162 | {path: "shaftFurnace/shaftFurnace.json", name: "shaftFurnace.json"}, 163 | {path: "shaftFurnace/shaftFurnace.png", name: "shaftFurnace.png"}, 164 | {path: "miner/miner.json", name: "miner.json"}, 165 | {path: "miner/miner.png", name: "miner.png"}, 166 | {path: "farmManager/farmManager.json", name: "farmManager.json"}, 167 | {path: "farmManager/farmManager.png", name: "farmManager.png"}, 168 | {path: "electromagnet/electromagnet.json", name: "electromagnet.json"}, 169 | {path: "electromagnet/electromagnet.png", name: "electromagnet.png"}, 170 | {path: "solarGenerator/solarGenerator.json", name: "solarGenerator.json"}, 171 | {path: "solarGenerator/solarGenerator.png", name: "solarGenerator.png"}, 172 | ] 173 | 174 | //引入翻译模块 175 | /** @description 翻译模块 @type {Object} */ 176 | const Translate = require("TechDawnTranslate"); 177 | /** @description 翻译函数 @type {(toTranslate: string) => string} */ 178 | var T = Translate.translate; 179 | /** @description 翻译函数 @type {(toTranslate: string, format: string[]) => string} */ 180 | var TF = Translate.translateFormat; 181 | /** @description 是否为中文 @type {boolean} */ 182 | const isChinese = (server.getLanguage().getLang()=="chs"); 183 | //下载物品材质 184 | for(let each of textureList){ 185 | let path = "./plugins/TechDawn/textures/"+each; 186 | if(!manager.isPathExists(path)){ 187 | let url = "https://"+(isChinese?"raw.fastgit.org":"raw.githubusercontent.com")+"/BlocklyNukkit/TectDawn/master/image/"+(java.net.URLEncoder).encode(each, "UTF-8"); 188 | logger.info(TF("download_texture", [each])); 189 | (com.blocklynukkit.loader.utils.Utils).downLoadFromUrl(url, each, "./plugins/TechDawn/textures"); 190 | } 191 | } 192 | //下载模型材质 193 | for(let each of modelList){ 194 | let path = "./plugins/BlocklyNukkit/skin/"+each.name; 195 | if(!manager.isPathExists(path)){ 196 | let url = "https://"+(isChinese?"raw.fastgit.org":"raw.githubusercontent.com")+"/BlocklyNukkit/TectDawn/master/model/"+each.path; 197 | logger.info(TF("download_texture", [each.path])); 198 | (com.blocklynukkit.loader.utils.Utils).downLoadFromUrl(url, each.name, "./plugins/BlocklyNukkit/skin"); 199 | } 200 | } 201 | -------------------------------------------------------------------------------- /src/TechDawn_translate.js: -------------------------------------------------------------------------------- 1 | //pragma js 2 | //pragma module TechDawnTranslate 3 | 4 | /** 5 | * @author Superice666(超神的冰凉) 6 | * @copyright TechDawn_Project 7 | * @fileoverview 科技黎明插件翻译模块 8 | */ 9 | 10 | /** 11 | * @description 翻译内容映射表 12 | */ 13 | const chinese = { 14 | "init": "§e科技黎明插件正在加载中...", 15 | "download_texture": "§b正在下载材质 §e{} §b中...", 16 | "register_items": "§e正在注册物品中...", 17 | "redstone_battery_box_title": "红石电池箱", 18 | "battery_box_content": "存储: §e{} / {} §c RF", 19 | "permission_reload_config": "科技黎明插件重载配置权限", 20 | "reload_techdawn_config_command": "重载科技黎明配置文件命令", 21 | "reload_techdawn_config_command_finish": "科技黎明配置文件重载完成", 22 | "no_permission_for_command": "§c你没有权限使用此命令", 23 | "farm_manager_title": "农场管理机", 24 | "farm_manager_slider_title": "模式", 25 | "electromagnet_title": "电磁铁", 26 | "electromagnet_slider_title": "工作范围", 27 | "solar_generator_working": "太阳能发电机正在工作...", 28 | "solar_generator_not_working": "太阳能发电机未在工作", 29 | } 30 | const english = { 31 | "init": "§eTechDawn plugin loading...", 32 | "download_texture": "§bDownloading texture §e{} §b...", 33 | "register_items": "§eRegistering items...", 34 | "redstone_battery_box_title": "Redstone Battery Box", 35 | "battery_box_content": "Storage: §e{} / {} §c RF", 36 | "permission_reload_config": "The permission to reload configs of techDawn", 37 | "reload_techdawn_config_command": "Reload configs of TechDawn", 38 | "reload_techdawn_config_command_finish": "TechDawn configs reloaded", 39 | "no_permission_for_command": "§cYou DONOT have the permission to access the command", 40 | "farm_manager_title": "Farm Manager", 41 | "farm_manager_slider_title": "Mode", 42 | "electromagnet_title": "Electromagnet", 43 | "electromagnet_slider_title": "Working Radius", 44 | "solar_generator_working": "Solar generator is working...", 45 | "solar_generator_not_working": "Solar generator is NOT working.", 46 | } 47 | const isChinese = (server.getLanguage().getLang() == "chs"); 48 | 49 | 50 | /** 51 | * @description 获取翻译内容 52 | */ 53 | export function translate(toTranslate){ 54 | return isChinese ? chinese[toTranslate] : english[toTranslate]; 55 | } 56 | 57 | /** 58 | * @description 获取格式化翻译内容 59 | */ 60 | export function translateFormat(toTranslate, formats){ 61 | /** @type {string[]} */ 62 | let arr = formats; 63 | /** @type {string} */ 64 | let output = isChinese ? chinese[toTranslate] : english[toTranslate]; 65 | for(let each of arr){ 66 | output = output.replace('{}', each); 67 | } 68 | return output; 69 | } -------------------------------------------------------------------------------- /src/build.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "TechDawn", 3 | "compress": true, 4 | "plugins": [ 5 | "./src/TechDawn_translate.js", 6 | "./src/TechDawn_main.js", 7 | "./src/TechDawn_config.js", 8 | "./src/TechDawn_texture.js", 9 | "./src/items/TechDawn_item.js", 10 | "./src/items/TechDawn_machine.js", 11 | "./src/loot/TechDawn_lootPanning.js", 12 | "./src/items/TechDawn_tool.js", 13 | "./src/machine/TechDawn_anvil.js", 14 | "./src/machine/TechDawn_cauldron.js", 15 | "./src/machine/mutiBlock/TechDawn_coalStack.js", 16 | "./src/machine/power/TechDawn_power.js", 17 | "./src/machine/TechDawn_fuelGenerator.js", 18 | "./src/machine/TechDawn_redStoneBatteryBox.js", 19 | "./src/machine/TechDawn_shaftFurnace.js", 20 | "./src/machine/TechDawn_miner.js", 21 | "./src/machine/TechDawn_farmManager.js", 22 | "./src/machine/TechDawn_electromagnet.js", 23 | "./src/machine/TechDawn_solarGenerator.js", 24 | "./src/TechDawn_saver.js" 25 | ] 26 | } -------------------------------------------------------------------------------- /src/items/TechDawn_item.js: -------------------------------------------------------------------------------- 1 | //pragma js 2 | //pragma module TechDawnItem 3 | 4 | /** 5 | * @author Superice666(超神的冰凉) 6 | * @copyright TechDawn_Project 7 | * @fileoverview 科技黎明插件物品模块 8 | */ 9 | 10 | /** 11 | * @description 配置文件模块 12 | */ 13 | const TechDawnConfig = require("TechDawnConfig"); 14 | 15 | /** 16 | * @description 所有注册过的物品 17 | * @type {{[key: string]: ItemInfo}} 18 | */ 19 | const items = {}; 20 | 21 | /** 22 | * @description 根据物品名获取物品信息 23 | * @param {string} name 24 | * @returns {ItemInfo} 25 | */ 26 | export function getItemInfo(name){ 27 | return items[name]; 28 | } 29 | 30 | /** 31 | * @class 32 | * @classdesc 描述一个物品的信息 33 | * @constructor 34 | * @param {int} id 物品的id 35 | * @param {string} name 物品的名称 36 | * @param {string} eng 物品英文翻译名 37 | * @param {string} chn 物品中文翻译名 38 | * @param {string} texturePath 物品贴图路径 39 | * @param {string} stackSize 物品最大堆叠数量 40 | * @param {string} type 物品的种类:`construction` `nature` `equipment` `items` 41 | * @param {boolean} isDisplayAsTool 是否展示为工具 42 | * @param {boolean} canOnOffhand 副手装备 43 | */ 44 | function ItemInfo(id, name, eng, chn, texturePath, stackSize, type, isDisplayAsTool, canOnOffhand){ 45 | /** @description 物品的id */ 46 | this.id = id; 47 | /** @description 物品的名称 */ 48 | this.name = name; 49 | /** @description 物品的英文翻译名 */ 50 | this.eng = eng; 51 | /** @description 物品的中文翻译名 */ 52 | this.chn = chn; 53 | /** @description 物品的贴图路径 */ 54 | this.texturePath = texturePath; 55 | /** @description 物品的最大堆叠数量 */ 56 | this.stackSize = stackSize; 57 | /** @description 物品的种类:`construction` `nature` `equipment` `items` */ 58 | this.type = type; 59 | /** @description 是否展示为工具 */ 60 | this.isDisplayAsTool = isDisplayAsTool; 61 | /** @description 副手装备 */ 62 | this.canOnOffhand = canOnOffhand; 63 | //保存该物品 64 | items[name] = this; 65 | /** 66 | * @description 注册该类描述的物品并返回类自身 67 | */ 68 | this.register = function(){ 69 | blockitem.registerSimpleItem(this.id, this.name, this.stackSize, this.type, this.isDisplayAsTool, this.canOnOffhand); 70 | blockitem.addItemEnglishTranslation(this.id, this.eng); 71 | blockitem.addItemChineseTranslation(this.id, this.chn); 72 | blockitem.addItemTexture(this.id, this.texturePath); 73 | blockitem.addToCreativeBar(blockitem.buildItem(this.id, 0, 1)); 74 | return this; 75 | } 76 | } 77 | 78 | /** 79 | * @description 注册物品 80 | * @summary 3351-3400 机械 81 | * @summary 3401-3500 工具 82 | * @summary 3501-3520 粉碎矿石 83 | * @summary 3521-3580 矿物粉 84 | * @summary 3581-3640 小撮矿物粉 85 | * @summary 3641-3680 齿轮 86 | * @summary 3681-3720 金属板 87 | * @summary 3721-3770 金属锭 88 | * @summary 3771-3830 金属粒 89 | */ 90 | 91 | //引入翻译模块 92 | const Translate = require("TechDawnTranslate"); 93 | //导出翻译函数 94 | const T = Translate.translate; 95 | const TF = Translate.translateFormat; 96 | //发出提示 97 | logger.info(T("register_items")); 98 | //粉碎矿石 99 | new ItemInfo(3501, "crushed_magnetite_ore", "Crushed Magnetite Ore", "粉碎的磁铁矿", "./plugins/TechDawn/textures/粉碎的磁铁矿.png", 64, "nature", false, false).register(); 100 | new ItemInfo(3502, "crushed_gelenite_ore", "Crushed Gelenite Ore", "粉碎的方铅矿", "./plugins/TechDawn/textures/粉碎的方铅矿.png", 64, "nature", false, false).register(); 101 | new ItemInfo(3503, "crushed_gold_ore", "Crushed Gold Ore", "粉碎的金矿", "./plugins/TechDawn/textures/粉碎的金矿.png", 64, "nature", false, false).register(); 102 | new ItemInfo(3504, "crushed_malachite_ore", "Crushed Malachite Ore", "粉碎的孔雀石矿", "./plugins/TechDawn/textures/粉碎的孔雀石矿.png", 64, "nature", false, false).register(); 103 | new ItemInfo(3505, "crushed_aluminium_ore", "Crushed Aluminium Ore", "粉碎的铝矿", "./plugins/TechDawn/textures/粉碎的铝矿.png", 64, "nature", false, false).register(); 104 | new ItemInfo(3506, "crushed_emerald_ore", "Crushed Emerald Ore", "粉碎的绿宝石矿", "./plugins/TechDawn/textures/粉碎的绿宝石矿.png", 64, "nature", false, false).register(); 105 | new ItemInfo(3507, "crushed_coal_ore", "Crushed Coal Ore", "粉碎的煤矿", "./plugins/TechDawn/textures/粉碎的煤矿.png", 64, "nature", false, false).register(); 106 | new ItemInfo(3508, "crushed_iron_ore", "Crushed Iron Ore", "粉碎的铁矿", "./plugins/TechDawn/textures/粉碎的铁矿.png", 64, "nature", false, false).register(); 107 | new ItemInfo(3509, "crushed_copper_ore", "Crushed Copper Ore", "粉碎的铜矿", "./plugins/TechDawn/textures/粉碎的铜矿.png", 64, "nature", false, false).register(); 108 | new ItemInfo(3510, "crushed_tin_ore", "Crushed Tin Ore", "粉碎的锡矿", "./plugins/TechDawn/textures/粉碎的锡矿.png", 64, "nature", false, false).register(); 109 | new ItemInfo(3511, "crushed_zinc_ore", "Crushed Zinc Ore", "粉碎的锌矿", "./plugins/TechDawn/textures/粉碎的锌矿.png", 64, "nature", false, false).register(); 110 | new ItemInfo(3512, "crushed_silver_ore", "Crushed Silver Ore", "粉碎的银矿", "./plugins/TechDawn/textures/粉碎的银矿.png", 64, "nature", false, false).register(); 111 | new ItemInfo(3513, "crushed_diamond_ore", "Crushed Diamond Ore", "粉碎的钻石矿", "./plugins/TechDawn/textures/粉碎的钻石矿.png", 64, "nature", false, false).register(); 112 | new ItemInfo(3514, "crushed_redstone_ore", "Crushed Redstone Ore", "粉碎的红石矿", "./plugins/TechDawn/textures/粉碎的红石矿.png", 64, "nature", false, false).register(); 113 | new ItemInfo(3515, "crushed_lapis_ore", "Crushed Lapis Ore", "粉碎的青金石矿", "./plugins/TechDawn/textures/粉碎的青金石矿.png", 64, "nature", false, false).register(); 114 | new ItemInfo(3516, "crushed_nickel_ore", "Crushed Nickel Ore", "粉碎的镍矿", "./plugins/TechDawn/textures/粉碎的镍矿.png", 64, "nature", false, false).register(); 115 | new ItemInfo(3517, "crushed_chromium_ore", "Crushed Chromium Ore", "粉碎的铬矿", "./plugins/TechDawn/textures/粉碎的铬矿.png", 64, "nature", false, false).register(); 116 | new ItemInfo(3518, "crushed_manganese_ore", "Crushed Manganese Ore", "粉碎的软锰矿", "./plugins/TechDawn/textures/粉碎的锰矿.png", 64, "nature", false, false).register(); 117 | //金属锭 118 | new ItemInfo(3721, "stainless_steel_ingot", "Stainless Steel Ingot", "不锈钢锭", "./plugins/TechDawn/textures/不锈钢锭.png", 64, "items", false, false).register(); 119 | new ItemInfo(3722, "chromium_ingot", "Chromium Ingot", "铬锭", "./plugins/TechDawn/textures/铬锭.png", 64, "items", false, false).register(); 120 | new ItemInfo(3723, "manganese_ingot", "Manganese Ingot", "锰锭", "./plugins/TechDawn/textures/锰锭.png", 64, "items", false, false).register(); 121 | new ItemInfo(3724, "lead_ingot", "Lead Ingot", "铅锭", "./plugins/TechDawn/textures/铅锭.png", 64, "items", false, false).register(); 122 | new ItemInfo(3725, "bronze_ingot", "Bronze Ingot", "青铜锭", "./plugins/TechDawn/textures/青铜锭.png", 64, "items", false, false).register(); 123 | new ItemInfo(3726, "copper_ingot", "Copper Ingot", "铜锭", "./plugins/TechDawn/textures/铜锭.png", 64, "items", false, false).register(); 124 | new ItemInfo(3727, "tin_ingot", "Tin Ingot", "锡锭", "./plugins/TechDawn/textures/锡锭.png", 64, "items", false, false).register(); 125 | new ItemInfo(3728, "silver_ingot", "Silver Ingot", "银锭", "./plugins/TechDawn/textures/银锭.png", 64, "items", false, false).register(); 126 | new ItemInfo(3729, "clean_coal", "Clean Coal", "精煤", "./plugins/TechDawn/textures/精煤.png", 64, "items", false, false).register(); 127 | new ItemInfo(3730, "nickel_ingot", "Nickel Ingot", "镍锭", "./plugins/TechDawn/textures/镍锭.png", 64, "nature", false, false).register(); 128 | new ItemInfo(3731, "magnetized_stainless_steel_ingot", "Magnetized Stainless Steel Ingot", "磁化不锈钢锭", "./plugins/TechDawn/textures/磁化不锈钢锭.png", 64, "nature", false, false).register(); 129 | new ItemInfo(3732, "permalloy_ingot", "Permalloy Ingot", "坡莫合金锭", "./plugins/TechDawn/textures/坡莫合金锭.png", 64, "nature", false, false).register(); 130 | //金属粉 131 | new ItemInfo(3521, "stainless_steel_dust", "Stainless Steel Dust", "不锈钢粉", "./plugins/TechDawn/textures/不锈钢粉.png", 64, "items", false, false).register(); 132 | new ItemInfo(3522, "chromium_dust", "Chromi Dust", "铬粉", "./plugins/TechDawn/textures/铬粉.png", 64, "items", false, false).register(); 133 | new ItemInfo(3523, "gold_dust", "Gold Dust", "金粉", "./plugins/TechDawn/textures/金粉.png", 64, "items", false, false).register(); 134 | new ItemInfo(3524, "sulfur_dust", "Sulfur Dust", "硫粉", "./plugins/TechDawn/textures/硫粉.png", 64, "items", false, false).register(); 135 | new ItemInfo(3525, "coal_dust", "Coal Dust", "煤粉", "./plugins/TechDawn/textures/煤粉.png", 64, "items", false, false).register(); 136 | new ItemInfo(3526, "manganese_dust", "Manganese Dust", "锰粉", "./plugins/TechDawn/textures/锰粉.png", 64, "items", false, false).register(); 137 | new ItemInfo(3527, "nickel_dust", "Nickel Dust", "镍粉", "./plugins/TechDawn/textures/镍粉.png", 64, "items", false, false).register(); 138 | new ItemInfo(3528, "lead_dust", "Lead Dust", "铅粉", "./plugins/TechDawn/textures/铅粉.png", 64, "items", false, false).register(); 139 | new ItemInfo(3529, "lapis_dust", "Lapis Dust", "青金石粉", "./plugins/TechDawn/textures/青金石粉.png", 64, "items", false, false).register(); 140 | new ItemInfo(3530, "bronze_dust", "Bronze Dust", "青铜粉", "./plugins/TechDawn/textures/青铜粉.png", 64, "items", false, false).register(); 141 | new ItemInfo(3531, "iron_dust", "Iron Dust", "铁粉", "./plugins/TechDawn/textures/铁粉.png", 64, "items", false, false).register(); 142 | new ItemInfo(3532, "copper_dust", "Copper Dust", "铜粉", "./plugins/TechDawn/textures/铜粉.png", 64, "items", false, false).register(); 143 | new ItemInfo(3533, "tin_dust", "Tin Dust", "锡粉", "./plugins/TechDawn/textures/锡粉.png", 64, "items", false, false).register(); 144 | new ItemInfo(3534, "silver_dust", "Silver Dust", "银粉", "./plugins/TechDawn/textures/银粉.png", 64, "items", false, false).register(); 145 | new ItemInfo(3535, "diamond_dust", "Diamond Dust", "钻石粉", "./plugins/TechDawn/textures/钻石粉.png", 64, "items", false, false).register(); 146 | new ItemInfo(3536, "permalloy_dust", "Permalloy Dust", "坡莫合金粉", "./plugins/TechDawn/textures/坡莫合金粉.png", 64, "items", false, false).register(); 147 | //小撮金属粉 148 | new ItemInfo(3581, "tiny_stainless_steel_dust", "Tiny Stainl Steel Dust", "小撮不锈钢粉", "./plugins/TechDawn/textures/小撮不锈钢粉.png", 64, "items", false, false).register(); 149 | new ItemInfo(3582, "tiny_chromium_dust", "Tiny Chromium Dust", "小撮铬粉", "./plugins/TechDawn/textures/小撮铬粉.png", 64, "items", false, false).register(); 150 | new ItemInfo(3583, "tiny_gold_dust", "Tiny Gold Dust", "小撮金粉", "./plugins/TechDawn/textures/小撮金粉.png", 64, "items", false, false).register(); 151 | new ItemInfo(3584, "tiny_sulfur_dust", "Tiny Sulfur Dust", "小撮硫粉", "./plugins/TechDawn/textures/小撮硫粉.png", 64, "items", false, false).register(); 152 | new ItemInfo(3585, "tiny_coal_dust", "Tiny Coal Dust", "小撮煤粉", "./plugins/TechDawn/textures/小撮煤粉.png", 64, "items", false, false).register(); 153 | new ItemInfo(3586, "tiny_manganese_dust", "Tiny Manganese Dust", "小撮锰粉", "./plugins/TechDawn/textures/小撮锰粉.png", 64, "items", false, false).register(); 154 | new ItemInfo(3587, "tiny_nickel_dust", "Tiny Nickel Dust", "小撮镍粉", "./plugins/TechDawn/textures/小撮镍粉.png", 64, "items", false, false).register(); 155 | new ItemInfo(3588, "tiny_lead_dust", "Tiny Lead Dust", "小撮铅粉", "./plugins/TechDawn/textures/小撮铅粉.png", 64, "items", false, false).register(); 156 | new ItemInfo(3589, "tiny_lapis_dust", "Tiny Lapis Dust", "小撮青金石粉", "./plugins/TechDawn/textures/小撮青金石粉.png", 64, "items", false, false).register(); 157 | new ItemInfo(3590, "tiny_bronze_dust", "Tiny Bronze Dust", "小撮青铜粉", "./plugins/TechDawn/textures/小撮青铜粉.png", 64, "items", false, false).register(); 158 | new ItemInfo(3591, "tiny_iron_dust", "Tiny Iron Dust", "小撮铁粉", "./plugins/TechDawn/textures/小撮铁粉.png", 64, "items", false, false).register(); 159 | new ItemInfo(3592, "tiny_copper_dust", "Tiny Copper Dust", "小撮铜粉", "./plugins/TechDawn/textures/小撮铜粉.png", 64, "items", false, false).register(); 160 | new ItemInfo(3593, "tiny_tin_dust", "Tiny Tin Dust", "小撮锡粉", "./plugins/TechDawn/textures/小撮锡粉.png", 64, "items", false, false).register(); 161 | new ItemInfo(3594, "tiny_silver_dust", "Tiny Silver Dust", "小撮银粉", "./plugins/TechDawn/textures/小撮银粉.png", 64, "items", false, false).register(); 162 | new ItemInfo(3595, "tiny_diamond_dust", "Tiny Diamond Dust", "小撮钻石粉", "./plugins/TechDawn/textures/小撮钻石粉.png", 64, "items", false, false).register(); 163 | new ItemInfo(3596, "tiny_permalloy_dust", "Tiny Permalloy Dust", "小撮坡莫合金粉", "./plugins/TechDawn/textures/小撮坡莫合金粉.png", 64, "items", false, false).register(); 164 | //金属粒 165 | new ItemInfo(3771, "stainless_steel_nugget", "Stainless Steel Nugget", "不锈钢粒", "./plugins/TechDawn/textures/不锈钢粒.png", 64, "items", false, false).register(); 166 | new ItemInfo(3772, "chromium_nugget", "Chromium Nugget", "铬粒", "./plugins/TechDawn/textures/铬粒.png", 64, "items", false, false).register(); 167 | new ItemInfo(3773, "sulfur_nugget", "Sulfur Nugget", "硫粒", "./plugins/TechDawn/textures/硫粒.png", 64, "items", false, false).register(); 168 | new ItemInfo(3774, "coal_nugget", "Coal Nugget", "煤粒", "./plugins/TechDawn/textures/煤粒.png", 64, "items", false, false).register(); 169 | new ItemInfo(3775, "manganese_nugget", "Manganese Nugget", "锰粒", "./plugins/TechDawn/textures/锰粒.png", 64, "items", false, false).register(); 170 | new ItemInfo(3776, "nickel_nugget", "Nickel Nugget", "镍粒", "./plugins/TechDawn/textures/镍粒.png", 64, "items", false, false).register(); 171 | new ItemInfo(3777, "lead_nugget", "Lead Nugget", "铅粒", "./plugins/TechDawn/textures/铅粒.png", 64, "items", false, false).register(); 172 | new ItemInfo(3778, "lapis_nugget", "Lapis Nugget", "青金石粒", "./plugins/TechDawn/textures/青金石粒.png", 64, "items", false, false).register(); 173 | new ItemInfo(3779, "bronze_nugget", "Bronze Nugget", "青铜粒", "./plugins/TechDawn/textures/青铜粒.png", 64, "items", false, false).register(); 174 | new ItemInfo(3780, "copper_nugget", "Copper Nugget", "铜粒", "./plugins/TechDawn/textures/铜粒.png", 64, "items", false, false).register(); 175 | new ItemInfo(3781, "tin_nugget", "Tin Nugget", "锡粒", "./plugins/TechDawn/textures/锡粒.png", 64, "items", false, false).register(); 176 | new ItemInfo(3782, "silver_nugget", "Silver Nugget", "银粒", "./plugins/TechDawn/textures/银粒.png", 64, "items", false, false).register(); 177 | new ItemInfo(3783, "diamond_nugget", "Diamond Nugget", "钻石粒", "./plugins/TechDawn/textures/钻石粒.png", 64, "items", false, false).register(); 178 | new ItemInfo(3784, "clean_coal_nugget", "Clean Coal Nugget", "精煤粒", "./plugins/TechDawn/textures/精煤粒.png", 64, "items", false, false).register(); 179 | new ItemInfo(3785, "permalloy_nugget", "Permalloy Nugget", "坡莫合金粒", "./plugins/TechDawn/textures/坡莫合金粒.png", 64, "items", false, false).register(); 180 | //金属板 181 | new ItemInfo(3681, "stainless_steel_plate", "Stainless Steel Plate", "不锈钢板", "./plugins/TechDawn/textures/不锈钢板.png", 64, "items", false, false).register(); 182 | new ItemInfo(3682, "chromium_plate", "Chromium Plate", "铬板", "./plugins/TechDawn/textures/铬板.png", 64, "items", false, false).register(); 183 | new ItemInfo(3683, "gold_plate", "Gold Plate", "金板", "./plugins/TechDawn/textures/金板.png", 64, "items", false, false).register(); 184 | new ItemInfo(3684, "sulfur_plate", "Sulfur Plate", "硫板", "./plugins/TechDawn/textures/硫板.png", 64, "items", false, false).register(); 185 | new ItemInfo(3685, "coal_plate", "Coal Plate", "煤板", "./plugins/TechDawn/textures/煤板.png", 64, "items", false, false).register(); 186 | new ItemInfo(3686, "manganese_plate", "Manganese Plate", "锰板", "./plugins/TechDawn/textures/锰板.png", 64, "items", false, false).register(); 187 | new ItemInfo(3687, "nickel_plate", "Nickel Plate", "镍板", "./plugins/TechDawn/textures/镍板.png", 64, "items", false, false).register(); 188 | new ItemInfo(3688, "lead_plate", "Lead Plate", "铅板", "./plugins/TechDawn/textures/铅板.png", 64, "items", false, false).register(); 189 | new ItemInfo(3689, "lapis_plate", "Lapis Plate", "青金石板", "./plugins/TechDawn/textures/青金石板.png", 64, "items", false, false).register(); 190 | new ItemInfo(3690, "bronze_plate", "Bronze Plate", "青铜板", "./plugins/TechDawn/textures/青铜板.png", 64, "items", false, false).register(); 191 | new ItemInfo(3691, "iron_plate", "Iron Plate", "铁板", "./plugins/TechDawn/textures/铁板.png", 64, "items", false, false).register(); 192 | new ItemInfo(3692, "copper_plate", "Copper Plate", "铜板", "./plugins/TechDawn/textures/铜板.png", 64, "items", false, false).register(); 193 | new ItemInfo(3693, "tin_plate", "Tin Plate", "锡板", "./plugins/TechDawn/textures/锡板.png", 64, "items", false, false).register(); 194 | new ItemInfo(3694, "silver_plate", "Silver Plate", "银板", "./plugins/TechDawn/textures/银板.png", 64, "items", false, false).register(); 195 | new ItemInfo(3695, "diamond_plate", "Diamond Plate", "钻石板", "./plugins/TechDawn/textures/钻石板.png", 64, "items", false, false).register(); 196 | new ItemInfo(3696, "permalloy_plate", "Permalloy Plate", "坡莫合金板", "./plugins/TechDawn/textures/坡莫合金板.png", 64, "items", false, false).register(); 197 | new ItemInfo(3697, "photoelectric_plate", "Photoelectric Plate", "光电板", "./plugins/TechDawn/textures/光电板.png", 64, "items", false, false).register(); 198 | //齿轮 199 | new ItemInfo(3641, "stainless_steel_gear", "Stainless Steel Gear", "不锈钢齿轮", "./plugins/TechDawn/textures/不锈钢齿轮.png", 64, "items", false, false).register(); 200 | new ItemInfo(3642, "chromium_gear", "Chromium Gear", "铬齿轮", "./plugins/TechDawn/textures/铬齿轮.png", 64, "items", false, false).register(); 201 | new ItemInfo(3643, "gold_gear", "Gold Gear", "金齿轮", "./plugins/TechDawn/textures/金齿轮.png", 64, "items", false, false).register(); 202 | new ItemInfo(3644, "coal_gear", "Coal Gear", "煤齿轮", "./plugins/TechDawn/textures/煤齿轮.png", 64, "items", false, false).register(); 203 | new ItemInfo(3645, "manganese_gear", "Manganese Gear", "锰齿轮", "./plugins/TechDawn/textures/锰齿轮.png", 64, "items", false, false).register(); 204 | new ItemInfo(3646, "wood_gear", "Wood Gear", "木齿轮", "./plugins/TechDawn/textures/木齿轮.png", 64, "items", false, false).register(); 205 | new ItemInfo(3647, "nickel_gear", "Nickel Gear", "镍齿轮", "./plugins/TechDawn/textures/镍齿轮.png", 64, "items", false, false).register(); 206 | new ItemInfo(3649, "lapis_gear", "Lapis Gear", "青金石齿轮", "./plugins/TechDawn/textures/青金石齿轮.png", 64, "items", false, false).register(); 207 | new ItemInfo(3650, "bronze_gear", "Bronze Gear", "青铜齿轮", "./plugins/TechDawn/textures/青铜齿轮.png", 64, "items", false, false).register(); 208 | new ItemInfo(3651, "stone_gear", "Stone Gear", "石齿轮", "./plugins/TechDawn/textures/石齿轮.png", 64, "items", false, false).register(); 209 | new ItemInfo(3652, "iron_gear", "Iron Gear", "铁齿轮", "./plugins/TechDawn/textures/铁齿轮.png", 64, "items", false, false).register(); 210 | new ItemInfo(3653, "copper_gear", "Copper Gear", "铜齿轮", "./plugins/TechDawn/textures/铜齿轮.png", 64, "items", false, false).register(); 211 | new ItemInfo(3654, "tin_gear", "Tin Gear", "锡齿轮", "./plugins/TechDawn/textures/锡齿轮.png", 64, "items", false, false).register(); 212 | new ItemInfo(3655, "silver_gear", "Silver Gear", "银齿轮", "./plugins/TechDawn/textures/银齿轮.png", 64, "items", false, false).register(); 213 | new ItemInfo(3656, "diamond_gear", "Diamond Gear", "钻石齿轮", "./plugins/TechDawn/textures/钻石齿轮.png", 64, "items", false, false).register(); 214 | new ItemInfo(3657, "permallo_gear", "Permallo Gear", "坡莫合金齿轮", "./plugins/TechDawn/textures/坡莫合金齿轮.png", 64, "items", false, false).register(); 215 | //木桶 216 | new ItemInfo(3402, "empty_wood_bucket", "Empty Wood Bucket", "空木桶", "./plugins/TechDawn/textures/空木桶.png", 64, "items", true, true).register(); 217 | new ItemInfo(3403, "watered_wood_buckeet", "Watered Wood Bucket", "装水木桶", "./plugins/TechDawn/textures/装水木桶.png", 16, "items", true, true).register(); 218 | //锻造模板 219 | new ItemInfo(3409, "forging_template", "Forging Template", "锻造模板", "./plugins/TechDawn/textures/锻造模板.png", 1, "items", false, true).register(); 220 | new ItemInfo(3410, "forging_template_gear", "Forging Template Gear", "齿轮锻造模板", "./plugins/TechDawn/textures/锻造模板_齿轮.png", 1, "items", false, true).register(); 221 | //导热片 222 | new ItemInfo(3411, "heat_conducting_sheet", "Heat Conducting Sheet", "导热片", "./plugins/TechDawn/textures/导热片.png", 64, "items", false, true).register(); 223 | //电动马达 224 | new ItemInfo(3412, "motor", "Motor", "电动马达", "./plugins/TechDawn/textures/电动马达.png", 64, "items", false, true).register(); 225 | //铜线圈 226 | new ItemInfo(3413, "copper_coil", "Copper Coil", "铜线圈", "./plugins/TechDawn/textures/铜线圈.png", 64, "items", false, true).register(); 227 | 228 | 229 | /** 230 | * @description 注册冶炼合成表 231 | * @param {int} input 原料 232 | * @param {int} output 产物 233 | * @param {int?} data 数据值 234 | */ 235 | function frunace(input, output, data){ 236 | if(data){ 237 | blockitem.addFurnaceCraft(blockitem.buildItem(input, 0, 1), blockitem.buildItem(output, data, 1)); 238 | }else{ 239 | blockitem.addFurnaceCraft(blockitem.buildItem(input, 0, 1), blockitem.buildItem(output, 0, 1)); 240 | } 241 | let BlastFurnaceRecipe = require("cn.nukkit.inventory.BlastFurnaceRecipe"); 242 | if(manager.isPowerNukkit()){ 243 | if(data){ 244 | server.addRecipe(new BlastFurnaceRecipe(blockitem.buildItem(output, data, 1), blockitem.buildItem(input, 0, 1))); 245 | }else{ 246 | server.addRecipe(new BlastFurnaceRecipe(blockitem.buildItem(output, 0, 1), blockitem.buildItem(input, 0, 1))); 247 | } 248 | } 249 | } 250 | 251 | /** 252 | * @description 注册1变9无序配方 253 | * @param {int} input 原料id 254 | * @param {int} output 产物id 255 | * @param {int?} dataInput 原料特殊值 256 | * @param {int?} dataOutput 产物特殊值 257 | */ 258 | function craft19(input, output, dataInput, dataOutput){ 259 | if(!dataInput) dataInput = 0; 260 | if(!dataOutput) dataOutput = 0; 261 | blockitem.addShapelessCraft(Java.to([blockitem.buildItem(input, dataInput, 1)], "cn.nukkit.item.Item[]"), blockitem.buildItem(output, dataOutput, 9)); 262 | } 263 | 264 | /** 265 | * @description 注册9变1无序配方 266 | * @param {int} input 原料id 267 | * @param {int} output 产物id 268 | * @param {int?} dataInput 原料特殊值 269 | * @param {int?} dataOutput 产物特殊值 270 | */ 271 | function craft91(input, output, dataInput, dataOutput){ 272 | if(!dataInput) dataInput = 0; 273 | if(!dataOutput) dataOutput = 0; 274 | blockitem.addShapelessCraft(Java.to([ 275 | blockitem.buildItem(input, dataInput, 1), 276 | blockitem.buildItem(input, dataInput, 1), 277 | blockitem.buildItem(input, dataInput, 1), 278 | blockitem.buildItem(input, dataInput, 1), 279 | blockitem.buildItem(input, dataInput, 1), 280 | blockitem.buildItem(input, dataInput, 1), 281 | blockitem.buildItem(input, dataInput, 1), 282 | blockitem.buildItem(input, dataInput, 1), 283 | blockitem.buildItem(input, dataInput, 1) 284 | ], "cn.nukkit.item.Item[]"), blockitem.buildItem(output, dataOutput, 1)); 285 | } 286 | 287 | //粉碎的矿石冶炼为锭 288 | frunace(3501, 265); 289 | frunace(3502, 3724); 290 | frunace(3503, 266); 291 | frunace(3504, 3726); 292 | //frunace(3505, null); 铝锭不能熔炉冶炼 293 | frunace(3506, 388); 294 | frunace(3507, 263); 295 | frunace(3508, 265); 296 | frunace(3509, 3726); 297 | frunace(3510, 3727); 298 | //frunace(3511, null) 锌锭不能熔炉冶炼 299 | frunace(3512, 3728); 300 | frunace(3513, 264); 301 | frunace(3514, 331); 302 | frunace(3515, 351, 4); 303 | frunace(3516, 3730); 304 | frunace(3517, 3722); 305 | frunace(3518, 3723); 306 | 307 | //金属粉冶炼为锭 308 | frunace(3521, 3721); 309 | frunace(3522, 3722); 310 | frunace(3523, 266); 311 | frunace(3526, 3723); 312 | frunace(3528, 3724); 313 | frunace(3530, 3725); 314 | frunace(3531, 265); 315 | frunace(3532, 3726); 316 | frunace(3533, 3727); 317 | frunace(3534, 3728); 318 | frunace(3527, 3730); 319 | frunace(3536, 3732); 320 | 321 | //小撮金属粉冶炼为粒 322 | frunace(3581, 3771); 323 | frunace(3582, 3772); 324 | frunace(3583, 371); 325 | frunace(3585, 3774); 326 | frunace(3586, 3775); 327 | frunace(3587, 3776); 328 | frunace(3588, 3777); 329 | frunace(3589, 3778); 330 | frunace(3590, 3779); 331 | frunace(3591, 452); 332 | frunace(3592, 3780); 333 | frunace(3593, 3781); 334 | frunace(3594, 3782); 335 | frunace(3595, 3783); 336 | frunace(3596, 3785); 337 | 338 | //金属锭变成金属粒 339 | craft19(3721, 3771); 340 | craft19(3722, 3772); 341 | craft19(3723, 3775); 342 | craft19(3724, 3777); 343 | craft19(3725, 3779); 344 | craft19(3726, 3780); 345 | craft19(3727, 3781); 346 | craft19(3728, 3782); 347 | craft19(264, 3783); 348 | craft19(263, 3774); 349 | craft19(351, 3778, 4); 350 | craft19(3729, 3784); 351 | craft19(3730, 3776); 352 | craft19(3732, 3785); 353 | 354 | //金属粉合成小撮金属粉 355 | craft19(3521, 3581); 356 | craft19(3522, 3582); 357 | craft19(3523, 3583); 358 | craft19(3524, 3584); 359 | craft19(3525, 3585); 360 | craft19(3526, 3586); 361 | craft19(3527, 3587); 362 | craft19(3528, 3588); 363 | craft19(3529, 3589); 364 | craft19(3530, 3590); 365 | craft19(3531, 3591); 366 | craft19(3532, 3592); 367 | craft19(3533, 3593); 368 | craft19(3534, 3594); 369 | craft19(3535, 3595); 370 | craft19(3536, 3596); 371 | 372 | //金属粒变成金属锭 373 | craft91(3771, 3721); 374 | craft91(3772, 3722); 375 | craft91(3775, 3723); 376 | craft91(3777, 3724); 377 | craft91(3779, 3725); 378 | craft91(3780, 3726); 379 | craft91(3781, 3727); 380 | craft91(3782, 3728); 381 | craft91(3783, 264); 382 | craft91(3774, 263); 383 | craft91(3778, 351, 0, 4); 384 | craft91(3784, 3729); 385 | craft91(3785, 3732); 386 | 387 | //小撮金属粉合成金属粉 388 | craft91(3581, 3521); 389 | craft91(3582, 3522); 390 | craft91(3583, 3523); 391 | craft91(3584, 3524); 392 | craft91(3585, 3525); 393 | craft91(3586, 3526); 394 | craft91(3587, 3527); 395 | craft91(3588, 3528); 396 | craft91(3589, 3529); 397 | craft91(3590, 3530); 398 | craft91(3591, 3531); 399 | craft91(3592, 3532); 400 | craft91(3593, 3533); 401 | craft91(3594, 3534); 402 | craft91(3595, 3535); 403 | craft91(3596, 3536); 404 | 405 | //合金制造 406 | //3*铜粉 + 1*锡粉 = 4*青铜粉 407 | blockitem.addShapelessCraft(Java.to([ 408 | blockitem.buildItem(3532, 0, 1), 409 | blockitem.buildItem(3532, 0, 1), 410 | blockitem.buildItem(3532, 0, 1), 411 | blockitem.buildItem(3533, 0, 1) 412 | ], "cn.nukkit.item.Item[]"), blockitem.buildItem(3530, 0, 4)); 413 | //1*铬粉 + 1*锰粉 + 1*镍粉 + 6*铁粉 = 6*不锈钢粉 414 | blockitem.addShapelessCraft(Java.to([ 415 | blockitem.buildItem(3522, 0, 1), 416 | blockitem.buildItem(3526, 0, 1), 417 | blockitem.buildItem(3527, 0, 1), 418 | blockitem.buildItem(3531, 0, 1), 419 | blockitem.buildItem(3531, 0, 1), 420 | blockitem.buildItem(3531, 0, 1), 421 | blockitem.buildItem(3531, 0, 1), 422 | blockitem.buildItem(3531, 0, 1), 423 | blockitem.buildItem(3531, 0, 1), 424 | ], "cn.nukkit.item.Item[]"),blockitem.buildItem(3521, 0, 6)); 425 | //1*不锈钢锭 + 4*红石粉 = 1*磁化不锈钢锭 426 | blockitem.addShapelessCraft(Java.to([ 427 | blockitem.buildItem(3721, 0, 1), 428 | blockitem.buildItem(331, 0, 1), 429 | blockitem.buildItem(331, 0, 1), 430 | blockitem.buildItem(331, 0, 1), 431 | blockitem.buildItem(331, 0, 1), 432 | ], "cn.nukkit.item.Item[]"), blockitem.buildItem(3731, 0, 1)); 433 | //3*镍粉 + 1*铁粉 = 4*坡莫合金粉 434 | blockitem.addShapelessCraft(Java.to([ 435 | blockitem.buildItem(3527, 0, 1), 436 | blockitem.buildItem(3527, 0, 1), 437 | blockitem.buildItem(3527, 0, 1), 438 | blockitem.buildItem(3531, 0, 1), 439 | ], "cn.nukkit.item.Item[]"), blockitem.buildItem(3536, 0, 4)); 440 | 441 | //青金石板合成 442 | blockitem.addShapedCraft("AAA", blockitem.buildItem(3689, 0, 1), "A", blockitem.buildItem(351, 4, 1)); 443 | //导热片合成 444 | blockitem.addShapedCraft("ABA|ABA|ABA", blockitem.buildItem(3411, 0, 1), "A", blockitem.buildItem(3692, 0, 1), "B", blockitem.buildItem(3691, 0, 1)); 445 | //电动马达合成 446 | blockitem.addShapedCraft("AAC|APA|BAA", blockitem.buildItem(3412, 0, 1), "A", blockitem.buildItem(3693, 0, 1), "B", blockitem.buildItem(3641, 0, 1), "C", blockitem.buildItem(3731, 0, 1), "P", blockitem.buildItem(3657, 0, 1)); 447 | //铜线圈合成 448 | blockitem.addShapedCraft("AAA|ABA|AAA", blockitem.buildItem(3413, 0, 1), "A", blockitem.buildItem(3726, 0 ,1), "B", blockitem.buildItem(3731, 0, 1)); 449 | //光电板合成 450 | blockitem.addShapedCraft("AAA|BBB|CCC", blockitem.buildItem(3697, 0 ,1), "A", blockitem.buildItem(102, 0, 1), "B", blockitem.buildItem(3685, 0, 1), "C", blockitem.buildItem(3689, 0, 1)); 451 | 452 | /** 453 | * @description 注册齿轮合成 454 | */ 455 | blockitem.addShapedCraft("ABA|B B|ABA", blockitem.buildItem(3646, 0, 1), "A", blockitem.buildItem(143, 0, 1), "B", blockitem.buildItem(5, 0, 1)); 456 | blockitem.addShapedCraft("ABA|B B|ABA", blockitem.buildItem(3651, 0, 1), "A", blockitem.buildItem(77, 0, 1), "B", blockitem.buildItem(1, 0, 1)); 457 | 458 | /** 459 | * @description 注册锻造模板合成 460 | */ 461 | craft91(3691, 3409); 462 | 463 | /** 464 | * @description BN加载完成事件 465 | * @description 用于定义机器相关合成 466 | */ 467 | function BNInitializedEvent(/**@type {com.blocklynukkit.loader.script.event.BNInitializedEvent}*/event){ 468 | /** 469 | * @description 科技黎明铁砧合成模块 470 | */ 471 | const TechDawnMachineAnvil = require("TechDawnMachineAnvil"); 472 | /** 473 | * @description 添加科技黎明铁砧合成 474 | * @type {(input:int, output:int, damage:int) => void} 475 | */ 476 | const anvil = TechDawnMachineAnvil.addAnvilCraft; 477 | /** 478 | * @description 添加科技黎明需要齿轮锻造模板的铁砧合成 479 | * @type {(input:int, output:int, damage:int) => void} 480 | */ 481 | const anvilGear = TechDawnMachineAnvil.addAnvilGearCraft; 482 | //金属锭砸板 483 | anvil(3721, 3681, 15); 484 | anvil(3722, 3682, 15); 485 | anvil(266, 3683, 15); 486 | anvil(3723, 3686, 15); 487 | anvil(263, 3685, 15); 488 | anvil(3724, 3688, 15); 489 | anvil(3725, 3690, 15); 490 | anvil(3726, 3692, 15); 491 | anvil(265, 3691, 15); 492 | anvil(3727, 3693, 15); 493 | anvil(3728, 3694, 15); 494 | anvil(264, 3695, 15); 495 | anvil(3732, 3696, 15); 496 | //金属粒砸粉 497 | anvil(3771, 3581, 1); 498 | anvil(3772, 3582, 1); 499 | anvil(3773, 3584, 1); 500 | anvil(371, 3583, 1); 501 | anvil(3774, 3585, 1); 502 | anvil(3775, 3586, 1); 503 | anvil(3776, 3587 , 1); 504 | anvil(3777 ,3588 , 1); 505 | anvil(3778 ,3589 , 1); 506 | anvil(3779 ,3590 , 1); 507 | anvil(3780 ,3592 , 1); 508 | anvil(452 ,3591 , 1); 509 | anvil(3781 ,3593 , 1); 510 | anvil(3782 ,3594 , 1); 511 | anvil(3783 ,3595 , 1); 512 | anvil(3785, 3596, 1); 513 | //锻造模板转化 514 | anvil(3409, 3410, 24); 515 | anvil(3410, 3409, 24); 516 | //金属板砸齿轮 517 | anvilGear(3681, 3641, 15); 518 | anvilGear(3682, 3642, 15); 519 | anvilGear(3683, 3643, 15); 520 | anvilGear(3685, 3644, 15); 521 | anvilGear(3686, 3645, 15); 522 | anvilGear(3687, 3647, 15); 523 | anvilGear(3689, 3649, 15); 524 | anvilGear(3690, 3650, 15); 525 | anvilGear(3691, 3652, 15); 526 | anvilGear(3692, 3653, 15); 527 | anvilGear(3693, 3654, 15); 528 | anvilGear(3694, 3655, 15); 529 | anvilGear(3695, 3656, 15); 530 | anvilGear(3696, 3657 ,15); 531 | 532 | /** 533 | * @description 炼药锅洗练合成模块 534 | */ 535 | const TechDawnMachineCauldron = require("TechDawnMachineCauldron"); 536 | /** 537 | * @description 添加炼药锅洗练合成 538 | * @type {(input:int, output:int)=>void} 539 | */ 540 | const cauldron = TechDawnMachineCauldron.addCauldronCraft; 541 | //煤粒洗练为精煤粒 542 | cauldron(3774, 3784); 543 | } 544 | 545 | /** 546 | * @description 监听是否在没有启用黎明科技的世界中合成黎明科技物品 547 | */ 548 | function CraftItemEvent(/**@type {cn.nukkit.event.inventory.CraftItemEvent}*/event){ 549 | //该世界没有开启科技黎明取消合成 550 | if(!TechDawnConfig.isLevelEnabled(event.getPlayer().getLevel().getName())){ 551 | let id = event.getRecipe().getResult().getId(); 552 | if(id > 3350 && id < 3831){ 553 | event.setCancelled(); 554 | } 555 | } 556 | } 557 | -------------------------------------------------------------------------------- /src/items/TechDawn_machine.js: -------------------------------------------------------------------------------- 1 | //pragma js 2 | //pragma module TechDawnMachineItem 3 | 4 | /** 5 | * @author Superice666(超神的冰凉) 6 | * @copyright TechDawn_Project 7 | * @fileoverview 科技黎明插件机械物品模块 8 | */ 9 | 10 | /** 11 | * @description 所有注册过的物品 12 | * @type {{[key: string]: ItemInfo}} 13 | */ 14 | const items = {}; 15 | 16 | /** 17 | * @description 根据物品名获取物品信息 18 | * @param {string} name 19 | * @returns {ItemInfo} 20 | */ 21 | export function getMachineItemInfo(name){ 22 | return items[name]; 23 | } 24 | 25 | /** 26 | * @class 27 | * @classdesc 描述一个物品的信息 28 | * @constructor 29 | * @param {int} id 物品的id 30 | * @param {string} name 物品的名称 31 | * @param {string} eng 物品英文翻译名 32 | * @param {string} chn 物品中文翻译名 33 | * @param {string} texturePath 物品贴图路径 34 | * @param {string} stackSize 物品最大堆叠数量 35 | * @param {string} type 物品的种类:`construction` `nature` `equipment` `items` 36 | * @param {boolean} isDisplayAsTool 是否展示为工具 37 | * @param {boolean} canOnOffhand 副手装备 38 | */ 39 | function ItemInfo(id, name, eng, chn, texturePath, stackSize, type, isDisplayAsTool, canOnOffhand){ 40 | /** @description 物品的id */ 41 | this.id = id; 42 | /** @description 物品的名称 */ 43 | this.name = name; 44 | /** @description 物品的英文翻译名 */ 45 | this.eng = eng; 46 | /** @description 物品的中文翻译名 */ 47 | this.chn = chn; 48 | /** @description 物品的贴图路径 */ 49 | this.texturePath = texturePath; 50 | /** @description 物品的最大堆叠数量 */ 51 | this.stackSize = stackSize; 52 | /** @description 物品的种类:`construction` `nature` `equipment` `items` */ 53 | this.type = type; 54 | /** @description 是否展示为工具 */ 55 | this.isDisplayAsTool = isDisplayAsTool; 56 | /** @description 副手装备 */ 57 | this.canOnOffhand = canOnOffhand; 58 | //保存该物品 59 | items[name] = this; 60 | /** 61 | * @description 注册该类描述的物品并返回类自身 62 | */ 63 | this.register = function(){ 64 | blockitem.registerSimpleItem(this.id, this.name, this.stackSize, this.type, this.isDisplayAsTool, this.canOnOffhand); 65 | blockitem.addItemEnglishTranslation(this.id, this.eng); 66 | blockitem.addItemChineseTranslation(this.id, this.chn); 67 | blockitem.addItemTexture(this.id, this.texturePath); 68 | blockitem.addToCreativeBar(blockitem.buildItem(this.id, 0, 1)); 69 | return this; 70 | } 71 | } 72 | 73 | /** 74 | * @description 注册物品 75 | * @summary 3351-3400 机械 76 | * @summary 3401-3500 工具 77 | * @summary 3501-3520 粉碎矿石 78 | * @summary 3521-3580 矿物粉 79 | * @summary 3581-3640 小撮矿物粉 80 | * @summary 3641-3680 齿轮 81 | * @summary 3681-3720 金属板 82 | * @summary 3721-3770 金属锭 83 | * @summary 3771-3830 金属粒 84 | */ 85 | //注册火力发电机及其合成表 86 | new ItemInfo(3351, "fuel_generator", "Fuel Generator", "火力发电机", "./plugins/TechDawn/textures/火力发电机.png", 64, "construction", false, false).register(); 87 | /// | 铁板 | 铁板 | 铁板 | 88 | /// | 铁板 |不锈钢齿轮| 铁板 | 89 | /// | 铁板 | 熔炉 | 铁板 | 90 | blockitem.addShapedCraft("AAA|ABA|ACA|", blockitem.buildItem(3351, 0, 1), "A", blockitem.buildItem(3691, 0, 1), "B", blockitem.buildItem(3641, 0, 1), "C", blockitem.buildItem(61, 0, 1)); 91 | 92 | //注册红石电池箱及其合成表 93 | new ItemInfo(3352, "redstone_battery_box", "Redstone Battery Box", "红石电池箱", "./plugins/TechDawn/textures/红石电池箱.png", 64, "construction", false, false).register(); 94 | /// | 铁板 | 铁板 | 铁板 | 95 | /// |不锈钢齿轮| 红石块 |不锈钢齿轮| 96 | /// | 铁板 | 铁板 | 铁板 | 97 | blockitem.addShapedCraft("AAA|BCB|AAA", blockitem.buildItem(3352, 0, 1), "A", blockitem.buildItem(3691, 0, 1), "B", blockitem.buildItem(3641, 0, 1), "C", blockitem.buildItem(152, 0, 1)); 98 | 99 | //注册高炉及其合成表 100 | new ItemInfo(3353, "shaft_furnace", "Shaft Furnace", "高炉", "./plugins/TechDawn/textures/高炉.png", 64, "construction", false, false).register(); 101 | /// | 铁板 | 导热片 | 铁板 | 102 | /// | 导热片 | 红石块 | 导热片 | 103 | /// | 铁板 | 导热片 | 铁板 | 104 | blockitem.addShapedCraft("ABA|BCB|ABA", blockitem.buildItem(3353, 0, 1), "A", blockitem.buildItem(3691, 0, 1), "B", blockitem.buildItem(3411, 0, 1), "C", blockitem.buildItem(152, 0, 1)); 105 | 106 | //注册挖掘机及其合成表 107 | new ItemInfo(3354, "miner", "Miner", "挖掘机", "./plugins/TechDawn/textures/挖掘机.png", 64, "construction", false, false).register(); 108 | /// | 铁板 | 电动马达 | 铁板 | 109 | /// | 电动马达 | 红石块 | 电动马达 | 110 | /// | 铁板 | 铁镐 | 铁板 | 111 | blockitem.addShapedCraft("ABA|BCB|ADA", blockitem.buildItem(3354, 0, 1), "A", blockitem.buildItem(3691, 0, 1), "B", blockitem.buildItem(3412, 0, 1), "C", blockitem.buildItem(152, 0, 1), "D", blockitem.buildItem(257, 0, 1)); 112 | 113 | //注册农场管理机及其合成表 114 | new ItemInfo(3355, "farm_manager", "Farm Manager", "农场管理机", "./plugins/TechDawn/textures/农场管理机.png", 64, "construction", false, false).register(); 115 | /// | 铁板 | 铁锄 | 铁板 | 116 | /// | 铁板 | 红石块 | 铁板 | 117 | /// | 铁板 | 电动马达 | 铁板 | 118 | blockitem.addShapedCraft("ABA|ACA|ADA|", blockitem.buildItem(3355, 0, 1), "A", blockitem.buildItem(3691, 0, 1), "B", blockitem.buildItem(292, 0, 1), "C", blockitem.buildItem(152, 0, 1), "D", blockitem.buildItem(3412, 0, 1)); 119 | 120 | //注册电磁铁及其合成表 121 | new ItemInfo(3356, "electromagnet", "Electromagnet", "电磁铁", "./plugins/TechDawn/textures/电磁铁.png", 64, "construction", false, false).register(); 122 | /// | 铁板 | 铜线圈 | 铁板 | 123 | /// | 铜线圈 | 红石块 | 铜线圈 | 124 | /// | 铁板 | 铜线圈 | 铁板 | 125 | blockitem.addShapedCraft("ABA|BCB|ABA", blockitem.buildItem(3356, 0, 1), "A", blockitem.buildItem(3691, 0, 1), "B", blockitem.buildItem(3413, 0, 1), "C", blockitem.buildItem(152, 0, 1)); 126 | 127 | //注册太阳能发电机及其合成表 128 | new ItemInfo(3357, "solar_generator", "Solar Generator", "太阳能发电机", "./plugins/TechDawn/textures/太阳能发电机.png", 64, "construction", false, false).register(); 129 | /// | 光电板 | 光电板 | 光电板 | 130 | /// | 铁板 | 红石块 | 铁板 | 131 | /// | 铁板 | 铁板 | 铁板 | 132 | blockitem.addShapedCraft("GGG|ACA|AAA", blockitem.buildItem(3357, 0, 1), "A", blockitem.buildItem(3691, 0, 1), "G", blockitem.buildItem(3697, 0, 1), "C", blockitem.buildItem(152, 0, 1)); 133 | 134 | -------------------------------------------------------------------------------- /src/items/TechDawn_tool.js: -------------------------------------------------------------------------------- 1 | //pragma js 2 | //pragma module TechDawnTool 3 | 4 | /** 5 | * @author Superice666(超神的冰凉) 6 | * @copyright TechDawn_Project 7 | * @fileoverview 科技黎明插件工具模块 8 | */ 9 | 10 | /** 11 | * @description 配置文件模块 12 | */ 13 | const TechDawnConfig = require("TechDawnConfig"); 14 | 15 | /** 16 | * @description 所有注册过的工具 17 | * @type {{[key: string]: ToolInfo}} 18 | */ 19 | const tools = {}; 20 | 21 | /** 22 | * @description 根据物品名获取工具信息 23 | * @param {string} name 24 | * @returns {ToolInfo} 25 | */ 26 | export function getToolInfo(name){ 27 | return tools[name]; 28 | } 29 | 30 | /** 31 | * @class 32 | * @classdesc 描述一个工具的信息 33 | * @constructor 34 | * @param {int} id 工具的id 35 | * @param {string} name 工具的名称 36 | * @param {string} eng 工具英文翻译名 37 | * @param {string} chn 工具中文翻译名 38 | * @param {string} texturePath 工具贴图路径 39 | * @param {string} type 工具的种类:`sword` `shovel` `pickaxe` `axe` `hoe` 40 | * @param {int} tier 工具挖掘等级 0-空手,1-木,2-金,3-石,4-铁,5-钻石,6-下界合金 41 | * @param {int} durabillity 工具耐久值 42 | * @param {int} attackDamage 攻击伤害 43 | * @param {boolean} canOnOffhand 副手装备 44 | */ 45 | function ToolInfo(id, name, eng, chn, texturePath, type, tier, durabillity, attackDamage, canOnOffhand){ 46 | /** @description 工具的id */ 47 | this.id = id; 48 | /** @description 工具的名称 */ 49 | this.name = name; 50 | /** @description 工具的英文翻译名 */ 51 | this.eng = eng; 52 | /** @description 工具的中文翻译名 */ 53 | this.chn = chn; 54 | /** @description 工具的贴图路径 */ 55 | this.texturePath = texturePath; 56 | /** @description 工具的种类:`sword` `shovel` `pickaxe` `axe` `hoe` */ 57 | this.type = type; 58 | /** @description 工具挖掘等级 0-空手,1-木,2-金,3-石,4-铁,5-钻石,6-下界合金 */ 59 | this.tier = tier; 60 | /** @description 工具耐久值 */ 61 | this.durabillity = durabillity; 62 | /** @description 攻击伤害 */ 63 | this.attackDamage = attackDamage; 64 | /** @description 副手装备 */ 65 | this.canOnOffhand = canOnOffhand; 66 | //保存该物品 67 | tools[name] = this; 68 | /** 69 | * @description 注册该类描述的工具并返回类自身 70 | */ 71 | this.register = function(){ 72 | blockitem.registerToolItem(this.id, this.name, this.type, this.tier, this.durabillity, this.attackDamage, this.canOnOffhand); 73 | blockitem.addItemEnglishTranslation(this.id, this.eng); 74 | blockitem.addItemChineseTranslation(this.id, this.chn); 75 | blockitem.addItemTexture(this.id, this.texturePath); 76 | blockitem.addToCreativeBar(blockitem.buildItem(this.id, 0, 1)); 77 | return this; 78 | } 79 | } 80 | 81 | /** 82 | * @description 注册工具 83 | */ 84 | new ToolInfo(3401, "panning_bowl", "Panning Bowl", "淘金碗", "./plugins/TechDawn/textures/淘金碗.png", "shovel", 3, 64, 2, true).register(); 85 | //3402 空木桶 86 | //3403 装水木桶 87 | new ToolInfo(3404, "stainless_steel_hammer", "Stainless Steel Hammer", "不锈钢锤子", "./plugins/TechDawn/textures/不锈钢锤子.png", "pickaxe", 5, 3800, 8, false).register(); 88 | new ToolInfo(3405, "diamond_hammer", "Diamond Hammer", "钻石锤子", "./plugins/TechDawn/textures/钻石锤子.png", "pickaxe", 5, 2780, 7, false).register(); 89 | new ToolInfo(3406, "iron_hammer", "Iron Hammer", "铁锤子", "./plugins/TechDawn/textures/铁锤子.png", "pickaxe", 4, 500, 6, false).register(); 90 | new ToolInfo(3407, "stone_hammer", "Stone Hammer", "石锤子", "./plugins/TechDawn/textures/石锤子.png", "pickaxe", 3, 120, 5, false).register(); 91 | new ToolInfo(3408, "wood_hammer", "Wood Hammer", "木锤子", "./plugins/TechDawn/textures/木锤子.png", "pickaxe", 1, 40, 4, false).register(); 92 | /** 93 | * @description 添加工具合成表 94 | */ 95 | //淘金碗 96 | blockitem.addShapedCraft("A A|AAA", blockitem.buildItem(3401, 0, 1), "A", blockitem.buildItem(1, 0, 1)); 97 | //木桶 98 | blockitem.addShapedCraft("A A|A A| A ", blockitem.buildItem(3402, 0, 1), "A", blockitem.buildItem(5, 0, 1)); 99 | blockitem.addShapedCraft("A A|A A| A ", blockitem.buildItem(3402, 0, 1), "A", blockitem.buildItem(5, 1, 1)); 100 | blockitem.addShapedCraft("A A|A A| A ", blockitem.buildItem(3402, 0, 1), "A", blockitem.buildItem(5, 2, 1)); 101 | blockitem.addShapedCraft("A A|A A| A ", blockitem.buildItem(3402, 0, 1), "A", blockitem.buildItem(5, 3, 1)); 102 | blockitem.addShapedCraft("A A|A A| A ", blockitem.buildItem(3402, 0, 1), "A", blockitem.buildItem(5, 4, 1)); 103 | blockitem.addShapedCraft("A A|A A| A ", blockitem.buildItem(3402, 0, 1), "A", blockitem.buildItem(5, 5, 1)); 104 | //木锤子 105 | blockitem.addShapedCraft("AAA|ABA| B ", blockitem.buildItem(3408, 0, 1), "A", blockitem.buildItem(5, 0, 1), "B", blockitem.buildItem(280, 0, 1)); 106 | blockitem.addShapedCraft("AAA|ABA| B ", blockitem.buildItem(3408, 0, 1), "A", blockitem.buildItem(5, 1, 1), "B", blockitem.buildItem(280, 0, 1)); 107 | blockitem.addShapedCraft("AAA|ABA| B ", blockitem.buildItem(3408, 0, 1), "A", blockitem.buildItem(5, 2, 1), "B", blockitem.buildItem(280, 0, 1)); 108 | blockitem.addShapedCraft("AAA|ABA| B ", blockitem.buildItem(3408, 0, 1), "A", blockitem.buildItem(5, 3, 1), "B", blockitem.buildItem(280, 0, 1)); 109 | blockitem.addShapedCraft("AAA|ABA| B ", blockitem.buildItem(3408, 0, 1), "A", blockitem.buildItem(5, 4, 1), "B", blockitem.buildItem(280, 0, 1)); 110 | blockitem.addShapedCraft("AAA|ABA| B ", blockitem.buildItem(3408, 0, 1), "A", blockitem.buildItem(5, 5, 1), "B", blockitem.buildItem(280, 0, 1)); 111 | //石锤子 112 | blockitem.addShapedCraft("AAA|ABA| B ", blockitem.buildItem(3407, 0, 1), "A", blockitem.buildItem(4, 0, 1), "B", blockitem.buildItem(280, 0, 1)); 113 | //铁锤子 114 | blockitem.addShapedCraft("AAA|ABA| B ", blockitem.buildItem(3406, 0, 1), "A", blockitem.buildItem(265, 0, 1), "B", blockitem.buildItem(280, 0, 1)); 115 | //钻石锤子 116 | blockitem.addShapedCraft("AAA|ABA| B ", blockitem.buildItem(3405, 0, 1), "A", blockitem.buildItem(264, 0, 1), "B", blockitem.buildItem(280, 0, 1)); 117 | //不锈钢锤子 118 | blockitem.addShapedCraft("AAA|ABA| B ", blockitem.buildItem(3408, 0, 1), "A", blockitem.buildItem(3721, 0, 1), "B", blockitem.buildItem(280, 0, 1)); 119 | 120 | /** 121 | * @description 获取淘金结果模块 122 | * @description 因为我们在编译脚本中确定的顺序保证了TechDawnLoot_Panning模块一定优先加载,所以可以直接导入 123 | */ 124 | const lootPanning = require("TechDawnLootPanning"); 125 | 126 | /** 127 | * @description 破坏方块事件 128 | */ 129 | function BlockBreakEvent(/**@type {cn.nukkit.event.block.BlockBreakEvent}*/event){ 130 | const iid = event.getItem().getId(); 131 | const bid = event.getBlock().getId(); 132 | //处理淘金碗 133 | if(iid == 3401 && (bid == 12 || bid == 13)){ 134 | let item = lootPanning.getPanningResult(event.getBlock().getId() == 12); 135 | event.setDrops(Java.to([item], "cn.nukkit.item.Item[]")); 136 | } 137 | //锤子挖石头掉沙砾,挖沙砾掉沙子 138 | else if(iid >= 3404 && iid <= 3408){ 139 | if(bid == 4 || bid == 1){ 140 | event.setDrops(Java.to([blockitem.buildItem(13, 0, 1)], "cn.nukkit.item.Item[]")); 141 | }else if(bid == 13){ 142 | event.setDrops(Java.to([blockitem.buildItem(12, 0, 1)], "cn.nukkit.item.Item[]")); 143 | } 144 | } 145 | } 146 | 147 | /** 148 | * @description 玩家右键事件 149 | */ 150 | function RightClickBlockEvent(/**@type {cn.nukkit.event.player.PlayerInteractEvent}*/event){ 151 | //该世界没有开启科技黎明直接忽略 152 | if(!TechDawnConfig.isLevelEnabled(event.getPlayer().getLevel().getName())) return; 153 | const iid = event.getItem().getId(); 154 | //玩家使用空木桶装水 155 | if(iid == 3402){ 156 | let backWardBlock = event.getBlock().add(event.getFace().getUnitVector()).getLevelBlock(); 157 | if((backWardBlock.getId() == 8 || backWardBlock.getId() == 9) && backWardBlock.getDamage() == 0){ 158 | blockitem.setBlock(backWardBlock, blockitem.buildBlock(0, 0), false); 159 | blockitem.blockUpdate(backWardBlock); 160 | blockitem.makeSound(backWardBlock, "BUCKET_FILL_WATER"); 161 | blockitem.removeItemToPlayer(event.getPlayer(), blockitem.buildItem(3402, 0 ,1)); 162 | blockitem.addItemToPlayer(event.getPlayer(), blockitem.buildItem(3403, 0, 1)); 163 | } 164 | } 165 | //玩家使用装水木桶放水 166 | else if(iid == 3403){ 167 | //玩家给炼药锅装水 168 | if(event.getBlock().getId() == 118){ 169 | if(event.getBlock().getDamage() != 6){ 170 | event.getBlock().setDamage(6); 171 | blockitem.setBlock(event.getBlock(), event.getBlock(), false); 172 | blockitem.makeSound(event.getBlock(), "CAULDRON_FILLWATER"); 173 | blockitem.removeItemToPlayer(event.getPlayer(), blockitem.buildItem(3403, 0 ,1)); 174 | blockitem.addItemToPlayer(event.getPlayer(), blockitem.buildItem(3402, 0, 1)); 175 | } 176 | }else{ 177 | //把水倒在地上 178 | let backWardBlock = event.getBlock().add(event.getFace().getUnitVector()).getLevelBlock(); 179 | if(backWardBlock.getId() == 0 || backWardBlock.getId() == 8){ 180 | blockitem.setBlock(backWardBlock, blockitem.buildBlock(8, 0), false); 181 | blockitem.blockUpdate(backWardBlock); 182 | blockitem.makeSound(backWardBlock, "BUCKET_EMPTY_WATER"); 183 | blockitem.removeItemToPlayer(event.getPlayer(), blockitem.buildItem(3403, 0 ,1)); 184 | blockitem.addItemToPlayer(event.getPlayer(), blockitem.buildItem(3402, 0, 1)); 185 | } 186 | } 187 | } 188 | } 189 | -------------------------------------------------------------------------------- /src/loot/TechDawn_lootPanning.js: -------------------------------------------------------------------------------- 1 | //pragma js 2 | //pragma module TechDawnLootPanning 3 | 4 | /** 5 | * @author Superice666(超神的冰凉) 6 | * @copyright TechDawn_Project 7 | * @fileoverview 科技黎明插件主模块 8 | */ 9 | 10 | /** 11 | * @description 获取淘金结果 12 | * @param {boolean} sandOrGravel 13 | * @returns {cn.nukkit.item.Item} 14 | */ 15 | export function getPanningResult(sandOrGravel){ 16 | return sandOrGravel ? getSandPanningResult() : getGravelPanningResult(); 17 | } 18 | 19 | //概率定义 20 | const RandomItem = cn.nukkit.item.randomitem.RandomItem; 21 | const Selector = cn.nukkit.item.randomitem.Selector; 22 | const ConstantItemSelector = cn.nukkit.item.randomitem.ConstantItemSelector; 23 | const root_sandPanning = RandomItem.putSelector(new Selector(RandomItem.ROOT)); 24 | const root_gravelPanning = RandomItem.putSelector(new Selector(RandomItem.ROOT)); 25 | //添加沙子淘金概率 26 | RandomItem.putSelector(new ConstantItemSelector(3506, root_sandPanning), 0.004);//绿宝石 27 | RandomItem.putSelector(new ConstantItemSelector(3513, root_sandPanning), 0.0015);//钻石 28 | RandomItem.putSelector(new ConstantItemSelector(3514, root_sandPanning), 0.09);//红石 29 | RandomItem.putSelector(new ConstantItemSelector(3515, root_sandPanning), 0.08);//青金石 30 | RandomItem.putSelector(new ConstantItemSelector(3507, root_sandPanning), 0.3);//煤炭 31 | RandomItem.putSelector(new ConstantItemSelector(3508, root_sandPanning), 0.04);//铁 32 | RandomItem.putSelector(new ConstantItemSelector(3501, root_sandPanning), 0.055);//磁铁 33 | RandomItem.putSelector(new ConstantItemSelector(3503, root_sandPanning), 0.02);//金 34 | //添加沙砾淘金概率 35 | RandomItem.putSelector(new ConstantItemSelector(3501, root_gravelPanning), 0.07);//磁铁 36 | RandomItem.putSelector(new ConstantItemSelector(3508, root_gravelPanning), 0.06);//铁 37 | RandomItem.putSelector(new ConstantItemSelector(3502, root_gravelPanning), 0.03);//方铅 38 | RandomItem.putSelector(new ConstantItemSelector(3503, root_gravelPanning), 0.015);//金 39 | RandomItem.putSelector(new ConstantItemSelector(3504, root_gravelPanning), 0.07);//孔雀石 40 | RandomItem.putSelector(new ConstantItemSelector(3505, root_gravelPanning), 0.015);//铝 41 | RandomItem.putSelector(new ConstantItemSelector(3507, root_gravelPanning), 0.07);//煤 42 | RandomItem.putSelector(new ConstantItemSelector(3509, root_gravelPanning), 0.055);//铜 43 | RandomItem.putSelector(new ConstantItemSelector(3510, root_gravelPanning), 0.06);//锡 44 | RandomItem.putSelector(new ConstantItemSelector(3511, root_gravelPanning), 0.05);//铅 45 | RandomItem.putSelector(new ConstantItemSelector(3512, root_gravelPanning), 0.005);//银 46 | RandomItem.putSelector(new ConstantItemSelector(3513, root_gravelPanning), 0.002);//钻石 47 | RandomItem.putSelector(new ConstantItemSelector(3515, root_gravelPanning), 0.012);//青金石 48 | RandomItem.putSelector(new ConstantItemSelector(3516, root_gravelPanning), 0.016);//镍 49 | RandomItem.putSelector(new ConstantItemSelector(3517, root_gravelPanning), 0.01);//铬 50 | RandomItem.putSelector(new ConstantItemSelector(3518, root_gravelPanning), 0.015);//锰 51 | RandomItem.putSelector(new ConstantItemSelector(318, root_gravelPanning), 0.445);//燧石 52 | //通过反射api调用选择方法 53 | const Clazz = java.lang.Class; 54 | let Rclazz = Clazz.forName("cn.nukkit.item.randomitem.RandomItem"); 55 | let Sclazz = Clazz.forName("cn.nukkit.item.randomitem.Selector"); 56 | var method = Rclazz.getDeclaredMethod("selectFrom", Sclazz); 57 | method.setAccessible(true); 58 | /** 59 | * @description 获取选择结果 60 | * @param from 从哪里选择 61 | */ 62 | function getSelectResult(from){ 63 | return method.invoke(Rclazz, from); 64 | } 65 | 66 | /** 67 | * @description 获取沙子淘金结果 68 | * @returns {cn.nukkit.item.Item} 69 | */ 70 | function getSandPanningResult(){ 71 | if(Math.random() < 0.5) return blockitem.buildItem(0, 0, 0); 72 | let result = getSelectResult(root_sandPanning); 73 | if(result == null) return blockitem.buildItem(0, 0, 0); 74 | return (result instanceof require("cn.nukkit.item.Item")) ? result : blockitem.buildItem(0, 0, 0); 75 | } 76 | 77 | /** 78 | * @description 获取沙砾淘金结果 79 | * @returns {cn.nukkit.item.Item} 80 | */ 81 | function getGravelPanningResult(){ 82 | if(Math.random() < 0.5) return blockitem.buildItem(0, 0, 0); 83 | let result = getSelectResult(root_gravelPanning); 84 | if(result == null) return blockitem.buildItem(0, 0, 0); 85 | return (result instanceof require("cn.nukkit.item.Item")) ? result : blockitem.buildItem(0, 0, 0); 86 | } -------------------------------------------------------------------------------- /src/machine/TechDawn_anvil.js: -------------------------------------------------------------------------------- 1 | //pragma js 2 | //pragma module TechDawnMachineAnvil 3 | 4 | /** 5 | * @author Superice666(超神的冰凉) 6 | * @copyright TechDawn_Project 7 | * @fileoverview 科技黎明插件铁砧模块 8 | */ 9 | 10 | /** 11 | * @description 配置文件模块 12 | */ 13 | const TechDawnConfig = require("TechDawnConfig"); 14 | 15 | /** 16 | * @description 获取时间函数 17 | */ 18 | const mills = java.lang.System.currentTimeMillis; 19 | 20 | /** 21 | * @description 记录玩家触摸时间,防止刷物品 22 | * @type {{[key: string]: long}} 23 | */ 24 | const playerTouchedTime = {}; 25 | 26 | /** 27 | * @description 记录铁砧对应的物品 28 | */ 29 | const anvilItem = new com.blocklynukkit.loader.other.data.MemoryStorage(); 30 | 31 | /** 32 | * @description 记录科技黎明铁砧合成 33 | * @type {{[key: string]: {outputId: int, toolDamage: int, gear: boolean}}} 34 | */ 35 | const anvilCraft = {}; 36 | 37 | /** 38 | * @description 添加科技黎明铁砧合成 39 | * @param {int} input 40 | * @param {int} output 41 | * @param {int} damage 此次合成消耗锤子的耐久 42 | */ 43 | export function addAnvilCraft(input, output, damage){ 44 | anvilCraft[String(input)] = {outputId: output, toolDamage: damage, gear: false}; 45 | } 46 | 47 | /** 48 | * @description 添加科技黎明需要齿轮锻造模板的铁砧合成 49 | * @param {int} input 50 | * @param {int} output 51 | * @param {int} damage 此次合成消耗锤子的耐久 52 | */ 53 | export function addAnvilGearCraft(input, output, damage){ 54 | anvilCraft[String(input)] = {outputId: output, toolDamage: damage, gear: true}; 55 | } 56 | 57 | /** 58 | * @description 处理铁砧潜行合成 59 | */ 60 | function RightClickBlockEvent(/**@type {cn.nukkit.event.player.PlayerInteractEvent}*/event){ 61 | //玩家操作间隔太小直接忽略 62 | if(playerTouchedTime[event.getPlayer().getName()] != null && mills() - playerTouchedTime[event.getPlayer().getName()] < 200) return; 63 | //该世界没有开启科技黎明直接忽略 64 | if(!TechDawnConfig.isLevelEnabled(event.getPlayer().getLevel().getName())) return; 65 | //玩家不潜行直接不处理 66 | if(!event.getPlayer().isSneaking()) return; 67 | //处理铁砧放置物品 68 | if(event.getBlock().getId() == 145){ 69 | let tmpItem = event.getItem().clone(); 70 | let upPos = event.getBlock().add(0.5, 1, 0.5); 71 | tmpItem.setCount(1); 72 | blockitem.removeItemToPlayer(event.getPlayer(), tmpItem); 73 | let previousStore = anvilItem[event.getBlock()]; 74 | if(previousStore != null){ 75 | //去掉上面显示的物品 76 | entity.removeFloatingItem(upPos, previousStore); 77 | //防止玩家打开铁砧 78 | event.setCancelled(); 79 | //如果玩家手里拿的是锤子 80 | if(tmpItem.getId() >= 3404 && tmpItem.getId() <= 3408){ 81 | //查找是否有对应的合成 82 | let currentCraft = anvilCraft[String(previousStore.getId())]; 83 | //找到了对应的合成 84 | if(currentCraft != null){ 85 | //如果需要齿轮锻造模板 86 | if(currentCraft.gear == true){ 87 | //玩家副手里没有齿轮锻造模板 88 | if(inventory.getEntityItemInOffHand(event.getPlayer()).getId() != 3410){ 89 | //掉落上面的物品 90 | blockitem.makeDropItem(upPos, previousStore); 91 | //把锤子放到上面去 92 | anvilItem[event.getBlock()] = tmpItem; 93 | entity.showFloatingItem(upPos, tmpItem); 94 | //记录玩家上次操作时间 95 | playerTouchedTime[event.getPlayer().getName()] = mills(); 96 | return; 97 | } 98 | } 99 | //执行响应合成操作 100 | let resultItem = blockitem.buildItem(currentCraft.outputId, 0, 1); 101 | anvilItem[event.getBlock()] = resultItem; 102 | entity.showFloatingItem(upPos, resultItem); 103 | //显示粒子效果 104 | for(let _i=0;_i<5;_i++){ 105 | particle.drawDot(upPos.add(Math.random()*0.3 , 0.5 + Math.random()*0.3, Math.random()*0.3), 9); 106 | } 107 | //播放使用声音 108 | blockitem.makeSound(upPos, "RANDOM_ANVIL_USE"); 109 | //玩家手里锤子掉耐久 110 | let hammer = event.getItem(); 111 | hammer.setDamage(hammer.getDamage() + currentCraft.toolDamage); 112 | if(hammer.getDamage() > hammer.getMaxDurability()){ 113 | inventory.setEntityItemInHand(event.getPlayer(), blockitem.buildItem(0,0,1)); 114 | blockitem.makeSound(upPos, "RANDOM_BREAK"); 115 | }else{ 116 | inventory.setEntityItemInHand(event.getPlayer(), hammer); 117 | } 118 | //记录玩家上次操作时间 119 | playerTouchedTime[event.getPlayer().getName()] = mills(); 120 | return; 121 | } 122 | } 123 | //掉落上面的物品 124 | blockitem.makeDropItem(upPos, previousStore); 125 | }else if(tmpItem.getId() == 0){ 126 | //玩家空手取下物品,不能让玩家打开铁砧 127 | event.setCancelled(); 128 | } 129 | anvilItem[event.getBlock()] = tmpItem; 130 | entity.showFloatingItem(upPos, tmpItem); 131 | } 132 | //记录玩家上次操作时间 133 | playerTouchedTime[event.getPlayer().getName()] = mills(); 134 | } 135 | 136 | /** 137 | * @description 铁砧被打掉时掉落物品 138 | */ 139 | function BlockBreakEvent(/**@type {cn.nukkit.event.block.BlockBreakEvent}*/event){ 140 | //该世界没有开启科技黎明直接忽略 141 | if(!TechDawnConfig.isLevelEnabled(event.getPlayer().getLevel().getName())) return; 142 | //不是铁砧直接忽略 143 | if(event.getBlock().getId() == 145){ 144 | let upPos = event.getBlock().add(0.5, 1, 0.5); 145 | let storedItem = anvilItem.getItem(event.getBlock()); 146 | //如果有储存的物品就掉落物品 147 | if(storedItem != null){ 148 | blockitem.makeDropItem(upPos, storedItem); 149 | entity.removeFloatingItem(upPos, storedItem); 150 | anvilItem.removeItem(event.getBlock()); 151 | } 152 | } 153 | } 154 | 155 | /** 156 | * @description 当插件关闭时,铁砧掉落上面的物品 157 | */ 158 | function BNClosedEvent(/**@type {com.blocklynukkit.loader.script.event.BNClosedEvent}*/event){ 159 | for(let entry of anvilItem.entrySet()){ 160 | if(entry.getValue().getId() != 0){ 161 | blockitem.makeDropItem(entry.getKey().add(0.5, 1, 0.5), entry.getValue()); 162 | entity.removeFloatingItem(entry.getKey().add(0.5, 1, 0.5), entry.getValue()); 163 | } 164 | } 165 | } 166 | -------------------------------------------------------------------------------- /src/machine/TechDawn_cauldron.js: -------------------------------------------------------------------------------- 1 | //pragma js 2 | //pragma module TechDawnMachineCauldron 3 | 4 | /** 5 | * @author Superice666(超神的冰凉) 6 | * @copyright TechDawn_Project 7 | * @fileoverview 科技黎明插件炼药锅模块 8 | */ 9 | 10 | /** 11 | * @description 配置文件模块 12 | */ 13 | const TechDawnConfig = require("TechDawnConfig"); 14 | 15 | /** 16 | * @description 炼药锅洗练合成表 17 | * @type {{[key: string]: {output: int, needWater: boolean}}} 18 | */ 19 | const cauldronCraft = {}; 20 | 21 | /** 22 | * @description 添加炼药锅洗练合成 23 | * @param {int} input 24 | * @param {int} output 25 | */ 26 | export function addCauldronCraft(input, output){ 27 | cauldronCraft[String(input)] = {output: output, needWater: true}; 28 | } 29 | 30 | /** 31 | * @description 处理炼药锅洗练合成 32 | */ 33 | function RightClickBlockEvent(/**@type {cn.nukkit.event.player.PlayerInteractEvent}*/event){ 34 | //该世界没有开启科技黎明直接忽略 35 | if(!TechDawnConfig.isLevelEnabled(event.getPlayer().getLevel().getName())) return; 36 | if(event.getBlock().getId() != 118){ 37 | return; 38 | } 39 | let tmpItem = event.getItem().clone(); 40 | tmpItem.setCount(1); 41 | let currentCraft = cauldronCraft[String(tmpItem.getId())]; 42 | if(currentCraft != null){ 43 | if(currentCraft.needWater && cauldronHasWater(event.getBlock())){ 44 | blockitem.removeItemToPlayer(event.getPlayer(), tmpItem); 45 | blockitem.makeDropItem(event.getBlock().add(0.5, 0.5, 0.5), blockitem.buildItem(currentCraft.output, 0, 1)); 46 | cauldronLessWater(event.getBlock()); 47 | blockitem.makeSound(event.getBlock(), "LIQUID_WATER"); 48 | } 49 | } 50 | } 51 | 52 | /** 53 | * @description 判断炼药锅是否有水 54 | * @param {cn.nukkit.block.Block} block 炼药锅方块 55 | */ 56 | function cauldronHasWater(block){ 57 | return block.getDamage() > 0; 58 | } 59 | 60 | /** 61 | * @description 减少炼药锅中的水 62 | * @param {cn.nukkit.block.Block} block 炼药锅方块 63 | */ 64 | function cauldronLessWater(block){ 65 | if(cauldronHasWater(block)){ 66 | block.setDamage(block.getDamage() - 1); 67 | blockitem.setBlock(block, block, false); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/machine/TechDawn_electromagnet.js: -------------------------------------------------------------------------------- 1 | //pragma js 2 | //pragma module TechDawnElectromagnet 3 | 4 | /** 5 | * @author Superice666(超神的冰凉) 6 | * @copyright TechDawn_Project 7 | * @fileoverview 科技黎明插件电磁铁模块 8 | */ 9 | 10 | /** 11 | * @description 耗电扩倍 12 | */ 13 | const RFPerRange = 0.5; 14 | 15 | /** 16 | * @description 获取时间函数 17 | */ 18 | const mills = java.lang.System.currentTimeMillis; 19 | 20 | /** 21 | * @description 能源模块 22 | */ 23 | const TechDawnMachinePower = require("TechDawnMachinePower"); 24 | 25 | /** 26 | * @description 配置文件模块 27 | */ 28 | const TechDawnConfig = require("TechDawnConfig"); 29 | 30 | /** 31 | * @description 翻译模块 32 | */ 33 | const TechDawnTranslate = require("TechDawnTranslate"); 34 | 35 | /** 36 | * @description 记录玩家触摸时间,防止刷物品 37 | * @type {{[key: string]: long}} 38 | */ 39 | const playerTouchedTime = {}; 40 | 41 | /** 42 | * @description 放置电磁铁 43 | * @param {cn.nukkit.level.Position} pos 44 | * @param {cn.nukkit.Player} player 放置的玩家,如果非玩家放置传入null 45 | * @param {{x: number,y: number,z: number,level: string,yaw: number,pitch: number, dataStroage: Object}} data 非玩家放置时传入的还原信息 46 | */ 47 | export function place(pos, player, data) { 48 | pos.getLevel().loadChunk(pos.getChunkX(), pos.getChunkZ()); 49 | let model = entity.buildModel(pos, "electromagnet", 1, 1, 1, 1, F((self, tick) => { 50 | //每刻吸引一次附近物品 51 | //该世界没有开启科技黎明直接忽略 52 | if (!TechDawnConfig.isLevelEnabled(self.getLevel().getName())) return; 53 | //检测是否有足够的电 54 | let storage = self.dataStorage.getItem("storage"); 55 | if (storage < getRFCost(self)) { 56 | return; 57 | } 58 | //减去本次工作耗电,4次工作扣一次电 59 | if (!(tick & 7)) { 60 | self.dataStorage.setItem("storage", storage - getRFCost(self)); 61 | } 62 | manager.concurrentRun(F((self) => { 63 | //吸引周围物品 64 | const range = self.dataStorage.getItem("range"); 65 | /** @type {cn.nukkit.entity.item.EntityItem[]} */ 66 | const itemEntites = []; 67 | for (let i = -1; i <= 1; i++) { 68 | for (let j = -1; j <= 1; j++) { 69 | for (let each of self.getPosition().add(i * 16, 0, j * 16).getChunk().getEntities().values()) { 70 | if (each instanceof cn.nukkit.entity.item.EntityItem && each.distance(self) < range) { 71 | itemEntites.push(each); 72 | } 73 | } 74 | } 75 | } 76 | let dtmp; 77 | let dlen; 78 | for (let ccc of itemEntites) { 79 | /** @type {cn.nukkit.entity.item.EntityItem} */ 80 | let each = ccc; 81 | dtmp = each.getPosition().add(self.getPosition().multiply(-1)); 82 | dlen = 1 / dtmp.length(); 83 | if(dlen > 2.5){ 84 | continue; 85 | } 86 | dtmp = dtmp.multiply(dlen).multiply(dlen + 0.08).multiply(-0.2); 87 | each.move(dtmp.x, dtmp.y, dtmp.z); 88 | } 89 | }), self); 90 | }), 1, F((self, damageEvent) => { 91 | //如果被奇奇怪怪的东西伤害就爆炸 92 | if (!(damageEvent instanceof cn.nukkit.event.entity.EntityDamageByEntityEvent) || !entity.isPlayer(damageEvent.getDamager())) { 93 | particle.drawEmitter(self, "minecraft:huge_explosion_emitter"); 94 | blockitem.makeSound(self, "RANDOM_EXPLODE"); 95 | destroy(self); 96 | return; 97 | } 98 | let tmpItem = inventory.getEntityItemInHand(damageEvent.getDamager()); 99 | //检测手里是不是锤子 100 | if (tmpItem.getId() >= 3404 && tmpItem.getId() <= 3408) { 101 | blockitem.makeDropItem(self, blockitem.buildItem(3356, 0, 1)); 102 | destroy(self); 103 | //锤子掉耐久 104 | let hammer = tmpItem; 105 | hammer.setDamage(hammer.getDamage() + 2); 106 | if (hammer.getDamage() > hammer.getMaxDurability()) { 107 | inventory.setEntityItemInHand(damageEvent.getDamager(), blockitem.buildItem(0, 0, 1)); 108 | blockitem.makeSound(self, "USE_STONE"); 109 | } else { 110 | inventory.setEntityItemInHand(damageEvent.getDamager(), hammer); 111 | } 112 | } 113 | }), F((self, player, item, pos) => { 114 | window.getCustomWindowBuilder(TechDawnTranslate.translate("electromagnet_title")) 115 | .buildStepSlider(TechDawnTranslate.translate("electromagnet_slider_title"), "3r;5r;7r;9r;11r;13r", (self.dataStorage.getItem("range") - 1) / 2 - 1) 116 | .action(F(event => { 117 | switch (event.getResult()) { 118 | case "3r": 119 | self.dataStorage.setItem("range", 3); break; 120 | case "5r": 121 | self.dataStorage.setItem("range", 5); break; 122 | case "7r": 123 | self.dataStorage.setItem("range", 7); break; 124 | case "9r": 125 | self.dataStorage.setItem("range", 9); break; 126 | case "11r": 127 | self.dataStorage.setItem("range", 11); break; 128 | case "13r": 129 | self.dataStorage.setItem("range", 13); break; 130 | } 131 | const range = self.dataStorage.getItem("range"); 132 | particle.drawCircle(self.add(0, 0.5, 0), range, 40, 2); 133 | })) 134 | .show(player); 135 | })); 136 | require("TechDawnSaver").addMachine(model); 137 | if (data) { 138 | model.setYaw(data.yaw); 139 | model.setPitch(data.pitch); 140 | for (let key in data.dataStorage) { 141 | model.dataStorage.setItem(key, data.dataStorage[key]); 142 | } 143 | } else { 144 | let yaw = player.getYaw() + 180; 145 | model.setYaw(yaw > 360 ? yaw - 360 : yaw); 146 | model.setPitch(0); 147 | model.dataStorage.setItem("techDawn", true); 148 | model.dataStorage.setItem("name", "electromagnet"); 149 | model.dataStorage.setItem("storage", 0); 150 | model.dataStorage.setItem("maxStorage", 240); 151 | model.dataStorage.setItem("mode", "I"); 152 | model.dataStorage.setItem("maxAccept", 20); 153 | model.dataStorage.setItem("range", 7); 154 | } 155 | } 156 | 157 | /** 158 | * @description 获取电磁铁单次消耗电量 159 | * @param {com.blocklynukkit.loader.other.Entities.BNModel} model 160 | */ 161 | function getRFCost(model) { 162 | return (model.dataStorage.getItem("range") - 1) * RFPerRange; 163 | } 164 | 165 | /** 166 | * @description 销毁电磁铁 167 | * @param {com.blocklynukkit.loader.other.Entities.BNModel} model 168 | */ 169 | export function destroy(model) { 170 | require("TechDawnSaver").removeMachine(model); 171 | model.close(); 172 | } 173 | 174 | function RightClickBlockEvent(/**@type {cn.nukkit.event.player.PlayerInteractEvent}*/event) { 175 | //玩家操作间隔太小直接忽略 176 | if (playerTouchedTime[event.getPlayer().getName()] != null && mills() - playerTouchedTime[event.getPlayer().getName()] < 200) return; 177 | //该世界没有开启科技黎明直接忽略 178 | if (!TechDawnConfig.isLevelEnabled(event.getPlayer().getLevel().getName())) return; 179 | //放置电磁铁 180 | let player = event.getPlayer(); 181 | if (event.getItem().getId() != 3356) { 182 | return; 183 | } 184 | //放置电磁铁 185 | place((event.getBlock().getId() == 55 ? event.getBlock() : event.getBlock().add(event.getFace().getUnitVector()).getLevelBlock()).add(0.5, 0, 0.5), player); 186 | //去掉玩家的一个农场管理机物品 187 | let tmpitem = event.getItem().clone(); 188 | tmpitem.setCount(1); 189 | blockitem.removeItemToPlayer(player, tmpitem); 190 | //记录玩家上次操作时间 191 | playerTouchedTime[event.getPlayer().getName()] = mills(); 192 | } -------------------------------------------------------------------------------- /src/machine/TechDawn_farmManager.js: -------------------------------------------------------------------------------- 1 | //pragma js 2 | //pragma module TechDawnMachineFarmManager 3 | 4 | /** 5 | * @author Superice666(超神的冰凉) 6 | * @copyright TechDawn_Project 7 | * @fileoverview 科技黎明插件挖掘机模块 8 | */ 9 | 10 | /** 11 | * @description 耗电扩倍 12 | */ 13 | const RFPerRange = 2; 14 | 15 | /** 16 | * @description 获取时间函数 17 | */ 18 | const mills = java.lang.System.currentTimeMillis; 19 | 20 | /** 21 | * @description 能源模块 22 | */ 23 | const TechDawnMachinePower = require("TechDawnMachinePower"); 24 | 25 | /** 26 | * @description 配置文件模块 27 | */ 28 | const TechDawnConfig = require("TechDawnConfig"); 29 | 30 | /** 31 | * @description 翻译模块 32 | */ 33 | const TechDawnTranslate = require("TechDawnTranslate"); 34 | 35 | /** 36 | * @description 记录玩家触摸时间,防止刷物品 37 | * @type {{[key: string]: long}} 38 | */ 39 | const playerTouchedTime = {}; 40 | 41 | /** 42 | * @description 放置农场管理机 43 | * @param {cn.nukkit.level.Position} pos 44 | * @param {cn.nukkit.Player} player 放置的玩家,如果非玩家放置传入null 45 | * @param {{x: number,y: number,z: number,level: string,yaw: number,pitch: number, dataStroage: Object}} data 非玩家放置时传入的还原信息 46 | */ 47 | export function place(pos, player, data) { 48 | pos.getLevel().loadChunk(pos.getChunkX(), pos.getChunkZ()); 49 | let model = entity.buildModel(pos, "farmManager", 1, 1, 1, 1, F((self, tick) => { 50 | //每32刻检测一次作物生长情况 51 | if (!(tick & 31) && self.dataStorage.getItem("storage") >= 20) { 52 | //该世界没有开启科技黎明直接忽略 53 | if (!TechDawnConfig.isLevelEnabled(self.getLevel().getName())) return; 54 | //检测是否有足够的电 55 | let storage = self.dataStorage.getItem("storage"); 56 | if (storage < getRFCost(self)) { 57 | return; 58 | } 59 | //减去本次工作耗电 60 | self.dataStorage.setItem("storage", storage - getRFCost(self)); 61 | //检测作物生长情况 62 | const range = self.dataStorage.getItem("range"); 63 | const start = self.getPosition().clone().floor(); 64 | let tmpBlock; 65 | for(let i=-range; i { 96 | //如果被奇奇怪怪的东西伤害就爆炸 97 | if (!(damageEvent instanceof cn.nukkit.event.entity.EntityDamageByEntityEvent) || !entity.isPlayer(damageEvent.getDamager())) { 98 | particle.drawEmitter(self, "minecraft:huge_explosion_emitter"); 99 | blockitem.makeSound(self, "RANDOM_EXPLODE"); 100 | destroy(self); 101 | return; 102 | } 103 | let tmpItem = inventory.getEntityItemInHand(damageEvent.getDamager()); 104 | //检测手里是不是锤子 105 | if (tmpItem.getId() >= 3404 && tmpItem.getId() <= 3408) { 106 | blockitem.makeDropItem(self, blockitem.buildItem(3355, 0, 1)); 107 | destroy(self); 108 | //锤子掉耐久 109 | let hammer = tmpItem; 110 | hammer.setDamage(hammer.getDamage() + 2); 111 | if (hammer.getDamage() > hammer.getMaxDurability()) { 112 | inventory.setEntityItemInHand(damageEvent.getDamager(), blockitem.buildItem(0, 0, 1)); 113 | blockitem.makeSound(self, "USE_STONE"); 114 | } else { 115 | inventory.setEntityItemInHand(damageEvent.getDamager(), hammer); 116 | } 117 | } 118 | }), F((self, player, item, pos) => { 119 | window.getCustomWindowBuilder(TechDawnTranslate.translate("farm_manager_title")) 120 | .buildStepSlider(TechDawnTranslate.translate("farm_manager_slider_title"), "3x3;5x5;7x7;9x9", self.dataStorage.getItem("range") - 1) 121 | .action(F(event => { 122 | switch (event.getResult()) { 123 | case "3x3": 124 | self.dataStorage.setItem("range", 1); break; 125 | case "5x5": 126 | self.dataStorage.setItem("range", 2); break; 127 | case "7x7": 128 | self.dataStorage.setItem("range", 3); break; 129 | case "9x9": 130 | self.dataStorage.setItem("range", 4); break; 131 | } 132 | const range = self.dataStorage.getItem("range"); 133 | particle.drawLine(self.add(-range, 0.5, range), self.add(range, 0.5, range), 1, 40); 134 | particle.drawLine(self.add(range, 0.5, range), self.add(range, 0.5, -range), 1, 40); 135 | particle.drawLine(self.add(range, 0.5, -range), self.add(-range, 0.5, -range), 1, 40); 136 | particle.drawLine(self.add(-range, 0.5, -range), self.add(-range, 0.5, range), 1, 40); 137 | })) 138 | .show(player); 139 | })); 140 | require("TechDawnSaver").addMachine(model); 141 | if (data) { 142 | model.setYaw(data.yaw); 143 | model.setPitch(data.pitch); 144 | for (let key in data.dataStorage) { 145 | model.dataStorage.setItem(key, data.dataStorage[key]); 146 | } 147 | } else { 148 | let yaw = player.getYaw() + 180; 149 | model.setYaw(yaw > 360 ? yaw - 360 : yaw); 150 | model.setPitch(0); 151 | model.dataStorage.setItem("techDawn", true); 152 | model.dataStorage.setItem("name", "farmManager"); 153 | model.dataStorage.setItem("storage", 0); 154 | model.dataStorage.setItem("maxStorage", 120); 155 | model.dataStorage.setItem("mode", "I"); 156 | model.dataStorage.setItem("maxAccept", 20); 157 | model.dataStorage.setItem("range", 4); 158 | } 159 | } 160 | 161 | /** 162 | * @description 获取农场管理机单次消耗电量 163 | * @param {com.blocklynukkit.loader.other.Entities.BNModel} model 164 | */ 165 | function getRFCost(model) { 166 | return model.dataStorage.getItem("range") * RFPerRange; 167 | } 168 | 169 | /** 170 | * @description 销毁农场管理机 171 | * @param {com.blocklynukkit.loader.other.Entities.BNModel} model 172 | */ 173 | export function destroy(model) { 174 | require("TechDawnSaver").removeMachine(model); 175 | model.close(); 176 | } 177 | 178 | function RightClickBlockEvent(/**@type {cn.nukkit.event.player.PlayerInteractEvent}*/event) { 179 | //玩家操作间隔太小直接忽略 180 | if (playerTouchedTime[event.getPlayer().getName()] != null && mills() - playerTouchedTime[event.getPlayer().getName()] < 200) return; 181 | //该世界没有开启科技黎明直接忽略 182 | if (!TechDawnConfig.isLevelEnabled(event.getPlayer().getLevel().getName())) return; 183 | //放置挖掘机 184 | let player = event.getPlayer(); 185 | if (event.getItem().getId() != 3355) { 186 | return; 187 | } 188 | //放置挖掘机 189 | place((event.getBlock().getId() == 55 ? event.getBlock() : event.getBlock().add(event.getFace().getUnitVector()).getLevelBlock()).add(0.5, 0, 0.5), player); 190 | //去掉玩家的一个农场管理机物品 191 | let tmpitem = event.getItem().clone(); 192 | tmpitem.setCount(1); 193 | blockitem.removeItemToPlayer(player, tmpitem); 194 | //记录玩家上次操作时间 195 | playerTouchedTime[event.getPlayer().getName()] = mills(); 196 | } -------------------------------------------------------------------------------- /src/machine/TechDawn_fuelGenerator.js: -------------------------------------------------------------------------------- 1 | //pragma js 2 | //pragma module TechDawnMachineFuelGenerator 3 | 4 | /** 5 | * @author Superice666(超神的冰凉) 6 | * @copyright TechDawn_Project 7 | * @fileoverview 科技黎明插件火力发电机模块 8 | */ 9 | 10 | /** 11 | * @description 获取时间函数 12 | */ 13 | const mills = java.lang.System.currentTimeMillis; 14 | 15 | /** 16 | * @description 能源模块 17 | */ 18 | const TechDawnMachinePower = require("TechDawnMachinePower"); 19 | 20 | /** 21 | * @description 配置文件模块 22 | */ 23 | const TechDawnConfig = require("TechDawnConfig"); 24 | 25 | /** 26 | * @description 记录玩家触摸时间,防止刷物品 27 | * @type {{[key: string]: long}} 28 | */ 29 | const playerTouchedTime = {}; 30 | 31 | 32 | /** 33 | * @description 添加火力发电机工作时间 34 | * @param {com.blocklynukkit.loader.other.Entities.BNModel} self 35 | * @param {int} time 时间(刻) 36 | */ 37 | function addWorkingTime(self, time){ 38 | //添加燃烧时间 39 | self.dataStorage.setItem("workingTime", self.dataStorage.getItem("workingTime") + time); 40 | //如果之前没有工作就换成工作皮肤 41 | if(!self.dataStorage.getItem("working")){ 42 | self.dataStorage.setItem("working", true); 43 | self.resetModelSkin("fuelGenerator_working"); 44 | } 45 | } 46 | 47 | /** 48 | * @description 放置火力发电机 49 | * @param {cn.nukkit.level.Position} pos 50 | * @param {cn.nukkit.Player} player 放置的玩家,如果非玩家放置传入null 51 | * @param {{x: number,y: number,z: number,level: string,yaw: number,pitch: number, dataStroage: Object}} data 非玩家放置时传入的还原信息 52 | */ 53 | export function place(pos, player, data){ 54 | pos.getLevel().loadChunk(pos.getChunkX(), pos.getChunkZ()); 55 | let model = entity.buildModel(pos, "fuelGenerator", 1, 1, 1, 1, F(self => { 56 | let workingTime = self.dataStorage.getItem("workingTime") 57 | if(workingTime > 0){ 58 | self.dataStorage.setItem("workingTime", workingTime - 1); 59 | //播放工作声音,每64刻播放一次 60 | if(!(workingTime & 63)){ 61 | blockitem.makeSound(self, "FIRE_FIRE"); 62 | } 63 | //计算能源输出,每16刻输出一次能源,输出20RF 64 | if(!(workingTime & 15)){ 65 | manager.concurrentRun(F(() => { 66 | TechDawnMachinePower.newPowerOutputProcess(self.getPosition().floor(), 20).startTransfer(false); 67 | })); 68 | } 69 | //显示工作粒子,每32刻显示一次 70 | if(!(workingTime & 31)){ 71 | particle.drawDot(self.add(0, 1, 0), 67); 72 | } 73 | }else if(workingTime == 0 && self.dataStorage.getItem("working") == true){ 74 | self.dataStorage.setItem("working", false); 75 | self.resetModelSkin("fuelGenerator"); 76 | } 77 | }), 1, F((self, damageEvent) => { 78 | //如果被奇奇怪怪的东西伤害就爆炸 79 | if(!(damageEvent instanceof cn.nukkit.event.entity.EntityDamageByEntityEvent) || !entity.isPlayer(damageEvent.getDamager())){ 80 | particle.drawEmitter(self, "minecraft:huge_explosion_emitter"); 81 | blockitem.makeSound(self, "RANDOM_EXPLODE"); 82 | destroy(self); 83 | return; 84 | } 85 | let tmpItem = inventory.getEntityItemInHand(damageEvent.getDamager()); 86 | //检测手里是不是锤子 87 | if(tmpItem.getId() >= 3404 && tmpItem.getId() <= 3408){ 88 | blockitem.makeDropItem(self, blockitem.buildItem(3351, 0, 1)); 89 | destroy(self); 90 | //锤子掉耐久 91 | let hammer = tmpItem; 92 | hammer.setDamage(hammer.getDamage() + 2); 93 | if(hammer.getDamage() > hammer.getMaxDurability()){ 94 | inventory.setEntityItemInHand(damageEvent.getDamager(), blockitem.buildItem(0,0,1)); 95 | blockitem.makeSound(self, "USE_STONE"); 96 | }else{ 97 | inventory.setEntityItemInHand(damageEvent.getDamager(), hammer); 98 | } 99 | } 100 | }), F((self, player, item, pos) => { 101 | if(item.getId() == 3729){ 102 | addWorkingTime(self, 200); 103 | let tmpitem = item.clone(); 104 | tmpitem.setCount(1); 105 | blockitem.removeItemToPlayer(player, tmpitem); 106 | }else if(item.getId() == 263 && item.getDamage() == 1){ 107 | addWorkingTime(self, 120); 108 | let tmpitem = item.clone(); 109 | tmpitem.setCount(1); 110 | blockitem.removeItemToPlayer(player, tmpitem); 111 | } 112 | })); 113 | require("TechDawnSaver").addMachine(model); 114 | if(data){ 115 | model.setYaw(data.yaw); 116 | model.setPitch(data.pitch); 117 | for(let key in data.dataStorage){ 118 | model.dataStorage.setItem(key, data.dataStorage[key]); 119 | } 120 | if(model.dataStorage.getItem("working")){ 121 | model.resetModelSkin("fuelGenerator_working"); 122 | } 123 | }else{ 124 | let yaw = player.getYaw() + 180; 125 | model.setYaw(yaw > 360 ? yaw - 360 : yaw); 126 | model.setPitch(0); 127 | model.dataStorage.setItem("techDawn", true); 128 | model.dataStorage.setItem("name", "fuelGenerator"); 129 | model.dataStorage.setItem("workingTime", 0); 130 | model.dataStorage.setItem("working", false); 131 | model.dataStorage.setItem("mode", "O"); 132 | } 133 | } 134 | 135 | /** 136 | * @description 销毁火力发电机 137 | * @param {com.blocklynukkit.loader.other.Entities.BNModel} model 138 | */ 139 | export function destroy(model){ 140 | require("TechDawnSaver").removeMachine(model); 141 | model.close(); 142 | } 143 | 144 | function RightClickBlockEvent(/**@type {cn.nukkit.event.player.PlayerInteractEvent}*/event){ 145 | //玩家操作间隔太小直接忽略 146 | if(playerTouchedTime[event.getPlayer().getName()] != null && mills() - playerTouchedTime[event.getPlayer().getName()] < 200) return; 147 | //该世界没有开启科技黎明直接忽略 148 | if(!TechDawnConfig.isLevelEnabled(event.getPlayer().getLevel().getName())) return; 149 | //放置火力发电机 150 | let player = event.getPlayer(); 151 | if(event.getItem().getId() != 3351){ 152 | return; 153 | } 154 | //如果点击红石线放置就不要抬高一格 155 | place((event.getBlock().getId() == 55 ? event.getBlock() : event.getBlock().add(event.getFace().getUnitVector()).getLevelBlock()).add(0.5, 0, 0.5), player); 156 | //去掉玩家的一个火力发电机物品 157 | let tmpitem = event.getItem().clone(); 158 | tmpitem.setCount(1); 159 | blockitem.removeItemToPlayer(player, tmpitem); 160 | //记录玩家上次操作时间 161 | playerTouchedTime[event.getPlayer().getName()] = mills(); 162 | } 163 | 164 | /** 165 | * @description 处理投掷器/发射器发出燃料自动加注 166 | */ 167 | function ItemSpawnEvent(/**@type {cn.nukkit.event.entity.ItemSpawnEvent}*/event){ 168 | //该世界没有开启科技黎明直接忽略 169 | if(!TechDawnConfig.isLevelEnabled(event.getEntity().getLevel().getName())) return; 170 | let itemEntity = event.getEntity(); 171 | let item = itemEntity.getItem(); 172 | if(!(item.getId() == 3729 || item.getId() == 263)){ 173 | return; 174 | } 175 | for(let each of itemEntity.getChunk().getEntities()){ 176 | if(each.getName() == "BNModel" && each.dataStorage.getItem("techDawn") && each.dataStorage.getItem("name") == "fuelGenerator" && each.getPosition().floor().equals(itemEntity.getPosition().floor())){ 177 | if(item.getId() == 3729){ 178 | addWorkingTime(each, 200); 179 | itemEntity.close(); 180 | break; 181 | }else if(item.getId() == 263 && item.getDamage() == 1){ 182 | addWorkingTime(each, 120); 183 | itemEntity.close(); 184 | break; 185 | } 186 | } 187 | } 188 | } -------------------------------------------------------------------------------- /src/machine/TechDawn_miner.js: -------------------------------------------------------------------------------- 1 | //pragma js 2 | //pragma module TechDawnMachineMiner 3 | 4 | /** 5 | * @author Superice666(超神的冰凉) 6 | * @copyright TechDawn_Project 7 | * @fileoverview 科技黎明插件挖掘机模块 8 | */ 9 | 10 | /** 11 | * @description 获取时间函数 12 | */ 13 | const mills = java.lang.System.currentTimeMillis; 14 | 15 | /** 16 | * @description 能源模块 17 | */ 18 | const TechDawnMachinePower = require("TechDawnMachinePower"); 19 | 20 | /** 21 | * @description 配置文件模块 22 | */ 23 | const TechDawnConfig = require("TechDawnConfig"); 24 | 25 | /** 26 | * @description 记录玩家触摸时间,防止刷物品 27 | * @type {{[key: string]: long}} 28 | */ 29 | const playerTouchedTime = {}; 30 | 31 | /** 32 | * @description 放置挖掘机 33 | * @param {cn.nukkit.level.Position} pos 34 | * @param {cn.nukkit.Player} player 放置的玩家,如果非玩家放置传入null 35 | * @param {{x: number,y: number,z: number,level: string,yaw: number,pitch: number, dataStroage: Object}} data 非玩家放置时传入的还原信息 36 | */ 37 | export function place(pos, player, data){ 38 | pos.getLevel().loadChunk(pos.getChunkX(), pos.getChunkZ()); 39 | let model = entity.buildModel(pos, "miner", 1, 1, 1, 1, F((self, tick) => { 40 | //每32刻检测一次是否可以挖掘方块 41 | if(!(tick & 31) && self.dataStorage.getItem("storage") >= 20){ 42 | //该世界没有开启科技黎明直接忽略 43 | if(!TechDawnConfig.isLevelEnabled(self.getLevel().getName())) return; 44 | /** @type {cn.nukkit.level.Position} */ 45 | let dVector = self.getPosition().floor().clone(); 46 | let font = Math.floor((45 + self.getYaw()) / 90); 47 | switch (font) { 48 | case 0: 49 | dVector = dVector.add(0, 0, 1); 50 | break; 51 | case 1: 52 | dVector = dVector.add(-1, 0, 0); 53 | break; 54 | case 2: 55 | dVector = dVector.add(0, 0, -1); 56 | break; 57 | case 3: 58 | dVector = dVector.add(1, 0, 0); 59 | break; 60 | } 61 | let block = dVector.getLevelBlock(); 62 | if(block.canBeBrokenWith(blockitem.buildItem(257, 0, 1))){ 63 | blockitem.setBlock(dVector, blockitem.buildBlock(0, 0), true); 64 | blockitem.blockUpdate(dVector); 65 | blockitem.makeDropItem(dVector.add(0.5, 0.5, 0.5), blockitem.buildItemFromBlock(block)); 66 | self.dataStorage.setItem("storage", self.dataStorage.getItem("storage") - 20); 67 | } 68 | } 69 | }), 1, F((self, damageEvent) => { 70 | //如果被奇奇怪怪的东西伤害就爆炸 71 | if(!(damageEvent instanceof cn.nukkit.event.entity.EntityDamageByEntityEvent) || !entity.isPlayer(damageEvent.getDamager())){ 72 | particle.drawEmitter(self, "minecraft:huge_explosion_emitter"); 73 | blockitem.makeSound(self, "RANDOM_EXPLODE"); 74 | destroy(self); 75 | return; 76 | } 77 | let tmpItem = inventory.getEntityItemInHand(damageEvent.getDamager()); 78 | //检测手里是不是锤子 79 | if(tmpItem.getId() >= 3404 && tmpItem.getId() <= 3408){ 80 | blockitem.makeDropItem(self, blockitem.buildItem(3354, 0, 1)); 81 | destroy(self); 82 | //锤子掉耐久 83 | let hammer = tmpItem; 84 | hammer.setDamage(hammer.getDamage() + 2); 85 | if(hammer.getDamage() > hammer.getMaxDurability()){ 86 | inventory.setEntityItemInHand(damageEvent.getDamager(), blockitem.buildItem(0,0,1)); 87 | blockitem.makeSound(self, "USE_STONE"); 88 | }else{ 89 | inventory.setEntityItemInHand(damageEvent.getDamager(), hammer); 90 | } 91 | } 92 | }), F((self, player, item, pos) => { 93 | 94 | })); 95 | require("TechDawnSaver").addMachine(model); 96 | if(data){ 97 | model.setYaw(data.yaw); 98 | model.setPitch(data.pitch); 99 | for(let key in data.dataStorage){ 100 | model.dataStorage.setItem(key, data.dataStorage[key]); 101 | } 102 | }else{ 103 | let yaw = player.getYaw() + 180; 104 | model.setYaw(yaw > 360 ? yaw - 360 : yaw); 105 | model.setPitch(0); 106 | model.dataStorage.setItem("techDawn", true); 107 | model.dataStorage.setItem("name", "miner"); 108 | model.dataStorage.setItem("storage", 0); 109 | model.dataStorage.setItem("maxStorage", 120); 110 | model.dataStorage.setItem("mode", "I"); 111 | model.dataStorage.setItem("maxAccept", 20); 112 | } 113 | } 114 | 115 | /** 116 | * @description 销毁挖掘机 117 | * @param {com.blocklynukkit.loader.other.Entities.BNModel} model 118 | */ 119 | export function destroy(model){ 120 | require("TechDawnSaver").removeMachine(model); 121 | model.close(); 122 | } 123 | 124 | function RightClickBlockEvent(/**@type {cn.nukkit.event.player.PlayerInteractEvent}*/event){ 125 | //玩家操作间隔太小直接忽略 126 | if(playerTouchedTime[event.getPlayer().getName()] != null && mills() - playerTouchedTime[event.getPlayer().getName()] < 200) return; 127 | //该世界没有开启科技黎明直接忽略 128 | if(!TechDawnConfig.isLevelEnabled(event.getPlayer().getLevel().getName())) return; 129 | //放置挖掘机 130 | let player = event.getPlayer(); 131 | if(event.getItem().getId() != 3354){ 132 | return; 133 | } 134 | //放置挖掘机 135 | place((event.getBlock().getId() == 55 ? event.getBlock() : event.getBlock().add(event.getFace().getUnitVector()).getLevelBlock()).add(0.5, 0, 0.5), player); 136 | //去掉玩家的一个挖掘机物品 137 | let tmpitem = event.getItem().clone(); 138 | tmpitem.setCount(1); 139 | blockitem.removeItemToPlayer(player, tmpitem); 140 | //记录玩家上次操作时间 141 | playerTouchedTime[event.getPlayer().getName()] = mills(); 142 | } -------------------------------------------------------------------------------- /src/machine/TechDawn_redStoneBatteryBox.js: -------------------------------------------------------------------------------- 1 | //pragma js 2 | //pragma module TechDawnMachineRedStoneBatteryBox 3 | 4 | /** 5 | * @author Superice666(超神的冰凉) 6 | * @copyright TechDawn_Project 7 | * @fileoverview 科技黎明插件红石电池箱模块 8 | */ 9 | 10 | /** 11 | * @description 获取时间函数 12 | */ 13 | const mills = java.lang.System.currentTimeMillis; 14 | 15 | /** 16 | * @description 能源模块 17 | */ 18 | const TechDawnMachinePower = require("TechDawnMachinePower"); 19 | 20 | /** 21 | * @description 配置文件模块 22 | */ 23 | const TechDawnConfig = require("TechDawnConfig"); 24 | 25 | /** 26 | * @description 翻译模块 27 | */ 28 | const TechDawnTranslate = require("TechDawnTranslate"); 29 | 30 | /** 31 | * @description 记录玩家触摸时间,防止刷物品 32 | * @type {{[key: string]: long}} 33 | */ 34 | const playerTouchedTime = {}; 35 | 36 | /** 37 | * @description 放置红石电池箱 38 | * @param {cn.nukkit.level.Position} pos 39 | * @param {cn.nukkit.Player} player 放置的玩家,如果非玩家放置传入null 40 | * @param {{x: number,y: number,z: number,level: string,yaw: number,pitch: number, dataStroage: Object}} data 非玩家放置时传入的还原信息 41 | */ 42 | export function place(pos, player, data){ 43 | pos.getLevel().loadChunk(pos.getChunkX(), pos.getChunkZ()); 44 | //如果点击红石线放置就不要抬高一格 45 | let model = entity.buildModel(pos, "redStoneBatteryBox", 1, 1, 0.1, 1, F((self, tick) => { 46 | //每15刻输出电力 47 | if(!(tick & 15) && self.dataStorage.getItem("storage") >= 60){ 48 | self.dataStorage.setItem("storage", self.dataStorage.getItem("storage") - 60); 49 | manager.concurrentRun(F(() => { 50 | TechDawnMachinePower.newPowerOutputProcess(self.getPosition().floor(), 60).startTransfer(false); 51 | })); 52 | } 53 | }), 1, F((self, damageEvent) => { 54 | //如果被奇奇怪怪的东西伤害就爆炸 55 | if(!(damageEvent instanceof cn.nukkit.event.entity.EntityDamageByEntityEvent) || !entity.isPlayer(damageEvent.getDamager())){ 56 | particle.drawEmitter(self, "minecraft:huge_explosion_emitter"); 57 | blockitem.makeSound(self, "RANDOM_EXPLODE"); 58 | destroy(self); 59 | return; 60 | } 61 | let tmpItem = inventory.getEntityItemInHand(damageEvent.getDamager()); 62 | //检测手里是不是锤子 63 | if(tmpItem.getId() >= 3404 && tmpItem.getId() <= 3408){ 64 | blockitem.makeDropItem(self, blockitem.buildItem(3352, 0, 1)); 65 | destroy(self); 66 | //锤子掉耐久 67 | let hammer = tmpItem; 68 | hammer.setDamage(hammer.getDamage() + 2); 69 | if(hammer.getDamage() > hammer.getMaxDurability()){ 70 | inventory.setEntityItemInHand(damageEvent.getDamager(), blockitem.buildItem(0,0,1)); 71 | blockitem.makeSound(self, "USE_STONE"); 72 | }else{ 73 | inventory.setEntityItemInHand(damageEvent.getDamager(), hammer); 74 | } 75 | } 76 | }), F((self, player, item, pos) => { 77 | window.getSimpleWindowBuilder("","") 78 | .setTitle(TechDawnTranslate.translate("redstone_battery_box_title")) 79 | .setContext(TechDawnTranslate.translateFormat("battery_box_content",[self.dataStorage.getItem("storage"), self.dataStorage.getItem("maxStorage")])) 80 | .show(player); 81 | })); 82 | require("TechDawnSaver").addMachine(model); 83 | if(data){ 84 | model.setYaw(data.yaw); 85 | model.setPitch(data.pitch); 86 | for(let key in data.dataStorage){ 87 | model.dataStorage.setItem(key, data.dataStorage[key]); 88 | } 89 | }else{ 90 | let yaw = player.getYaw() + 180; 91 | model.setYaw(yaw > 360 ? yaw - 360 : yaw); 92 | model.setPitch(0); 93 | model.dataStorage.setItem("techDawn", true); 94 | model.dataStorage.setItem("name", "redStoneBatteryBox"); 95 | model.dataStorage.setItem("storage", 0); 96 | model.dataStorage.setItem("maxStorage", 8000); 97 | model.dataStorage.setItem("mode", "IO"); 98 | model.dataStorage.setItem("maxAccept", 60); 99 | } 100 | } 101 | 102 | /** 103 | * @description 销毁红石储电箱 104 | * @param {com.blocklynukkit.loader.other.Entities.BNModel} model 105 | */ 106 | export function destroy(model){ 107 | require("TechDawnSaver").removeMachine(model); 108 | model.close(); 109 | } 110 | 111 | function RightClickBlockEvent(/**@type {cn.nukkit.event.player.PlayerInteractEvent}*/event){ 112 | //玩家操作间隔太小直接忽略 113 | if(playerTouchedTime[event.getPlayer().getName()] != null && mills() - playerTouchedTime[event.getPlayer().getName()] < 200) return; 114 | //该世界没有开启科技黎明直接忽略 115 | if(!TechDawnConfig.isLevelEnabled(event.getPlayer().getLevel().getName())) return; 116 | //放置红石电池箱 117 | let player = event.getPlayer(); 118 | if(event.getItem().getId() != 3352){ 119 | return; 120 | } 121 | //放置红石电池箱 122 | place((event.getBlock().getId() == 55 ? event.getBlock() : event.getBlock().add(event.getFace().getUnitVector()).getLevelBlock()).add(0.5, 0, 0.5), player); 123 | //去掉玩家的一个红石电池箱物品 124 | let tmpitem = event.getItem().clone(); 125 | tmpitem.setCount(1); 126 | blockitem.removeItemToPlayer(player, tmpitem); 127 | //记录玩家上次操作时间 128 | playerTouchedTime[event.getPlayer().getName()] = mills(); 129 | } -------------------------------------------------------------------------------- /src/machine/TechDawn_shaftFurnace.js: -------------------------------------------------------------------------------- 1 | //pragma js 2 | //pragma module TechDawnMachineShaftFurnace 3 | 4 | /** 5 | * @author Superice666(超神的冰凉) 6 | * @copyright TechDawn_Project 7 | * @fileoverview 科技黎明插件高炉模块 8 | */ 9 | 10 | /** 11 | * @description 获取时间函数 12 | */ 13 | const mills = java.lang.System.currentTimeMillis; 14 | 15 | /** 16 | * @description 能源模块 17 | */ 18 | const TechDawnMachinePower = require("TechDawnMachinePower"); 19 | 20 | /** 21 | * @description 配置文件模块 22 | */ 23 | const TechDawnConfig = require("TechDawnConfig"); 24 | 25 | /** 26 | * @description 记录玩家触摸时间,防止刷物品 27 | * @type {{[key: string]: long}} 28 | */ 29 | const playerTouchedTime = {}; 30 | 31 | /** 32 | * @description 放置高炉 33 | * @param {cn.nukkit.level.Position} pos 34 | * @param {cn.nukkit.Player} player 放置的玩家,如果非玩家放置传入null 35 | * @param {{x: number,y: number,z: number,level: string,yaw: number,pitch: number, dataStroage: Object}} data 非玩家放置时传入的还原信息 36 | */ 37 | export function place(pos, player, data){ 38 | pos.getLevel().loadChunk(pos.getChunkX(), pos.getChunkZ()); 39 | let model = entity.buildModel(pos, "shaftFurnace", 1, 1, 1, 1, F(self => { 40 | 41 | }), 1, F((self, damageEvent) => { 42 | //如果被奇奇怪怪的东西伤害就爆炸 43 | if(!(damageEvent instanceof cn.nukkit.event.entity.EntityDamageByEntityEvent) || !entity.isPlayer(damageEvent.getDamager())){ 44 | particle.drawEmitter(self, "minecraft:huge_explosion_emitter"); 45 | blockitem.makeSound(self, "RANDOM_EXPLODE"); 46 | destroy(self); 47 | return; 48 | } 49 | let tmpItem = inventory.getEntityItemInHand(damageEvent.getDamager()); 50 | //检测手里是不是锤子 51 | if(tmpItem.getId() >= 3404 && tmpItem.getId() <= 3408){ 52 | blockitem.makeDropItem(self, blockitem.buildItem(3353, 0, 1)); 53 | destroy(self); 54 | //锤子掉耐久 55 | let hammer = tmpItem; 56 | hammer.setDamage(hammer.getDamage() + 2); 57 | if(hammer.getDamage() > hammer.getMaxDurability()){ 58 | inventory.setEntityItemInHand(damageEvent.getDamager(), blockitem.buildItem(0,0,1)); 59 | blockitem.makeSound(self, "USE_STONE"); 60 | }else{ 61 | inventory.setEntityItemInHand(damageEvent.getDamager(), hammer); 62 | } 63 | } 64 | }), F((self, player, item, pos) => { 65 | let storage = self.dataStorage.getItem("storage"); 66 | if(storage < 160){ 67 | return; 68 | } 69 | let recipe = server.getCraftingManager().matchFurnaceRecipe(item); 70 | if(recipe != null){ 71 | let tmpitem = item.clone(); 72 | tmpitem.setCount(1); 73 | blockitem.removeItemToPlayer(player, tmpitem); 74 | blockitem.makeDropItem(self.add(0, 1, 0), recipe.getResult()); 75 | particle.drawDot(self.add(0,1,0), 6); 76 | blockitem.makeSound(self, "MOB_ENDERDRAGON_FLAP"); 77 | self.dataStorage.setItem("storage", storage - 160); 78 | } 79 | })); 80 | require("TechDawnSaver").addMachine(model); 81 | if(data){ 82 | model.setYaw(data.yaw); 83 | model.setPitch(data.pitch); 84 | for(let key in data.dataStorage){ 85 | model.dataStorage.setItem(key, data.dataStorage[key]); 86 | } 87 | }else{ 88 | let yaw = player.getYaw() + 180; 89 | model.setYaw(yaw > 360 ? yaw - 360 : yaw); 90 | model.setPitch(0); 91 | model.dataStorage.setItem("techDawn", true); 92 | model.dataStorage.setItem("name", "shaftFurnace"); 93 | model.dataStorage.setItem("storage", 0); 94 | model.dataStorage.setItem("maxStorage", 480); 95 | model.dataStorage.setItem("mode", "I"); 96 | model.dataStorage.setItem("maxAccept", 480); 97 | } 98 | } 99 | 100 | /** 101 | * @description 处理投掷器/发射器自动冶炼 102 | */ 103 | function ItemSpawnEvent(/**@type {cn.nukkit.event.entity.ItemSpawnEvent}*/event){ 104 | //该世界没有开启科技黎明直接忽略 105 | if(!TechDawnConfig.isLevelEnabled(event.getEntity().getLevel().getName())) return; 106 | let itemEntity = event.getEntity(); 107 | let item = itemEntity.getItem(); 108 | for(let each of itemEntity.getChunk().getEntities()){ 109 | if(each.getName() == "BNModel" && each.dataStorage.getItem("techDawn") && each.dataStorage.getItem("name") == "shaftFurnace" && each.getPosition().floor().equals(itemEntity.getPosition().floor())){ 110 | let storage = each.dataStorage.getItem("storage"); 111 | if(storage < 160){ 112 | return; 113 | } 114 | let recipe = server.getCraftingManager().matchFurnaceRecipe(item); 115 | if(recipe != null){ 116 | itemEntity.close(); 117 | blockitem.makeDropItem(each.add(0,1,0), recipe.getResult()); 118 | particle.drawDot(each.add(0,1,0), 6); 119 | blockitem.makeSound(each, "MOB_ENDERDRAGON_FLAP"); 120 | each.dataStorage.setItem("storage", storage - 160); 121 | break; 122 | } 123 | } 124 | } 125 | } 126 | 127 | /** 128 | * @description 销毁高炉 129 | * @param {com.blocklynukkit.loader.other.Entities.BNModel} model 130 | */ 131 | export function destroy(model){ 132 | require("TechDawnSaver").removeMachine(model); 133 | model.close(); 134 | } 135 | 136 | function RightClickBlockEvent(/**@type {cn.nukkit.event.player.PlayerInteractEvent}*/event){ 137 | //玩家操作间隔太小直接忽略 138 | if(playerTouchedTime[event.getPlayer().getName()] != null && mills() - playerTouchedTime[event.getPlayer().getName()] < 200) return; 139 | //该世界没有开启科技黎明直接忽略 140 | if(!TechDawnConfig.isLevelEnabled(event.getPlayer().getLevel().getName())) return; 141 | //放置高炉 142 | let player = event.getPlayer(); 143 | if(event.getItem().getId() != 3353){ 144 | return; 145 | } 146 | //放置高炉 147 | place((event.getBlock().getId() == 55 ? event.getBlock() : event.getBlock().add(event.getFace().getUnitVector()).getLevelBlock()).add(0.5, 0, 0.5), player); 148 | //去掉玩家的一个高炉物品 149 | let tmpitem = event.getItem().clone(); 150 | tmpitem.setCount(1); 151 | blockitem.removeItemToPlayer(player, tmpitem); 152 | //记录玩家上次操作时间 153 | playerTouchedTime[event.getPlayer().getName()] = mills(); 154 | } -------------------------------------------------------------------------------- /src/machine/TechDawn_solarGenerator.js: -------------------------------------------------------------------------------- 1 | //pragma js 2 | //pragma module TechDawnMachineSolarGenerator 3 | 4 | /** 5 | * @author Superice666(超神的冰凉) 6 | * @copyright TechDawn_Project 7 | * @fileoverview 科技黎明插件火力发电机模块 8 | */ 9 | 10 | /** 11 | * @description 获取时间函数 12 | */ 13 | const mills = java.lang.System.currentTimeMillis; 14 | 15 | /** 16 | * @description 能源模块 17 | */ 18 | const TechDawnMachinePower = require("TechDawnMachinePower"); 19 | 20 | /** 21 | * @description 配置文件模块 22 | */ 23 | const TechDawnConfig = require("TechDawnConfig"); 24 | 25 | /** 26 | * @description 翻译模块 27 | */ 28 | const TechDawnTranslate = require("TechDawnTranslate"); 29 | 30 | /** 31 | * @description 记录玩家触摸时间,防止刷物品 32 | * @type {{[key: string]: long}} 33 | */ 34 | const playerTouchedTime = {}; 35 | 36 | /** 37 | * @description 放置太阳能发电机 38 | * @param {cn.nukkit.level.Position} pos 39 | * @param {cn.nukkit.Player} player 放置的玩家,如果非玩家放置传入null 40 | * @param {{x: number,y: number,z: number,level: string,yaw: number,pitch: number, dataStroage: Object}} data 非玩家放置时传入的还原信息 41 | */ 42 | export function place(pos, player, data) { 43 | pos.getLevel().loadChunk(pos.getChunkX(), pos.getChunkZ()); 44 | let model = entity.buildModel(pos, "solarGenerator", 1, 1, 1, 1, F((self, tick) => { 45 | if (self.dataStorage.getItem("working")) { 46 | //计算能源输出,每16刻输出一次能源,输出2RF 47 | if (!(tick & 15)) { 48 | manager.concurrentRun(F(() => { 49 | TechDawnMachinePower.newPowerOutputProcess(self.getPosition().floor(), 2).startTransfer(false); 50 | })); 51 | } 52 | //显示工作粒子,每32刻显示一次 53 | if (!(tick & 31)) { 54 | particle.drawDot(self.add(-0.5+Math.random(), 1.05, -0.5+Math.random), 36); 55 | } 56 | } 57 | //每64tick计算一次是否能够工作 58 | if(!(tick & 63)){ 59 | self.dataStorage.setItem("working", blockitem.isDay(self) && (getHeighestBlockAt(self.level, self.x, self.z) <= self.y)); 60 | } 61 | }), 1, F((self, damageEvent) => { 62 | //如果被奇奇怪怪的东西伤害就爆炸 63 | if (!(damageEvent instanceof cn.nukkit.event.entity.EntityDamageByEntityEvent) || !entity.isPlayer(damageEvent.getDamager())) { 64 | particle.drawEmitter(self, "minecraft:huge_explosion_emitter"); 65 | blockitem.makeSound(self, "RANDOM_EXPLODE"); 66 | destroy(self); 67 | return; 68 | } 69 | let tmpItem = inventory.getEntityItemInHand(damageEvent.getDamager()); 70 | //检测手里是不是锤子 71 | if (tmpItem.getId() >= 3404 && tmpItem.getId() <= 3408) { 72 | blockitem.makeDropItem(self, blockitem.buildItem(3357, 0, 1)); 73 | destroy(self); 74 | //锤子掉耐久 75 | let hammer = tmpItem; 76 | hammer.setDamage(hammer.getDamage() + 2); 77 | if (hammer.getDamage() > hammer.getMaxDurability()) { 78 | inventory.setEntityItemInHand(damageEvent.getDamager(), blockitem.buildItem(0, 0, 1)); 79 | blockitem.makeSound(self, "USE_STONE"); 80 | } else { 81 | inventory.setEntityItemInHand(damageEvent.getDamager(), hammer); 82 | } 83 | } 84 | }), F((self, player, item, pos) => { 85 | if(self.dataStorage.getItem("working")){ 86 | player.sendMessage(TechDawnTranslate.translate("solar_generator_working")); 87 | }else{ 88 | player.sendMessage(TechDawnTranslate.translate("solar_generator_not_working")); 89 | } 90 | })); 91 | require("TechDawnSaver").addMachine(model); 92 | if (data) { 93 | model.setYaw(data.yaw); 94 | model.setPitch(data.pitch); 95 | for (let key in data.dataStorage) { 96 | model.dataStorage.setItem(key, data.dataStorage[key]); 97 | } 98 | } else { 99 | let yaw = player.getYaw() + 180; 100 | model.setYaw(yaw > 360 ? yaw - 360 : yaw); 101 | model.setPitch(0); 102 | model.dataStorage.setItem("techDawn", true); 103 | model.dataStorage.setItem("name", "solarGenerator"); 104 | model.dataStorage.setItem("working", false); 105 | model.dataStorage.setItem("mode", "O"); 106 | } 107 | } 108 | 109 | /** 110 | * @description 检测指定位置最高方块 111 | * @param {cn.nukkit.level.Level} level 112 | * @param {int} x 113 | * @param {int} z 114 | */ 115 | function getHeighestBlockAt(level, x, z){ 116 | for(let i=255; i>=0; i--){ 117 | if(level.getBlockIdAt(x, i, z) != 0){ 118 | return i; 119 | } 120 | } 121 | return 0; 122 | } 123 | 124 | /** 125 | * @description 销毁太阳能发电机 126 | * @param {com.blocklynukkit.loader.other.Entities.BNModel} model 127 | */ 128 | export function destroy(model) { 129 | require("TechDawnSaver").removeMachine(model); 130 | model.close(); 131 | } 132 | 133 | function RightClickBlockEvent(/**@type {cn.nukkit.event.player.PlayerInteractEvent}*/event) { 134 | //玩家操作间隔太小直接忽略 135 | if (playerTouchedTime[event.getPlayer().getName()] != null && mills() - playerTouchedTime[event.getPlayer().getName()] < 200) return; 136 | //该世界没有开启科技黎明直接忽略 137 | if (!TechDawnConfig.isLevelEnabled(event.getPlayer().getLevel().getName())) return; 138 | //放置太阳能发电机 139 | let player = event.getPlayer(); 140 | if (event.getItem().getId() != 3357) { 141 | return; 142 | } 143 | //如果点击红石线放置就不要抬高一格 144 | place((event.getBlock().getId() == 55 ? event.getBlock() : event.getBlock().add(event.getFace().getUnitVector()).getLevelBlock()).add(0.5, 0, 0.5), player); 145 | //去掉玩家的一个太阳能发电机物品 146 | let tmpitem = event.getItem().clone(); 147 | tmpitem.setCount(1); 148 | blockitem.removeItemToPlayer(player, tmpitem); 149 | //记录玩家上次操作时间 150 | playerTouchedTime[event.getPlayer().getName()] = mills(); 151 | } 152 | -------------------------------------------------------------------------------- /src/machine/mutiBlock/TechDawn_coalStack.js: -------------------------------------------------------------------------------- 1 | //pragma js 2 | //pragma module TechDawnMutiBlockMachineCoalStack 3 | 4 | /** 5 | * @author Superice666(超神的冰凉) 6 | * @copyright TechDawn_Project 7 | * @fileoverview 科技黎明插件木炭堆模块 8 | */ 9 | 10 | /** 11 | * @description 配置文件模块 12 | */ 13 | const TechDawnConfig = require("TechDawnConfig"); 14 | 15 | function RightClickBlockEvent(/**@type {cn.nukkit.event.player.PlayerInteractEvent}*/event){ 16 | //该世界没有开启科技黎明直接忽略 17 | if(!TechDawnConfig.isLevelEnabled(event.getPlayer().getLevel().getName())) return; 18 | var touchblock = event.getBlock(); 19 | var touchpos = algorithm.buildPositionfromBlock(event.getBlock()); 20 | var item = blockitem.getItemInHand(event.getPlayer()); 21 | if (item == null || item == undefined) { 22 | return; 23 | } 24 | if(touchblock.getId()==33){ 25 | if(touchblock.getDamage()==0 && item.getId()==50){ 26 | checkCoalStack(touchpos,event); 27 | } 28 | } 29 | } 30 | 31 | const Position = cn.nukkit.level.Position; 32 | 33 | /** 34 | * @description 检查并创建木炭堆 35 | * @param {cn.nukkit.level.Position} pos 点击的位置 36 | * @param {cn.nukkit.event.player.PlayerInteractEvent} 玩家点击方块事件 37 | * @deprecated 此函数从空岛科技复制而来,需要重构 38 | */ 39 | function checkCoalStack(pos,event){ 40 | let touchblock = event.getBlock(); 41 | let touchpos = algorithm.buildPositionfromBlock(event.getBlock()); 42 | let item = blockitem.getItemInHand(event.getPlayer()); 43 | let brickLevel = 256; 44 | let tmp = Position.fromObject(pos,pos.getLevel()) 45 | let height = -1; 46 | if(item.getId()!=50){ 47 | return false; 48 | } 49 | for(let i=pos.getY();i>1;i--){ 50 | tmp = tmp.add(0,-1,0); 51 | height++; 52 | if(tmp.getLevelBlock().getId()==45){ 53 | brickLevel = tmp.getY(); 54 | break; 55 | } 56 | if(i maxConductLength){ 59 | return; 60 | } 61 | this.closed.push(pos2string(currentPos)); 62 | let poses = [ 63 | currentPos.add(1,0,0), 64 | currentPos.add(1,1,0), 65 | currentPos.add(1,-1,0), 66 | currentPos.add(-1,1,0), 67 | currentPos.add(-1,0,0), 68 | currentPos.add(-1,-1,0), 69 | currentPos.add(0,1,1), 70 | currentPos.add(0,0,1), 71 | currentPos.add(0,-1,1), 72 | currentPos.add(0,1,-1), 73 | currentPos.add(0,0,-1), 74 | currentPos.add(0,-1,-1) 75 | ]; 76 | for(let each of poses){ 77 | if(canTransferTo(currentPos, each)){ 78 | this.transfer(each); 79 | } 80 | } 81 | } 82 | } 83 | /** 84 | * @description 开始计算能源传输 85 | * @param {boolean} showParticle 是否显示红石粒子 86 | */ 87 | this.startTransfer = function(showParticle){ 88 | //计算能源通路 89 | this.transfer(this.startPos); 90 | //转换为坐标处理 91 | let finalPoses = []; 92 | for(let each of this.closed){ 93 | finalPoses.push(string2pos(each)); 94 | } 95 | //显示红石粒子 96 | if(showParticle){ 97 | for(let each of finalPoses){ 98 | particle.drawDot(each.add(0.5,0.1,0.5), 11); 99 | } 100 | } 101 | /** 102 | * @description 所有机械实体数组 103 | * @type {com.blocklynukkit.loader.other.Entities.BNModel[]} 104 | */ 105 | const inputMachines = []; 106 | /** 107 | * @description 所有电池实体数组 108 | * @type {com.blocklynukkit.loader.other.Entities.BNModel[]} 109 | */ 110 | const storeMachines = []; 111 | //计算范围内的所有机械实体 112 | for(let i=0;i { 129 | return s.distance(a) - s.distance(b); 130 | }); 131 | storeMachines.sort((a, b) => { 132 | return a.dataStorage.getItem("storage") - b.dataStorage.getItem("storage"); 133 | }); 134 | //分配电能 135 | for(let each of inputMachines.concat(storeMachines)){ 136 | let currentTransfer = Math.min(each.dataStorage.getItem("maxAccept"), this.totalTransfer); 137 | const storage = each.dataStorage.getItem("storage"); 138 | const maxStorage = each.dataStorage.getItem("maxStorage"); 139 | if(storage + currentTransfer > maxStorage){ 140 | currentTransfer = maxStorage - storage; 141 | } 142 | this.totalTransfer -= currentTransfer; 143 | each.dataStorage.setItem("storage", storage + currentTransfer); 144 | if(this.totalTransfer <= 0){ 145 | break; 146 | } 147 | } 148 | } 149 | } 150 | 151 | /** 152 | * @description 构建能源传输对象 153 | * @param {cn.nukkit.level.Position} startPos 能源输出开始的地方 154 | * @param {int} totalTransfer 一共传输多少能源 155 | * @returns {PowerOutputProcess} 156 | */ 157 | export function newPowerOutputProcess(startPos, totalTransfer){ 158 | //该世界没有开启科技黎明直接忽略 159 | if(startPos.getLevel() != null && !TechDawnConfig.isLevelEnabled(startPos.getLevel().getName())) return; 160 | return new PowerOutputProcess(startPos, totalTransfer); 161 | } 162 | 163 | /** 164 | * @description 坐标转字符串 165 | * @param {cn.nukkit.level.Position} pos 166 | */ 167 | function pos2string(pos){ 168 | return pos.x+" "+pos.y+" "+pos.z+" "+pos.getLevelName(); 169 | } 170 | 171 | /** 172 | * @description 字符串转坐标 173 | * @param {string} str 174 | */ 175 | function string2pos(str){ 176 | let xyz = str.split(" "); 177 | return algorithm.buildPosition(Number(xyz[0]), Number(xyz[1]), Number(xyz[2]), server.getLevelByName(xyz[3])); 178 | } 179 | 180 | /** 181 | * @description 红石线是否连接 182 | * @param {cn.nukkit.level.Position} from 183 | * @param {cn.nukkit.level.Position} to 184 | * @returns {boolean} 185 | */ 186 | function canTransferTo(from, to){ 187 | if(from.equals(to)){ 188 | return false; 189 | }else if(to.getLevelBlock().getId() != 55){ 190 | return false; 191 | }else{ 192 | if(Math.abs(to.distanceSquared(from)) > 2){ 193 | return false; 194 | }else{ 195 | if(to.y == from.y){ 196 | return true; 197 | }else if(to.x != from.x){ 198 | if(to.x > from.x && to.y > from.y){ 199 | return !from.add(0,1,0).getLevelBlock().isSolid(); 200 | }else if(to.x > from.x && to.y < from.y){ 201 | return !from.add(1,0,0).getLevelBlock().isSolid(); 202 | }else if(to.x < from.x && to.y > from.y){ 203 | return !from.add(0,1,0).getLevelBlock().isSolid(); 204 | }else if(to.x < from.x && to.y < from.y){ 205 | return !from.add(-1,0,0).getLevelBlock().isSolid(); 206 | } 207 | }else if(to.z != from.z){ 208 | if(to.z > from.z && to.y > from.y){ 209 | return !from.add(0,1,0).getLevelBlock().isSolid(); 210 | }else if(to.z > from.z && to.y < from.y){ 211 | return !from.add(0,0,1).getLevelBlock().isSolid(); 212 | }else if(to.z < from.z && to.y > from.y){ 213 | return !from.add(0,1,0).getLevelBlock().isSolid(); 214 | }else if(to.z < from.z && to.y < from.y){ 215 | return !from.add(0,0,-1).getLevelBlock().isSolid(); 216 | } 217 | } 218 | } 219 | } 220 | return false; 221 | } 222 | 223 | function RightClickBlockEvent(/**@type {cn.nukkit.event.player.PlayerInteractEvent}*/e){ 224 | // if(e.getBlock().getId() == 55){ 225 | // e.getPlayer().sendMessage(e.getBlock().getDamage()); 226 | // let process = new PowerOutputProcess(e.getBlock(), 20); 227 | // process.startTransfer(true); 228 | // } 229 | } --------------------------------------------------------------------------------