| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- using UnityEngine;
- using GadgetCore.API;
- using GadgetCore.Util;
- namespace MonsterNests
- {
- [Gadget("MonsterNests")]
- public class MonsterNests : Gadget<MonsterNests>
- {
- public const string MOD_VERSION = "1.0"; // Set this to the version of your mod.
- public const string CONFIG_VERSION = "1.0"; // Increment this whenever you change your mod's config file.
- protected override void LoadConfig()
- {
- Config.Load();
- string fileVersion = Config.ReadString("ConfigVersion", CONFIG_VERSION, comments: "The Config Version (not to be confused with mod version)");
- if (fileVersion != CONFIG_VERSION)
- {
- Config.Reset();
- Config.WriteString("ConfigVersion", CONFIG_VERSION, comments: "The Config Version (not to be confused with mod version)");
- }
- Config.Save();
- }
- public override string GetModDescription()
- {
- return "A mod that adds some monster nests.";
- }
- protected override void Initialize()
- {
- Logger.Log("Monster Nests v" + Info.Mod.Version);
- Core.logger = Logger;
- Texture2D textureBugspotBig = GadgetCoreAPI.LoadTexture2D("bugspotBig.png");
- Texture2D textureSpiderEgg = GadgetCoreAPI.LoadTexture2D("spiderEgg.png");
- Texture2D textureGoldenShroom = GadgetCoreAPI.LoadTexture2D("goldenShroom.png");
- Core.objectBugspotBig = new ObjectInfo(ObjectType.BUGSPOT, new Item(31, 1, 0, 0, 0, new int[3], new int[3]), 22, textureBugspotBig).Register("bugspotBig");
- Core.objectSpiderEgg = new ObjectInfo(ObjectType.ORE, new Item(3, 1, 0, 0, 0, new int[3], new int[3]), 22, textureSpiderEgg).Register("spiderEgg");
- Core.objectGoldenShroom = new ObjectInfo(ObjectType.PLANT, new Item(12, 1, 0, 0, 0, new int[3], new int[3]), 22, textureGoldenShroom).Register("goldenShroom");
- //PlanetInfo planetInfo = PlanetRegistry.Singleton[0];
- //planetInfo.AddWeightedWorldSpawn(objectBugspotBig, 10);
- //planetInfo.AddWeightedWorldSpawn(objectGoldenShroom, 10);
- /*
- GameObject enemy = GadgetCoreAPI.GetEntityResource("");
- new EntityInfo(EntityType.COMMON, objectSpaceOreBig.Object, new int[] { 0 }).Register("");
- */
- /*
- ((CraftMenuInfo)MenuRegistry.Singleton["Gadget Core:Crafter Menu"]).AddCraftPerformer(CraftMenuInfo.CreateSimpleCraftPerformer(
- Tuple.Create(new int[] { 11, 11, 11 }, new Item(11, 2, 0, 0, 0, new int[3], new int[3]), 2)
- ));
- */
- }
- }
- }
|