🎨 Some codestyle fixes
This commit is contained in:
parent
9a35a873c0
commit
a6b98ca278
12 changed files with 76 additions and 28 deletions
|
|
@ -97,13 +97,14 @@ class PaperBrigadierListener<C> implements Listener {
|
|||
* @param playersOnly Whether the selector is for players only (true), or for all entities (false)
|
||||
* @return The NMS ArgumentType
|
||||
*/
|
||||
private Supplier<ArgumentType<?>> getEntitySelectorArgument(final boolean single, final boolean playersOnly) {
|
||||
private Supplier<ArgumentType<?>> getEntitySelectorArgument(final boolean single,
|
||||
final boolean playersOnly) {
|
||||
return () -> {
|
||||
try {
|
||||
Constructor<?> constructor = this.getNMSArgument("Entity").getDeclaredConstructors()[0];
|
||||
final Constructor<?> constructor = this.getNMSArgument("Entity").getDeclaredConstructors()[0];
|
||||
constructor.setAccessible(true);
|
||||
return (ArgumentType<?>) constructor.newInstance(single, playersOnly);
|
||||
} catch (Exception e) {
|
||||
} catch (final Exception e) {
|
||||
this.paperCommandManager.getOwningPlugin().getLogger().log(Level.INFO, "Failed to retrieve Selector Argument", e);
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue