Beispiel #1
0
 public static void AfterAddingBaseTypes()
 {
     ItemTypesServer.AddTextureMapping(JOB_ITEM_KEY, new JSONNode()
                                       .SetAs("albedo", Path.Combine(RelativeTexturesPath, "anvil"))
                                       .SetAs("normal", "neutral")
                                       .SetAs("emissive", "neutral")
                                       .SetAs("height", "neutral")
                                       );
     ItemTypes.AddRawType(JOB_ITEM_KEY, new JSONNode(NodeType.Object)
                          .SetAs("onPlaceAudio", MOD_PREFIX + "anvilPlace")
                          .SetAs("onRemoveAudio", "woodDeleteHeavy")
                          .SetAs("npcLimit", 0)
                          .SetAs("icon", Path.Combine(RelativeIconsPath, "anvil.png"))
                          .SetAs("sideall", "SELF")
                          .SetAs("isRotatable", true)
                          .SetAs("rotatablex+", JOB_ITEM_KEY + "x+")
                          .SetAs("rotatablex-", JOB_ITEM_KEY + "x-")
                          .SetAs("rotatablez+", JOB_ITEM_KEY + "z+")
                          .SetAs("rotatablez-", JOB_ITEM_KEY + "z-")
                          );
     foreach (string xz in new string[] { "x+", "x-", "z+", "z-" })
     {
         ItemTypes.AddRawType(JOB_ITEM_KEY + xz, new JSONNode(NodeType.Object)
                              .SetAs("parentType", JOB_ITEM_KEY)
                              .SetAs("mesh", Path.Combine(RelativeMeshesPath, "anvil" + xz + ".obj"))
                              );
     }
     ItemTypes.AddRawType(JOB_TOOL_KEY, new JSONNode(NodeType.Object)
                          .SetAs("icon", Path.Combine(RelativeIconsPath, "sledge.png"))
                          .SetAs("isPlaceable", false)
                          .SetAs("npcLimit", 1)
                          );
 }
Beispiel #2
0
 public static void AfterAddingBaseTypes()
 {
     ItemTypes.AddRawType(JOB_ITEM_KEY,
                          new JSONNode(NodeType.Object)
                          .SetAs <int>("npcLimit", 1)
                          .SetAs("icon", Path.Combine(RelativeIconsPath, "buildtool.png"))
                          .SetAs <bool>("isPlaceable", false)
                          );
 }
Beispiel #3
0
 public static void AfterAddingBaseTypes()
 {
     ItemTypesServer.AddTextureMapping(SCAFFOLD_ITEM_TYPE, new JSONNode()
                                       .SetAs("albedo", MultiPath.Combine(ConstructionModEntries.RelativeTexturesPath, "albedo", "scaffold"))
                                       .SetAs("normal", "neutral")
                                       .SetAs("emissive", "neutral")
                                       .SetAs("height", "neutral")
                                       );
     ItemTypes.AddRawType(SCAFFOLD_ITEM_TYPE, new JSONNode(NodeType.Object)
                          .SetAs("sideall", SCAFFOLD_ITEM_TYPE)
                          .SetAs("onRemove", new JSONNode(NodeType.Array))
                          .SetAs("isSolid", false)
                          .SetAs("destructionTime", 100)
                          );
 }
Beispiel #4
0
 public static void AfterAddingBaseTypes()
 {
     ItemTypesServer.AddTextureMapping(ConstructionModEntries.MOD_PREFIX + "architecttop", new JSONNode()
                                       .SetAs("albedo", MultiPath.Combine(ConstructionModEntries.RelativeTexturesPath, "albedo", "architectTop"))
                                       .SetAs("normal", "neutral")
                                       .SetAs("emissive", "neutral")
                                       .SetAs("height", "neutral")
                                       );
     ItemTypes.AddRawType(JOB_ITEM_KEY, new JSONNode(NodeType.Object)
                          .SetAs("icon", Path.Combine(ConstructionModEntries.RelativeIconsPath, "architect.png"))
                          .SetAs("onPlaceAudio", "woodPlace")
                          .SetAs("onRemoveAudio", "woodDeleteLight")
                          .SetAs("sideall", "planks")
                          .SetAs("sidey+", ConstructionModEntries.MOD_PREFIX + "architecttop")
                          .SetAs("npcLimit", 0)
                          );
 }
