mirror of
https://github.com/Minestom/Minestom.git
synced 2024-09-29 23:17:59 +02:00
Deprecate Arguments#getObject
This commit is contained in:
parent
0ce88102ed
commit
2547972459
@ -42,6 +42,13 @@ public final class Arguments {
|
||||
return (T) getObject(argument.getId());
|
||||
}
|
||||
|
||||
public <T> T get(@NotNull String identifier) {
|
||||
return (T) args.computeIfAbsent(identifier, s -> {
|
||||
throw new NullPointerException(
|
||||
"The argument with the id '" + identifier + "' has no value assigned, be sure to check your arguments id, your syntax, and that you do not change the argument id dynamically.");
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use {@link #get(Argument)}.
|
||||
*/
|
||||
@ -244,6 +251,10 @@ public final class Arguments {
|
||||
return (RelativeVec) getObject(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use {@link #get(String)}.
|
||||
*/
|
||||
@Deprecated
|
||||
@NotNull
|
||||
public Object getObject(@NotNull String id) {
|
||||
return args.computeIfAbsent(id, s -> {
|
||||
|
Loading…
Reference in New Issue
Block a user