@@ -9,6 +9,7 @@ import * as AnimationController from "./animation-controller";
99import * as Block from "./block" ;
1010import * as Entity from "./entity" ;
1111import * as Feature from "./feature" ;
12+ import * as FeatureRule from "./feature_rule" ;
1213import * as Item from "./item" ;
1314import * as LootTable from "./loot-table" ;
1415import * as Function from "./mcfunction" ;
@@ -42,6 +43,8 @@ export class BehaviorPack implements Container, Pack {
4243 readonly entities : DataSet < Entity . Entity > ;
4344 /**The collection of features*/
4445 readonly features : DataSet < Feature . Feature > ;
46+ /**The collection of features*/
47+ readonly features_rules : DataSet < FeatureRule . FeatureRule > ;
4548 /**The collection of mcfunctions*/
4649 readonly functions : DataSet < Function . Function > ;
4750 /**The collection of items*/
@@ -71,6 +74,7 @@ export class BehaviorPack implements Container, Pack {
7174 this . structures = new DataSet ( ) ;
7275 this . trading = new DataSet ( ) ;
7376 this . features = new DataSet ( ) ;
77+ this . features_rules = new DataSet ( )
7478 }
7579
7680 /**
@@ -112,6 +116,9 @@ export class BehaviorPack implements Container, Pack {
112116
113117 case FileType . feature :
114118 return this . features . set ( Feature . Process ( doc ) ) ;
119+
120+ case FileType . feature_rule :
121+ return this . features_rules . set ( FeatureRule . Process ( doc ) )
115122 }
116123
117124 return undefined ;
@@ -140,6 +147,9 @@ export class BehaviorPack implements Container, Pack {
140147
141148 case FileType . feature :
142149 return this . features ;
150+
151+ case FileType . feature_rule :
152+ return this . features_rules ;
143153
144154 case FileType . function :
145155 return this . functions ;
@@ -174,6 +184,7 @@ export class BehaviorPack implements Container, Pack {
174184 out = this . blocks . deleteFile ( uri ) || out ;
175185 out = this . entities . deleteFile ( uri ) || out ;
176186 out = this . features . deleteFile ( uri ) || out ;
187+ out = this . features_rules . deleteFile ( uri ) || out ;
177188 out = this . functions . deleteFile ( uri ) || out ;
178189 out = this . items . deleteFile ( uri ) || out ;
179190 out = this . loot_tables . deleteFile ( uri ) || out ;
@@ -195,6 +206,7 @@ export class BehaviorPack implements Container, Pack {
195206 out = this . blocks . deleteFolder ( uri ) || out ;
196207 out = this . entities . deleteFolder ( uri ) || out ;
197208 out = this . features . deleteFolder ( uri ) || out ;
209+ out = this . features_rules . deleteFolder ( uri ) || out ;
198210 out = this . functions . deleteFolder ( uri ) || out ;
199211 out = this . items . deleteFolder ( uri ) || out ;
200212 out = this . loot_tables . deleteFolder ( uri ) || out ;
@@ -217,6 +229,7 @@ export class BehaviorPack implements Container, Pack {
217229 if ( ( value = this . blocks . find ( predicate ) ) ) return value ;
218230 if ( ( value = this . entities . find ( predicate ) ) ) return value ;
219231 if ( ( value = this . features . find ( predicate ) ) ) return value ;
232+ if ( ( value = this . features_rules . find ( predicate ) ) ) return value ;
220233 if ( ( value = this . functions . find ( predicate ) ) ) return value ;
221234 if ( ( value = this . items . find ( predicate ) ) ) return value ;
222235 if ( ( value = this . loot_tables . find ( predicate ) ) ) return value ;
@@ -237,6 +250,7 @@ export class BehaviorPack implements Container, Pack {
237250 this . blocks . forEach ( callbackfn ) ;
238251 this . entities . forEach ( callbackfn ) ;
239252 this . features . forEach ( callbackfn ) ;
253+ this . features_rules . forEach ( callbackfn ) ;
240254 this . functions . forEach ( callbackfn ) ;
241255 this . items . forEach ( callbackfn ) ;
242256 this . loot_tables . forEach ( callbackfn ) ;
@@ -269,6 +283,7 @@ export namespace BehaviorPack {
269283 if ( typeof temp . blocks !== "object" ) return false ;
270284 if ( typeof temp . entities !== "object" ) return false ;
271285 if ( typeof temp . features !== "object" ) return false ;
286+ if ( typeof temp . features_rules !== "object" ) return false ;
272287
273288 if ( typeof temp . context !== "object" ) return false ;
274289 if ( typeof temp . folder !== "string" ) return false ;
0 commit comments