From 803f99e8f085912003ed974e4fcaa6f6398e3654 Mon Sep 17 00:00:00 2001 From: gnembon Date: Thu, 16 Jul 2020 01:13:24 -0300 Subject: [PATCH] task types are reported properly. --- docs/scarpet/Full.md | 3 ++- docs/scarpet/language/SystemFunctions.md | 3 ++- src/main/java/carpet/script/value/ThreadValue.java | 6 ++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/scarpet/Full.md b/docs/scarpet/Full.md index f9aae4b8..17b9f7b9 100644 --- a/docs/scarpet/Full.md +++ b/docs/scarpet/Full.md @@ -673,7 +673,8 @@ Returns the deep copy of the expression. Can be used to copy mutable objects, li ### `type(expr)` Returns the string value indicating type of the expression. Possible outcomes -are `null, number, string, list, iterator`, as well as minecraft related concepts like `block, entity, nbt` +are `null`, `number`, `string`, `list`, `map`, `iterator`, `function`, `task`, +as well as minecraft related concepts like `block`, `entity`, `nbt`, `text` ### `bool(expr)` diff --git a/docs/scarpet/language/SystemFunctions.md b/docs/scarpet/language/SystemFunctions.md index 0e0eefc8..504d20a9 100644 --- a/docs/scarpet/language/SystemFunctions.md +++ b/docs/scarpet/language/SystemFunctions.md @@ -9,7 +9,8 @@ Returns the deep copy of the expression. Can be used to copy mutable objects, li ### `type(expr)` Returns the string value indicating type of the expression. Possible outcomes -are `null, number, string, list, iterator`, as well as minecraft related concepts like `block, entity, nbt` +are `null`, `number`, `string`, `list`, `map`, `iterator`, `function`, `task`, +as well as minecraft related concepts like `block`, `entity`, `nbt`, `text` ### `bool(expr)` diff --git a/src/main/java/carpet/script/value/ThreadValue.java b/src/main/java/carpet/script/value/ThreadValue.java index e4ee5d50..45cecceb 100644 --- a/src/main/java/carpet/script/value/ThreadValue.java +++ b/src/main/java/carpet/script/value/ThreadValue.java @@ -151,4 +151,10 @@ public class ThreadValue extends Value if (!force) throw new NBTSerializableValue.IncompatibleTypeException(this); return getValue().toTag(true); } + + @Override + public String getTypeString() + { + return "task"; + } }