Registering a duplicate key will now replace the existing key

This commit is contained in:
Auxilor
2021-11-01 15:51:22 +00:00
parent 63ee83c795
commit d34e43797d

View File

@@ -13,7 +13,7 @@ class EcoKeyRegistry(
override fun registerKey(key: PersistentDataKey<*>) {
if (this.registry.containsKey(key.key)) {
throw IllegalArgumentException("Key is already registered!")
this.registry.remove(key.key)
}
validateKey(key)