Auto-registered PersistentDataKeys

This commit is contained in:
Auxilor
2021-11-01 21:01:57 +00:00
parent f615006b23
commit 0e439db7b3
2 changed files with 1 additions and 10 deletions

View File

@@ -42,18 +42,9 @@ public class PersistentDataKey<T> {
this.key = key;
this.defaultValue = defaultValue;
this.type = type;
}
/**
* Register the key with the server.
*
* @return The key, registered.
*/
public PersistentDataKey<T> register() {
Eco.getHandler().getKeyRegistry().registerKey(this);
return this;
}
@Override
public String toString() {
return "PersistentDataKey{"

View File

@@ -25,7 +25,7 @@ public class PlayerUtils {
NamespacedKeyUtils.createEcoKey("player_name"),
PersistentDataKeyType.STRING,
"Unknown Player"
).register();
);
/**
* Get the audience from a player.