From 1b1b9af898e2bfa93dbf3dda1237d59375b6e7e8 Mon Sep 17 00:00:00 2001 From: Juliakn66 <117075450+Juliakn66@users.noreply.github.com> Date: Fri, 3 Feb 2023 15:38:10 +0100 Subject: [PATCH] refactoring: create new method getRandomMob() to LookaroundCommand.java --- .../org/bitbiome/commands/LookaroundCommand.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/bitbiome/commands/LookaroundCommand.java b/src/main/java/org/bitbiome/commands/LookaroundCommand.java index 49133ab..047119e 100644 --- a/src/main/java/org/bitbiome/commands/LookaroundCommand.java +++ b/src/main/java/org/bitbiome/commands/LookaroundCommand.java @@ -34,12 +34,8 @@ public class LookaroundCommand implements CommandAPI{ ArrayList foundMobs = location.getMobList(); foundMobs.removeAll(foundMobs); foundItems = getRandomItem(randomNumberItems, random, items, foundItems); + foundMobs = getRandomMob(randomNumberMobs,random,mobs,foundMobs); - for (int i=0; i getRandomMob(int randomNumberMobs, Random random, JSONArray mobs, ArrayList foundMobs){ + for (int i=0; i