demodude4u / Factorio-FBSR

Factorio Blueprint String Renderer
MIT License
80 stars 21 forks source link

Cannot handle entity positions defined as arrays instead of dictionaries #143

Open Bilka2 opened 2 months ago

Bilka2 commented 2 months ago

The game accepts positions as [a, b] and {x:a, y:b}. The bot only accepts {x:a, y:b}. It should also accept the array format.

org.json.JSONException: JSONObject["position"] is not a JSONObject (class org.json.JSONArray).
at org.json.JSONObject.wrongValueFormatException(JSONObject.java:2698)
at org.json.JSONObject.getJSONObject(JSONObject.java:784)
at com.demod.fbsr.BlueprintEntity.<init>(BlueprintEntity.java:23)
at com.demod.fbsr.Blueprint.lambda$0(Blueprint.java:32)
at com.demod.factorio.Util
s.forEach(Utils.java:135)
at com.demod.fbsr.Blueprint.<init>(Blueprint.java:31)
at com.demod.fbsr.BlueprintStringData.<init>(BlueprintStringData.java:86)

Example blueprint string made with external tool