As discussed in the past, PlanBuild currently can't detect when other mods like MoreVanillaBuildPrefabs add/remove pieces in-game. Rather than requiring PlanBuild to constantly rescan pieces the idea of simply exposing the ScanPieceTables methods through a public API was proposed to mods like MoreVanillaBuildPrefabs could update PlanBuild as needed and the onus of compatibility could be placed on mods that add/remove pieces while in-game.
This PR adds a public API method to the main plugin that simply calls PlanDB.Instance.ScanPieceTables and I also rewrote the method ScanPieceTables to separate the process of creating PlanPieces and the process of managing the PlanHammer piece table. This way PlanPieces are only ever created once and pre-existing PlanPieces are left alone when rescanning piece tables but the PlanHammer piece table can still be updated.
As discussed in the past,
PlanBuild
currently can't detect when other mods likeMoreVanillaBuildPrefabs
add/remove pieces in-game. Rather than requiringPlanBuild
to constantly rescan pieces the idea of simply exposing theScanPieceTables
methods through a public API was proposed to mods likeMoreVanillaBuildPrefabs
could updatePlanBuild
as needed and the onus of compatibility could be placed on mods that add/remove pieces while in-game.This PR adds a public API method to the main plugin that simply calls
PlanDB.Instance.ScanPieceTables
and I also rewrote the methodScanPieceTables
to separate the process of creating PlanPieces and the process of managing the PlanHammer piece table. This way PlanPieces are only ever created once and pre-existing PlanPieces are left alone when rescanning piece tables but the PlanHammer piece table can still be updated.