Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
095494dd2e | ||
|
|
fd92645500 | ||
|
|
1a6ac29083 |
@@ -17,6 +17,13 @@ import java.util.function.Supplier;
|
|||||||
* @param <T> The type of integration.
|
* @param <T> The type of integration.
|
||||||
*/
|
*/
|
||||||
public class IntegrationRegistry<T extends Integration> extends Registry<T> {
|
public class IntegrationRegistry<T extends Integration> extends Registry<T> {
|
||||||
|
/**
|
||||||
|
* Create a new integration registry.
|
||||||
|
*/
|
||||||
|
public IntegrationRegistry() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @NotNull T register(@NotNull final T element) {
|
public @NotNull T register(@NotNull final T element) {
|
||||||
return executeSafely(() -> super.register(element), element);
|
return executeSafely(() -> super.register(element), element);
|
||||||
|
|||||||
@@ -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.PersistentDataKey
|
||||||
import com.willfp.eco.core.data.keys.PersistentDataKeyType
|
import com.willfp.eco.core.data.keys.PersistentDataKeyType
|
||||||
import org.bukkit.NamespacedKey
|
import org.bukkit.NamespacedKey
|
||||||
|
import java.math.BigDecimal
|
||||||
|
|
||||||
object KeyRegistry {
|
object KeyRegistry {
|
||||||
private val registry = mutableMapOf<NamespacedKey, PersistentDataKey<*>>()
|
private val registry = mutableMapOf<NamespacedKey, PersistentDataKey<*>>()
|
||||||
@@ -44,6 +45,9 @@ object KeyRegistry {
|
|||||||
PersistentDataKeyType.CONFIG -> if (default !is Config) {
|
PersistentDataKeyType.CONFIG -> if (default !is Config) {
|
||||||
throw IllegalArgumentException("Invalid Data Type! Should be Config")
|
throw IllegalArgumentException("Invalid Data Type! Should be Config")
|
||||||
}
|
}
|
||||||
|
PersistentDataKeyType.BIG_DECIMAL -> if (default !is BigDecimal) {
|
||||||
|
throw IllegalArgumentException("Invalid Data Type! Should be BigDecimal")
|
||||||
|
}
|
||||||
|
|
||||||
else -> throw NullPointerException("Null value found!")
|
else -> throw NullPointerException("Null value found!")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version = 6.60.0
|
version = 6.60.1
|
||||||
plugin-name = eco
|
plugin-name = eco
|
||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
Reference in New Issue
Block a user