From afc6c287cd2ae78c0c341383669f075b6b82e0dc Mon Sep 17 00:00:00 2001
From: TPGamesNL <29547183+TPGamesNL@users.noreply.github.com>
Date: Mon, 30 Aug 2021 18:52:39 +0200
Subject: [PATCH] ExprElement converted expression (#4268)
---
.../njol/skript/expressions/ExprElement.java | 102 ++++++++++++------
src/main/java/ch/njol/util/StringUtils.java | 11 +-
2 files changed, 73 insertions(+), 40 deletions(-)
diff --git a/src/main/java/ch/njol/skript/expressions/ExprElement.java b/src/main/java/ch/njol/skript/expressions/ExprElement.java
index 6659499e556..2daecf559bb 100644
--- a/src/main/java/ch/njol/skript/expressions/ExprElement.java
+++ b/src/main/java/ch/njol/skript/expressions/ExprElement.java
@@ -25,93 +25,125 @@
import ch.njol.skript.doc.Since;
import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.ExpressionType;
+import ch.njol.skript.lang.Literal;
import ch.njol.skript.lang.SkriptParser.ParseResult;
import ch.njol.skript.lang.util.SimpleExpression;
import ch.njol.skript.util.LiteralUtils;
import ch.njol.util.Kleenean;
+import ch.njol.util.StringUtils;
import ch.njol.util.coll.CollectionUtils;
import org.bukkit.event.Event;
import org.eclipse.jdt.annotation.Nullable;
import java.lang.reflect.Array;
-import java.util.Iterator;
-/**
- * @author Peter Güttinger
- */
@Name("Element of")
@Description({"The first, last or a random element of a set, e.g. a list variable.",
"See also: random"})
@Examples("give a random element out of {free items::*} to the player")
@Since("2.0")
public class ExprElement extends SimpleExpression