Ivan Stamenov Posted September 11, 2021 Report Share Posted September 11, 2021 I am trying to create a block behaviour which will allow some blocks (e.g. chutes) to be rotated when right-clicked with empty hand. The problem is that method BlockBehavior.Initialize(JsonObject properties) no longer takes JsonObject as parameter (as stated by Tyron here). It is also not taking a string parameter, because the reworked code class BlockBehaviorRotatableByHand : BlockBehavior { protected bool VFlipApplicable = false; ........ public override void Initialize(string propertiesAtString) { base.Initialize(properties); //VFlipApplicable = properties["VFlipApplicable"].AsBool(false); VFlipApplicable = true; } } throws "[Error] [rotatablebyhand] src\rotatablebyhand.cs(110): 'RotatableByHandMod.BlockBehaviorRotatableByHand.Initialize(string)': no suitable method found to override [CS0115]". All the sample code in the wiki and the code available in GitHub still use the JsonObject thingy (e.g. "BehaviorFiniteSpreadingLiquid"). As I passionately hate and despise microsoft, I really don't want to install VS (damn, I mean VertigoStudio, not Vintage Story). Can a good soul help me by telling me what is/are the current parameters method BlockBehavior.Initialize() takes and, possibly, how can I extract the individual parameters there? Link to comment Share on other sites More sharing options...
Recommended Posts