Fix for API implementation

This commit is contained in:
Fabrizio La Rosa 2020-07-10 14:15:01 +02:00
parent ba6033c5fd
commit e599b735a8

View File

@ -25,9 +25,9 @@ public class SkyBlockAPI {
/**
* @param implementation the implementation to set
*/
public static void setImplementation(SkyBlock implementation) {
if (SkyBlockAPI.implementation != null) {
throw new IllegalArgumentException("Cannot set API implementation twice");
public static void setImplementation(SkyBlock implementation) throws IllegalStateException {
if (SkyBlockAPI.implementation != null && SkyBlockAPI.implementation != implementation) {
throw new IllegalStateException("Cannot set API implementation twice");
}
SkyBlockAPI.implementation = implementation;