Browse Source

added getLong for configs, printStackTrace swapped for logger

Kajetan Johannes Hammerle 4 years ago
parent
commit
a07ba2ebff
2 changed files with 7 additions and 2 deletions
  1. 6 1
      src/me/hammerle/snuviscript/config/SnuviConfig.java
  2. 1 1
      test/test.test

+ 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");