From 91f58029b82f28f3e8547133d06aa298c21ef9c2 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sun, 4 Apr 2021 17:12:04 +0200 Subject: [PATCH] Fixing Rabbits --- src/de/steamwar/lobby/listener/RabbitListener.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/de/steamwar/lobby/listener/RabbitListener.java b/src/de/steamwar/lobby/listener/RabbitListener.java index 2a420a2..6d5f38b 100644 --- a/src/de/steamwar/lobby/listener/RabbitListener.java +++ b/src/de/steamwar/lobby/listener/RabbitListener.java @@ -42,6 +42,9 @@ public class RabbitListener implements Listener { World world = Bukkit.getWorlds().get(0); spreadRabbits(250, world); Bukkit.getScheduler().runTaskTimer(LobbySystem.getInstance(), () -> { + if(Bukkit.getOnlinePlayers().isEmpty()) { + return; + } Rabbit rabbit = world.getEntitiesByClass(Rabbit.class).iterator().next(); world.spawn(rabbit.getLocation(), Firework.class, firework -> { FireworkMeta meta = firework.getFireworkMeta();