Added scarpet team functions (#569)

* Added team functions

* Docs for team functions

* Added team functions to editor keywords

* Added static method getPlayerNameByValue to EntityValue (also works with non existing players

Co-authored-by: gnembon <41132274+gnembon@users.noreply.github.com>
This commit is contained in:
replaceitemandgnembon authored and GitHub committed 2020-11-26 02:59:23 -04:00
1 parent 1fb4209a15
commit 210b0fc8ea
6 files changed
+357 -1

No files matched your search

@@ -143,6 +143,28 @@ public class EntityValue extends Value
return player;
}
public static String getPlayerNameByValue(Value value)
{
String playerName = null;
if (value instanceof EntityValue)
{
Entity e = ((EntityValue) value).getEntity();
if (e instanceof ServerPlayerEntity)
{
playerName = e.getEntityName();
}
}
else if (value.isNull())
{
return null;
}
else
{
playerName = value.getString();
}
return playerName;
}
@Override
public String getString()
{