diff --git a/src/main/java/de/studiocode/invgui/animation/impl/BaseAnimation.java b/src/main/java/de/studiocode/invgui/animation/impl/BaseAnimation.java index bc06e6e..1969e1d 100644 --- a/src/main/java/de/studiocode/invgui/animation/impl/BaseAnimation.java +++ b/src/main/java/de/studiocode/invgui/animation/impl/BaseAnimation.java @@ -70,7 +70,7 @@ public abstract class BaseAnimation implements Animation { @Override public void start() { task = Bukkit.getScheduler().runTaskTimer(InvGui.getInstance().getPlugin(), () -> { - // if there are now viewers for more than 3 ticks, the animation can be cancelled + // if there are no viewers for more than 3 ticks, the animation can be cancelled if (getViewers().isEmpty()) { noViewerTicks++; if (noViewerTicks > 3) { diff --git a/src/main/java/de/studiocode/invgui/window/impl/BaseWindow.java b/src/main/java/de/studiocode/invgui/window/impl/BaseWindow.java index 40002a3..d5348b4 100644 --- a/src/main/java/de/studiocode/invgui/window/impl/BaseWindow.java +++ b/src/main/java/de/studiocode/invgui/window/impl/BaseWindow.java @@ -165,13 +165,13 @@ public abstract class BaseWindow implements Window, GUIParent { @Override public void closeForViewer() { closeable = true; - new ArrayList<>(inventory.getViewers()).forEach(HumanEntity::closeInventory); // clone list to prevent ConcurrentModificationException + // clone list to prevent ConcurrentModificationException + new ArrayList<>(inventory.getViewers()).forEach(HumanEntity::closeInventory); } @Override public void show() { if (closed) throw new IllegalStateException("The Window has already been closed."); - if (inventory.getViewers().size() != 0) throw new IllegalStateException("A Window can only have one viewer."); Player viewer = getViewer(); if (viewer == null) throw new IllegalStateException("The player is not online.");