001package com.ericlam.mc.minigames.core.exception; 002 003import org.bukkit.Bukkit; 004 005public class GameRunException extends RuntimeException { 006 007 private boolean shutdown; 008 009 public GameRunException(String errorMessage, boolean shutdown) { 010 super(errorMessage); 011 this.shutdown = shutdown; 012 } 013 014 @Override 015 public synchronized Throwable getCause() { 016 if (shutdown) Bukkit.getServer().shutdown(); 017 return super.getCause(); 018 } 019}