Skip to content

Commit

Permalink
Fix warden
Browse files Browse the repository at this point in the history
  • Loading branch information
leaftail1880 committed Jan 6, 2025
1 parent 7843c69 commit 30d799b
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/modules/places/dungeons/warden.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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Варден'
}
Expand All @@ -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(
Expand Down

0 comments on commit 30d799b

Please sign in to comment.