Skip to content

Commit 8db2a7e

Browse files
committed
babayka
1 parent 233e02b commit 8db2a7e

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

src/lib/region/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ export enum ActionGuardOrder {
6363
Lowest = 6,
6464
}
6565

66+
export const regionTypesThatIgnoreIsBuildingGuard: (typeof Region)[] = []
67+
6668
actionGuard((player, region, ctx) => {
69+
if (region && regionTypesThatIgnoreIsBuildingGuard.some(e => region instanceof e)) return
70+
6771
if (isBuilding(player)) return true
6872

6973
if (region?.getMemberRole(player.id)) return true

src/modules/places/minearea/minearea-region.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import { Player, PlayerBreakBlockBeforeEvent, system } from '@minecraft/server'
22
import { isBuilding } from 'lib/game-utils'
3-
import { actionGuard, ActionGuardOrder, registerCreateableRegion } from 'lib/region'
3+
import {
4+
actionGuard,
5+
ActionGuardOrder,
6+
regionTypesThatIgnoreIsBuildingGuard,
7+
registerCreateableRegion,
8+
} from 'lib/region'
49
import { registerSaveableRegion } from 'lib/region/database'
510
import { Region, type RegionPermissions } from 'lib/region/kinds/region'
611
import { RegionWithStructure } from 'lib/region/kinds/with-structure'
@@ -115,6 +120,8 @@ export class MineareaRegion extends RegionWithStructure {
115120
registerSaveableRegion('minearea', MineareaRegion)
116121
registerCreateableRegion('Зоны добычи', MineareaRegion)
117122

123+
regionTypesThatIgnoreIsBuildingGuard.push(MineareaRegion)
124+
118125
actionGuard((player, region, ctx) => {
119126
if (!(region instanceof MineareaRegion)) return
120127

0 commit comments

Comments
 (0)