Beispiel #5
0
        public static void AfterAddingBaseTypes()
        {
            Pipliz.Log.Write(string.Format("Blueprints relative texture path is {0}", ConstructionModEntries.RelativeTexturesPath));
            ItemTypesServer.AddTextureMapping(ConstructionModEntries.MOD_PREFIX + "blueprinttop", new JSONNode()
                                              .SetAs("albedo", MultiPath.Combine(ConstructionModEntries.RelativeTexturesPath, "albedo", "blueprintsTop"))
                                              .SetAs("normal", "neutral")
                                              .SetAs("emissive", "neutral")
                                              .SetAs("height", "neutral")
                                              );
            string iconFilepath = MultiPath.Combine(ConstructionModEntries.RelativeIconsPath, "blueprint.png");

            foreach (string blueprintTypename in ManagerBlueprints.blueprints.Keys)
            {
                ItemTypes.AddRawType(blueprintTypename,
                                     new JSONNode(NodeType.Object)
                                     .SetAs("onRemoveAudio", "woodDeleteLight")
                                     .SetAs("onPlaceAudio", "woodPlace")
                                     .SetAs("icon", iconFilepath)
                                     .SetAs("sideall", "planks")
                                     .SetAs("sidey+", ConstructionModEntries.MOD_PREFIX + "blueprinttop")
                                     .SetAs("npcLimit", "0")
                                     .SetAs("isRotatable", "true")
                                     .SetAs("rotatablex+", blueprintTypename + "x+")
                                     .SetAs("rotatablex-", blueprintTypename + "x-")
                                     .SetAs("rotatablez+", blueprintTypename + "z+")
                                     .SetAs("rotatablez-", blueprintTypename + "z-")
                                     );
                ItemTypes.AddRawType(blueprintTypename + "x+",
                                     new JSONNode(NodeType.Object)
                                     .SetAs("parentType", blueprintTypename)
                                     );
                ItemTypes.AddRawType(blueprintTypename + "x-",
                                     new JSONNode(NodeType.Object)
                                     .SetAs("parentType", blueprintTypename)
                                     );
                ItemTypes.AddRawType(blueprintTypename + "z+",
                                     new JSONNode(NodeType.Object)
                                     .SetAs("parentType", blueprintTypename)
                                     );
                ItemTypes.AddRawType(blueprintTypename + "z-",
                                     new JSONNode(NodeType.Object)
                                     .SetAs("parentType", blueprintTypename)
                                     );
            }
        }
