public override void ToTreeAttributes(ITreeAttribute tree) { base.ToTreeAttributes(tree); tree.SetInt("maxCount", Data.MaxCount); tree.SetFloat("intervalHours", Data.InGameHourInterval); tree.SetDouble("lastSpawnTotalHours", lastSpawnTotalHours); tree["entityCodes"] = new StringArrayAttribute(Data.EntityCodes == null ? new string[0] : Data.EntityCodes); tree.SetInt("x1", Data.SpawnArea.X1); tree.SetInt("y1", Data.SpawnArea.Y1); tree.SetInt("z1", Data.SpawnArea.Z1); tree.SetInt("x2", Data.SpawnArea.X2); tree.SetInt("y2", Data.SpawnArea.Y2); tree.SetInt("z2", Data.SpawnArea.Z2); tree.SetInt("spawnCount", Data.RemoveAfterSpawnCount); tree.SetBool("spawnOnlyAfterImport", Data.SpawnOnlyAfterImport); tree.SetInt("initialQuantitySpawned", Data.InitialQuantitySpawned); tree.SetInt("initialSpawnQuantity", Data.InitialSpawnQuantity); tree.SetInt("groupSize", Data.GroupSize); tree.SetBool("wasImported", Data.WasImported); tree["spawnedEntities"] = new LongArrayAttribute(this.spawnedEntities.ToArray()); }
public override void ToTreeAttributes(ITreeAttribute tree) { base.ToTreeAttributes(tree); StringArrayAttribute attr = new StringArrayAttribute(); string[] materialCodes = new string[MaterialIds.Length]; for (int i = 0; i < MaterialIds.Length; i++) { materialCodes[i] = api.World.Blocks[MaterialIds[i]].Code.ToString(); } attr.value = materialCodes; tree["materials"] = attr; tree["cuboids"] = new IntArrayAttribute(VoxelCuboids.ToArray()); tree.SetString("blockName", blockName); }