Minor changes

Removed one unnecessary Exception
Fixed spelling
This commit is contained in:
NichtStudioCode 2021-01-28 17:26:47 +01:00
parent e4980188e2
commit ed64b2e60a
2 changed files with 3 additions and 3 deletions

@ -70,7 +70,7 @@ public abstract class BaseAnimation implements Animation {
@Override @Override
public void start() { public void start() {
task = Bukkit.getScheduler().runTaskTimer(InvGui.getInstance().getPlugin(), () -> { 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()) { if (getViewers().isEmpty()) {
noViewerTicks++; noViewerTicks++;
if (noViewerTicks > 3) { if (noViewerTicks > 3) {

@ -165,13 +165,13 @@ public abstract class BaseWindow implements Window, GUIParent {
@Override @Override
public void closeForViewer() { public void closeForViewer() {
closeable = true; 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 @Override
public void show() { public void show() {
if (closed) throw new IllegalStateException("The Window has already been closed."); 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(); Player viewer = getViewer();
if (viewer == null) throw new IllegalStateException("The player is not online."); if (viewer == null) throw new IllegalStateException("The player is not online.");