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 * @param implementation the implementation to set
*/ */
public static void setImplementation(SkyBlock implementation) { public static void setImplementation(SkyBlock implementation) throws IllegalStateException {
if (SkyBlockAPI.implementation != null) { if (SkyBlockAPI.implementation != null && SkyBlockAPI.implementation != implementation) {
throw new IllegalArgumentException("Cannot set API implementation twice"); throw new IllegalStateException("Cannot set API implementation twice");
} }
SkyBlockAPI.implementation = implementation; SkyBlockAPI.implementation = implementation;