minor code improvements
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
Imports Newtonsoft.Json
|
||||
Imports Newtonsoft.Json.Converters
|
||||
Imports Newtonsoft.Json.Linq
|
||||
|
||||
Public Class ModpackInfo
|
||||
|
||||
@@ -12,11 +11,11 @@ Public Class ModpackInfo
|
||||
Public Property Version As Version
|
||||
|
||||
Public Sub Save(mcRoot As String)
|
||||
File.WriteAllText(GetFilePath(mcRoot), JObject.FromObject(Me).ToString)
|
||||
File.WriteAllText(GetFilePath(mcRoot), JsonConvert.SerializeObject(Me))
|
||||
End Sub
|
||||
|
||||
Public Shared Function Load(mcRoot As String) As ModpackInfo
|
||||
Return JObject.Parse(File.ReadAllText(GetFilePath(mcRoot))).ToObject(Of ModpackInfo)
|
||||
Return JsonConvert.DeserializeObject(Of ModpackInfo)(File.ReadAllText(GetFilePath(mcRoot)))
|
||||
End Function
|
||||
|
||||
Public Shared Function HasModpackInfo(mcRoot As String) As Boolean
|
||||
|
||||
Reference in New Issue
Block a user