File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,7 +63,11 @@ export enum ActionGuardOrder {
6363 Lowest = 6 ,
6464}
6565
66+ export const regionTypesThatIgnoreIsBuildingGuard : ( typeof Region ) [ ] = [ ]
67+
6668actionGuard ( ( 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
Original file line number Diff line number Diff line change 11import { Player , PlayerBreakBlockBeforeEvent , system } from '@minecraft/server'
22import { 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'
49import { registerSaveableRegion } from 'lib/region/database'
510import { Region , type RegionPermissions } from 'lib/region/kinds/region'
611import { RegionWithStructure } from 'lib/region/kinds/with-structure'
@@ -115,6 +120,8 @@ export class MineareaRegion extends RegionWithStructure {
115120registerSaveableRegion ( 'minearea' , MineareaRegion )
116121registerCreateableRegion ( 'Зоны добычи' , MineareaRegion )
117122
123+ regionTypesThatIgnoreIsBuildingGuard . push ( MineareaRegion )
124+
118125actionGuard ( ( player , region , ctx ) => {
119126 if ( ! ( region instanceof MineareaRegion ) ) return
120127
You can’t perform that action at this time.
0 commit comments