From 3608c32d873564ed15c10b0c313028e325d4e368 Mon Sep 17 00:00:00 2001 From: DanMB Date: Wed, 6 Jul 2022 15:51:25 -0700 Subject: [PATCH] Add if missing bools --- src/main/java/Amulet/extensions/java/util/List/XList.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/Amulet/extensions/java/util/List/XList.java b/src/main/java/Amulet/extensions/java/util/List/XList.java index 2c52e86..1728ef1 100644 --- a/src/main/java/Amulet/extensions/java/util/List/XList.java +++ b/src/main/java/Amulet/extensions/java/util/List/XList.java @@ -60,11 +60,13 @@ public static E getRandom(@This List self) return self.getRandom(Random.r()); } - public static void addIfMissing(@This List self, E e) - { + public static boolean addIfMissing(@This List self, E e) { if(!self.contains(e)) { self.add(e); + return true; } + + return false; } public static @Self List where(@This List self, Predicate pred) {