Przeglądaj źródła

added getLong for configs, printStackTrace swapped for logger

Kajetan Johannes Hammerle 4 lat temu
rodzic
commit
a07ba2ebff

+ 6 - 1
src/me/hammerle/snuviscript/config/SnuviConfig.java

@@ -170,7 +170,7 @@ public class SnuviConfig
         }
         catch(ClassCastException ex)
         {
-            ex.printStackTrace();
+            print("invalid get", ex);
             return error;
         }
     }
@@ -195,6 +195,11 @@ public class SnuviConfig
         return get(key, Double.class, error);
     }
     
+    public final long getLong(String key, long error)
+    {
+        return get(key, Double.class, (double) error).longValue();
+    }
+    
     public final int getInt(String key, int error)
     {
         return get(key, Double.class, (double) error).intValue();

+ 1 - 1
test/test.test

@@ -1 +1 @@
-print(5 + -1 * 6);
+print("Wusi");