Beispiel #6
0
        public static void AfterAddingBaseTypes()
        {
            ItemTypesServer.AddTextureMapping(ConstructionModEntries.MOD_PREFIX + "capsuletop", new JSONNode()
                                              .SetAs("albedo", MultiPath.Combine(ConstructionModEntries.RelativeTexturesPath, "albedo", "capsulesTop"))
                                              .SetAs("normal", "neutral")
                                              .SetAs("emissive", "neutral")
                                              .SetAs("height", "neutral")
                                              );
            string iconFilepath = Path.Combine(ConstructionModEntries.RelativeIconsPath, "capsule.png");

            foreach (string blueprintTypename in ManagerBlueprints.blueprints.Keys)
            {
                ItemTypes.AddRawType(blueprintTypename + CAPSULE_SUFFIX,
                                     new JSONNode(NodeType.Object)
                                     .SetAs("onPlaceAudio", "woodPlace")
                                     .SetAs("icon", iconFilepath)
                                     .SetAs("sideall", "planks")
                                     .SetAs("sidey+", ConstructionModEntries.MOD_PREFIX + "capsuletop")
                                     .SetAs("isSolid", "false")
                                     .SetAs("isRotatable", "true")
                                     .SetAs("rotatablex+", blueprintTypename + CAPSULE_SUFFIX + "x+")
                                     .SetAs("rotatablex-", blueprintTypename + CAPSULE_SUFFIX + "x-")
                                     .SetAs("rotatablez+", blueprintTypename + CAPSULE_SUFFIX + "z+")
                                     .SetAs("rotatablez-", blueprintTypename + CAPSULE_SUFFIX + "z-")
                                     .SetAs("npcLimit", "0")
                                     );
                ItemTypes.AddRawType(blueprintTypename + CAPSULE_SUFFIX + "x+",
                                     new JSONNode(NodeType.Object)
                                     .SetAs("parentType", blueprintTypename + CAPSULE_SUFFIX)
                                     );
                ItemTypes.AddRawType(blueprintTypename + CAPSULE_SUFFIX + "x-",
                                     new JSONNode(NodeType.Object)
                                     .SetAs("parentType", blueprintTypename + CAPSULE_SUFFIX)
                                     );
                ItemTypes.AddRawType(blueprintTypename + CAPSULE_SUFFIX + "z+",
                                     new JSONNode(NodeType.Object)
                                     .SetAs("parentType", blueprintTypename + CAPSULE_SUFFIX)
                                     );
                ItemTypes.AddRawType(blueprintTypename + CAPSULE_SUFFIX + "z-",
                                     new JSONNode(NodeType.Object)
                                     .SetAs("parentType", blueprintTypename + CAPSULE_SUFFIX)
                                     );
            }
        }
Beispiel #7
0
        public static void processTypeRegistration()
        {
            List <string> CurrentRawTypes = ItemTypes.GetAllRawTypes();

            Helpers.Utilities.WriteLog("ColonyAPI", "Base Type Count: " + CurrentRawTypes.Count);

            if (rawTypeDict.Count > 0)
            {
                foreach (string typename in rawTypeDict.Keys)
                {
                    if (CurrentRawTypes.Contains(typename))
                    {
                        Helpers.Utilities.WriteLog("ColonyAPI", "Found duplicate type: " + typename);
                        ItemTypes.RemoveRawType(typename);
                    }
                    ItemTypes.AddRawType(typename, rawTypeDict[typename]);
                }
            }
        }
Beispiel #8
0
        // Add the block!
        public void Register()
        {
            //Utilities.WriteLog(this.TypeName);



            // Add the item
            ItemTypes.AddRawType(this.TypeName, this.node);

            // register with our tracker, just in case we need to get these later!
            Classes.Managers.TypeManager.AddedTypes.Add(this.TypeName);
            Classes.Managers.TypeManager.registerActionableTypeCallback(this);

            if (this._AllowCreative)
            {
                Classes.Managers.TypeManager.CreativeAddedTypes.Add(this.TypeName);
            }

            // Tell the user it was added
            Utilities.WriteLog("Added Type: " + this.TypeName, Helpers.Chat.ChatColour.green, Helpers.Chat.ChatStyle.italic);
        }
 public static void AfterAddingBaseTypes()
 {
     ItemTypesServer.AddTextureMapping(MOD_PREFIX + "bucketSide", new JSONNode()
                                       .SetAs("albedo", "furnaceSide")
                                       .SetAs("normal", "neutral")
                                       .SetAs("emissive", "neutral")
                                       .SetAs("height", "neutral")
                                       );
     ItemTypesServer.AddTextureMapping(MOD_PREFIX + "bucketemptytop", new JSONNode()
                                       .SetAs("albedo", Path.Combine(RelativeTexturesPath, "bucketEmptyTop"))
                                       .SetAs("normal", "furnaceUnlitTop")
                                       .SetAs("emissive", "neutral")
                                       .SetAs("height", "neutral")
                                       );
     ItemTypes.AddRawType(MOD_PREFIX + "bucket",
                          new JSONNode(NodeType.Object)
                          .SetAs("icon", Path.Combine(RelativeIconsPath, "bucket.png"))
                          .SetAs("maxStackSize", 5)
                          .SetAs("needsBase", "true")
                          .SetAs("npcLimit", 0)
                          .SetAs("sideall", MOD_PREFIX + "bucketSide")
                          .SetAs("sidey+", MOD_PREFIX + "bucketemptytop")
                          );
     ItemTypesServer.AddTextureMapping(MOD_PREFIX + "waterbucketfilledtop", new JSONNode()
                                       .SetAs("albedo", Path.Combine(RelativeTexturesPath, "waterbucketFilledTop"))
                                       .SetAs("normal", "furnaceUnlitTop")
                                       .SetAs("emissive", "neutral")
                                       .SetAs("height", "neutral")
                                       );
     ItemTypes.AddRawType(MOD_PREFIX + "waterbucket",
                          new JSONNode(NodeType.Object)
                          .SetAs("icon", Path.Combine(RelativeIconsPath, "waterbucket.png"))
                          .SetAs("maxStackSize", 5)
                          .SetAs("needsBase", "true")
                          .SetAs("npcLimit", 0)
                          .SetAs("sideall", MOD_PREFIX + "bucketSide")
                          .SetAs("sidey+", MOD_PREFIX + "waterbucketfilledtop")
                          );
 }
