Browse Source

More parsing work.

combat-2
MagicBot 9 months ago
parent
commit
db94673256
  1. 5
      src/engine/objects/ItemTemplate.java

5
src/engine/objects/ItemTemplate.java

@ -24,6 +24,7 @@ public class ItemTemplate {
// Template Properties // Template Properties
public String obj_name; public String obj_name;
public boolean obj_pickable;
public Vector3fImmutable obj_scale; public Vector3fImmutable obj_scale;
public Vector3fImmutable obj_forward_vector; public Vector3fImmutable obj_forward_vector;
public Vector3fImmutable obj_default_alignment; public Vector3fImmutable obj_default_alignment;
@ -83,6 +84,10 @@ public class ItemTemplate {
obj_name = (String) jsonObject.get("obj_name"); obj_name = (String) jsonObject.get("obj_name");
// Reading a boolean
obj_pickable = (boolean) jsonObject.get("obj_pickable");
// Reading floats from an array (note always check for empty arrays) // Reading floats from an array (note always check for empty arrays)
JSONArray scaleData = (JSONArray) jsonObject.get("obj_scale"); JSONArray scaleData = (JSONArray) jsonObject.get("obj_scale");

Loading…
Cancel
Save