add patch for negative infinity and infinity attributes causing disconnect

This commit is contained in:
Lemon
2018-07-21 21:34:34 +05:00
committed by GitHub
parent f0a9b6d747
commit 301c5b8da1
7 changed files with 422 additions and 0 deletions

View File

@ -0,0 +1,21 @@
package ca.momothereal.mojangson;
import ca.momothereal.mojangson.ex.MojangsonParseException;
import ca.momothereal.mojangson.value.*;
import static ca.momothereal.mojangson.MojangsonToken.*;
public class MojangsonFinder {
/**
* Automatically detects the appropriate MojangsonValue from the given value.
* @param value The value to parse
* @return The resulting MojangsonValue. If the type couldn't be found, it falls back to MojangsonString
* @throws MojangsonParseException if the given value could not be parsed
*/
public static MojangsonValue readFromValue(String value) throws MojangsonParseException {
MojangsonValue val = new MojangsonString();
val.read(value);
return val;
}
}