Registering a duplicate key will now replace the existing key
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user