Add explicit nullability check for command getter
This commit is contained in:
parent
259c53c0eb
commit
ebdc520ca7
@ -6,6 +6,7 @@ import dev.w1zzrd.logging.LoggerFactory;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public class InvTweaksPlugin extends JavaPlugin {
|
||||
@ -17,7 +18,7 @@ public class InvTweaksPlugin extends JavaPlugin {
|
||||
public void onEnable() {
|
||||
logger.info("Inventory Tweaks enabled");
|
||||
|
||||
getCommand("sort").setExecutor(new SortCommandExecutor());
|
||||
Objects.requireNonNull(getCommand("sort")).setExecutor(new SortCommandExecutor());
|
||||
|
||||
getServer().getPluginManager().registerEvents(new StackReplaceListener(), this);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user