protected sealed override void PrepareTileRequirements(ConstructionTileRequirements tileRequirements) { var configBuild = new ConstructionStageConfig(); var configRepair = new ConstructionStageConfig(); var configUpgrade = new ConstructionUpgradeConfig(); tileRequirements.Add(ConstructionTileRequirements.ValidatorNotRestrictedArea) .Add(ConstructionTileRequirements.ValidatorNoNpcsAround) .Add(ConstructionTileRequirements.ValidatorNoPlayersNearby) .Add(LandClaimSystem.ValidatorIsOwnedOrFreeArea) .Add(LandClaimSystem.ValidatorNoRaid); this.PrepareConstructionConfig( tileRequirements, configBuild, configRepair, configUpgrade, out var category); configBuild.ApplyRates(StructureConstants.BuildItemsCountMultiplier); configUpgrade.ApplyRates(StructureConstants.BuildItemsCountMultiplier); configRepair.ApplyRates(StructureConstants.RepairItemsCountMultiplier); this.Category = category ?? throw new Exception( "Structure category is not set during " + nameof(this.PrepareConstructionConfig) + " call"); foreach (var upgradeEntry in configUpgrade.Entries) { if (upgradeEntry.RequiredItems.Count > 4) { // we don't allow more than 4 items for upgrades (the upgrade UI space is strictly limited) throw new Exception(this.ShortId + " requires more than 4 items to upgrade to " + upgradeEntry.ProtoStructure.ShortId + ". Max 4 items allowed"); } } if (configRepair.IsAllowed) { this.ValidateRepairConfig(configRepair, configBuild); } this.ConfigBuild = configBuild; this.ConfigRepair = configRepair; this.ConfigUpgrade = configUpgrade; }