From 29657c58e9c55e10a882b8ddc67ce18116ee87ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B6=85=E7=A5=9E=E7=9A=84=E5=86=B0=E5=87=89?= <2801621420@qq.com> Date: Fri, 9 Jul 2021 23:07:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=96=E6=8E=98=E6=9C=BA=E4=B8=8D=E5=BA=94?= =?UTF-8?q?=E5=9C=A8=E6=9C=AA=E5=BC=80=E5=90=AF=E7=9A=84=E4=B8=96=E7=95=8C?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/machine/TechDawn_miner.js | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/src/machine/TechDawn_miner.js b/src/machine/TechDawn_miner.js index aa61cc9..ff85b58 100644 --- a/src/machine/TechDawn_miner.js +++ b/src/machine/TechDawn_miner.js @@ -39,6 +39,8 @@ export function placeMiner(pos, player, data){ let model = entity.buildModel(pos, "miner", 1, 1, 1, 1, F((self, tick) => { //每32刻检测一次是否可以挖掘方块 if(!(tick & 31) && self.dataStorage.getItem("storage") >= 20){ + //该世界没有开启科技黎明直接忽略 + if(!TechDawnConfig.isLevelEnabled(self.getLevel().getName())) return; /** @type {cn.nukkit.level.Position} */ let dVector = self.getPosition().clone(); let font = Math.floor((45 + self.getYaw()) / 90); @@ -102,33 +104,6 @@ export function placeMiner(pos, player, data){ } } -/** - * @description 处理投掷器/发射器自动冶炼 - */ -function ItemSpawnEvent(/**@type {cn.nukkit.event.entity.ItemSpawnEvent}*/event){ - //该世界没有开启科技黎明直接忽略 - if(!TechDawnConfig.isLevelEnabled(event.getEntity().getLevel().getName())) return; - let itemEntity = event.getEntity(); - let item = itemEntity.getItem(); - for(let each of itemEntity.getChunk().getEntities()){ - if(each.getName() == "BNModel" && each.dataStorage.getItem("techDawn") && each.dataStorage.getItem("name") == "miner" && each.getPosition().floor().equals(itemEntity.getPosition().floor())){ - let storage = each.dataStorage.getItem("storage"); - if(storage < 160){ - return; - } - let recipe = server.getCraftingManager().matchFurnaceRecipe(item); - if(recipe != null){ - itemEntity.close(); - blockitem.makeDropItem(each.add(0,1,0), recipe.getResult()); - particle.drawDot(each.add(0,1,0), 6); - blockitem.makeSound(each, "MOB_ENDERDRAGON_FLAP"); - each.dataStorage.setItem("storage", storage - 160); - break; - } - } - } -} - function RightClickBlockEvent(/**@type {cn.nukkit.event.player.PlayerInteractEvent}*/event){ //玩家操作间隔太小直接忽略 if(playerTouchedTime[event.getPlayer().getName()] != null && mills() - playerTouchedTime[event.getPlayer().getName()] < 200) return;