From 30d799bca3d642307ff62849a8d83568e49c34e8 Mon Sep 17 00:00:00 2001 From: leaftail1880 <110915645+leaftaul1880@users.noreply.github.com> Date: Mon, 6 Jan 2025 16:42:56 +0300 Subject: [PATCH] Fix warden --- src/modules/places/dungeons/warden.ts | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/modules/places/dungeons/warden.ts b/src/modules/places/dungeons/warden.ts index b1ce6444..a7153e63 100644 --- a/src/modules/places/dungeons/warden.ts +++ b/src/modules/places/dungeons/warden.ts @@ -18,6 +18,8 @@ import { getScheduledToPlace, scheduleBlockPlace, unscheduleBlockPlace } from 'm const logger = createLogger('warden') class WardenDungeonRegion extends Region { + protected priority = 3 + get displayName(): string | undefined { return '§5Варден' } @@ -30,24 +32,27 @@ interface LinkedDatabase extends JsonObject { } class WardenDungeonLootRegion extends Region { - protected priority = 2 + protected priority = 4 get displayName(): string | undefined { return '§dНезеритовая жила' } - ldb: LinkedDatabase = { - blocks: [], - } + ldb: LinkedDatabase = { blocks: [] } } registerSaveableRegion('wardenDungeonLoot', WardenDungeonLootRegion) registerCreateableRegion('Лут данжа вардена', WardenDungeonLootRegion) actionGuard((player, region, ctx) => { - if (!(region instanceof WardenDungeonLootRegion)) return - - if (ctx.type === 'break' || ctx.type === 'interactWithBlock') { - logger.player(player).debug('Break') + if (region instanceof WardenDungeonRegion) { + if (ctx.type === 'interactWithBlock') return false return true } + + if (region instanceof WardenDungeonLootRegion) { + if (ctx.type === 'break' || ctx.type === 'interactWithBlock') { + logger.player(player).debug('Break') + return true + } + } }, ActionGuardOrder.Feature) system.runInterval(