示例#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)
                          );
 }
示例#2
0
 /// <summary>
 /// Pretty self explanatory
 /// </summary>
 /// <param name="identifier">The name of the material (eg: "testmaterial")</param>
 /// <param name="albedo"></param>
 /// <param name="emissive"></param>
 /// <param name="height"></param>
 /// <param name="normal"></param>
 public static void createMaterial(string identifier, string albedo, string emissive, string height, string normal)
 {
     // Register it with the ItemTypesServer
     ItemTypesServer.AddTextureMapping(identifier, new JSONNode(NodeType.Object)
                                       .SetAs("albedo", albedo)
                                       .SetAs("emissive", emissive)
                                       .SetAs("height", height)
                                       .SetAs("normal", normal)
                                       );
     MatList.Add(identifier);
 }
示例#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)
                          );
 }
示例#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)
                          );
 }
示例#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)
                                     );
            }
        }
示例#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)
                                     );
            }
        }
 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")
                          );
 }
示例#8
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)
                                 );
        }