Beispiel #10
0
        // Add the block!
        public void Register()
        {
            // NOT YET IMPLEMENTED
            //ItemTypesServer.ItemActionBuilder builder = new ItemTypesServer.ItemActionBuilder().SetOnAdd(classes.typecodemanager.OnAdd).SetOnRemove(classes.typecodemanager.OnRemove);
            //.SetOnAdd(ExampleClassCodeManager.OnAdd)
            //    .SetOnRemove(ExampleClassCodeManager.OnRemove


            // Add the item
            ItemTypes.AddRawType(this.TypeName, this.node);

            // register with our tracker, just in case we need to get these later!
            Classes.Managers.TypeManager.AddedTypes.Add(this.TypeName);

            if (this._AllowCreative)
            {
                Classes.Managers.TypeManager.CreativeAddedTypes.Add(this.TypeName);
            }

            // Tell the user it was added
            //Utilities.WriteLog("Added Type: " + this.TypeName, Helpers.Chat.ChatColour.green, Helpers.Chat.ChatStyle.italic);
        }
Beispiel #11
0
        public static void AfterAddingBaseTypes()
        {
            ItemTypesServer.AddTextureMapping("ExampleBlock1", new JSONNode()
                                              .SetAs("albedo", "grassTemperate")
                                              .SetAs("normal", "stoneblock")
                                              .SetAs("emissive", "ovenLitFront")
                                              .SetAs("height", "oreCoal")
                                              );

            ItemTypesServer.AddTextureMapping("ExampleBlock2", new JSONNode()
                                              .SetAs("albedo", "grindstone")
                                              .SetAs("normal", "berrybush")
                                              .SetAs("emissive", "torch")
                                              .SetAs("height", "snow")
                                              );

            ItemTypes.AddRawType("ExampleBlock1",
                                 new JSONNode(NodeType.Object)
                                 .SetAs("onPlaceAudio", "stonePlace")
                                 .SetAs("onRemoveAudio", "woodDeleteLight")
                                 .SetAs("sideall", "SELF")
                                 .SetAs("onRemoveAmount", 2)
                                 .SetAs("maxStackSize", 500)
                                 .SetAs("npcLimit", 1000)
                                 );

            ItemTypes.AddRawType("ExampleBlock2",
                                 new JSONNode(NodeType.Object)
                                 .SetAs("onPlaceAudio", "stonePlace")
                                 .SetAs("onRemoveAudio", "woodDeleteLight")
                                 .SetAs("sideall", "SELF")
                                 .SetAs("onRemoveAmount", 2)
                                 .SetAs("maxStackSize", 500)
                                 .SetAs("npcLimit", 1000)
                                 );
        }