⚡ Some small changes
This commit is contained in:
parent
26f11e3a7e
commit
f7c00244e7
6 changed files with 18 additions and 26 deletions
|
|
@ -24,8 +24,7 @@
|
|||
package cloud.commandframework.bukkit;
|
||||
|
||||
import cloud.commandframework.meta.SimpleCommandMeta;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
public class BukkitCommandMeta extends SimpleCommandMeta {
|
||||
|
||||
|
|
@ -34,7 +33,7 @@ public class BukkitCommandMeta extends SimpleCommandMeta {
|
|||
*
|
||||
* @param simpleCommandMeta Simple command meta data instance that gets mirrored
|
||||
*/
|
||||
public BukkitCommandMeta(@Nonnull final SimpleCommandMeta simpleCommandMeta) {
|
||||
public BukkitCommandMeta(@NonNull final SimpleCommandMeta simpleCommandMeta) {
|
||||
super(simpleCommandMeta.getAll());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,8 +24,7 @@
|
|||
package cloud.commandframework.bukkit;
|
||||
|
||||
import cloud.commandframework.meta.CommandMeta;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
public final class BukkitCommandMetaBuilder {
|
||||
|
||||
|
|
@ -37,8 +36,7 @@ public final class BukkitCommandMetaBuilder {
|
|||
*
|
||||
* @return Builder instance
|
||||
*/
|
||||
@Nonnull
|
||||
public static BuilderStage1 builder() {
|
||||
public static @NonNull BuilderStage1 builder() {
|
||||
return new BuilderStage1();
|
||||
}
|
||||
|
||||
|
|
@ -54,8 +52,7 @@ public final class BukkitCommandMetaBuilder {
|
|||
* @param description Command description
|
||||
* @return Builder instance
|
||||
*/
|
||||
@Nonnull
|
||||
public BuilderStage2 withDescription(@Nonnull final String description) {
|
||||
public @NonNull BuilderStage2 withDescription(@NonNull final String description) {
|
||||
return new BuilderStage2(description);
|
||||
}
|
||||
|
||||
|
|
@ -66,7 +63,7 @@ public final class BukkitCommandMetaBuilder {
|
|||
|
||||
private final String description;
|
||||
|
||||
private BuilderStage2(@Nonnull final String description) {
|
||||
private BuilderStage2(@NonNull final String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
|
|
@ -75,8 +72,7 @@ public final class BukkitCommandMetaBuilder {
|
|||
*
|
||||
* @return Meta instance
|
||||
*/
|
||||
@Nonnull
|
||||
public BukkitCommandMeta build() {
|
||||
public @NonNull BukkitCommandMeta build() {
|
||||
return new BukkitCommandMeta(CommandMeta.simple().with("description", this.description).build());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,8 +25,7 @@ package cloud.commandframework.bukkit;
|
|||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
final class BukkitConsoleSender extends BukkitCommandSender {
|
||||
|
||||
|
|
@ -39,9 +38,8 @@ final class BukkitConsoleSender extends BukkitCommandSender {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Player asPlayer() {
|
||||
public @NonNull Player asPlayer() {
|
||||
throw new UnsupportedOperationException("Cannot convert console to player");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@ import org.bukkit.Bukkit;
|
|||
import org.bukkit.command.CommandMap;
|
||||
import org.bukkit.command.SimpleCommandMap;
|
||||
import org.bukkit.help.GenericCommandHelpTopic;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Collections;
|
||||
|
|
@ -51,7 +51,7 @@ class BukkitPluginRegistrationHandler<C> implements CommandRegistrationHandler {
|
|||
BukkitPluginRegistrationHandler() {
|
||||
}
|
||||
|
||||
void initialize(@Nonnull final BukkitCommandManager<C> bukkitCommandManager) throws Exception {
|
||||
void initialize(@NonNull final BukkitCommandManager<C> bukkitCommandManager) throws Exception {
|
||||
final Method getCommandMap = Bukkit.getServer().getClass().getDeclaredMethod("getCommandMap");
|
||||
getCommandMap.setAccessible(true);
|
||||
this.commandMap = (CommandMap) getCommandMap.invoke(Bukkit.getServer());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue