-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A lot of miscellaneous tweaks (#329)
* - Fix filter property diagnosis * - Update list of hardcoded vanilla animations * - Account for entity add/remove component groups being strings * - Add diagnosis for set_home_position * - Fixed entity based components not being diagnosed * - Added diagnosis for input_air_controlled * - Add error for old minecraft:fall_damage component * - Added info for when a state is never transitioned into * - Added check for particle type in durability sensor * - Add duplicate id check
- Loading branch information
Showing
13 changed files
with
146 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,31 @@ | ||
import { Minecraft } from "bc-minecraft-bedrock-types"; | ||
import { DiagnosticsBuilder } from "../../../../Types"; | ||
import { DiagnosticsBuilder, DiagnosticSeverity } from "../../../../Types"; | ||
import { diagnose_entity_property_usage } from "../../../BehaviorPack/Entity/properties"; | ||
|
||
export function diagnose_filter_property(filter: Minecraft.Filter.Filter, diagnoser: DiagnosticsBuilder) { | ||
const { test, domain, value } = filter; | ||
const { domain, value } = filter; | ||
|
||
if (!domain) return; | ||
|
||
const entities = diagnoser.context.getCache().behaviorPacks.entities; | ||
|
||
let diagnosed = false; | ||
|
||
entities.forEach((entity) => { | ||
if (entity.properties) { | ||
const property = entity.properties.find((property) => property.name === domain); | ||
if (property) { | ||
diagnose_entity_property_usage([property], test, value as string | number | boolean, "filter", diagnoser); | ||
diagnose_entity_property_usage([property], domain, value as string | number | boolean, "filter", diagnoser); | ||
diagnosed = true; | ||
} | ||
} | ||
}); | ||
|
||
// If no definition for it is found in any entity | ||
if (!diagnosed) diagnoser.add( | ||
`$filters/${domain}`, | ||
`Entity property definition for "${domain}" not found`, | ||
DiagnosticSeverity.error, | ||
"behaviorpack.entity.property.unknown_property" | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters