internal void Patch(ItemTypes itemType) { string name = this.GetType().Assembly.GetName().Name; Logger.Log(Logger.Level.Info, $"Received Custom {itemType} pack from '{name}'"); // Check for required data string errors = string.Empty; if (this.EnergyCapacity <= 0) { errors += "Missing required data 'EnergyCapacity" + Environment.NewLine; } if (string.IsNullOrEmpty(this.ID)) { errors += "Missing required data 'ID'" + Environment.NewLine; } if (string.IsNullOrEmpty(this.Name)) { errors += "Missing required data 'Name'" + Environment.NewLine; } if (string.IsNullOrEmpty(this.FlavorText)) { errors += "Missing required data 'FlavorText'"; } if (!string.IsNullOrEmpty(errors)) { string msg = "Unable to patch:" + Environment.NewLine + errors; Logger.Log(Logger.Level.Error, msg); throw new InvalidOperationException(msg); } // Prepare var item = new CustomItem(this, itemType) { PluginPackName = name, FriendlyName = this.Name, Description = this.FlavorText, PowerCapacity = this.EnergyCapacity, RequiredForUnlock = this.UnlocksWith, Parts = this.CraftingMaterials }; // Patch item.Patch(); _techType = item.TechType; }