Skip to content

Commit

Permalink
Fixed PersistentDataKeyType.BIG_DECIMAL and javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
WillFP committed May 17, 2023
1 parent fd92645 commit 095494d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@
* @param <T> The type of integration.
*/
public class IntegrationRegistry<T extends Integration> extends Registry<T> {
/**
* Create a new integration registry.
*/
public IntegrationRegistry() {
super();
}

@Override
public @NotNull T register(@NotNull final T element) {
return executeSafely(() -> super.register(element), element);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import com.willfp.eco.core.config.interfaces.Config
import com.willfp.eco.core.data.keys.PersistentDataKey
import com.willfp.eco.core.data.keys.PersistentDataKeyType
import org.bukkit.NamespacedKey
import java.math.BigDecimal

object KeyRegistry {
private val registry = mutableMapOf<NamespacedKey, PersistentDataKey<*>>()
Expand Down Expand Up @@ -45,7 +46,7 @@ object KeyRegistry {
throw IllegalArgumentException("Invalid Data Type! Should be Config")
}
PersistentDataKeyType.BIG_DECIMAL -> if (default !is BigDecimal) {
throw IllegalArgumentException("Invalid Data Type! Should be Config")
throw IllegalArgumentException("Invalid Data Type! Should be BigDecimal")
}

else -> throw NullPointerException("Null value found!")
Expand Down

0 comments on commit 095494d

Please sign in to comment.