From 80650878e4a68043f1d3bb73765bdccd54fa4b8c Mon Sep 17 00:00:00 2001 From: Riley <69326411+Mooy1@users.noreply.github.com> Date: Sun, 5 Sep 2021 14:00:25 -0500 Subject: [PATCH] prevent exception during tests --- pom.xml | 2 +- .../io/github/mooy1/infinitylib/commands/InfoCommand.java | 4 ++-- .../java/io/github/mooy1/infinitylib/core/AbstractAddon.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 8550b0f..35c1713 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ 4.0.0 io.github.mooy1 InfinityLib - 1.2.1 + 1.2.2 1.8 diff --git a/src/main/java/io/github/mooy1/infinitylib/commands/InfoCommand.java b/src/main/java/io/github/mooy1/infinitylib/commands/InfoCommand.java index 9e3de38..9d07a5e 100644 --- a/src/main/java/io/github/mooy1/infinitylib/commands/InfoCommand.java +++ b/src/main/java/io/github/mooy1/infinitylib/commands/InfoCommand.java @@ -1,7 +1,6 @@ package io.github.mooy1.infinitylib.commands; import java.util.List; -import java.util.Objects; import javax.annotation.ParametersAreNonnullByDefault; @@ -18,10 +17,11 @@ final class InfoCommand extends SubCommand { InfoCommand(SlimefunAddon addon) { super("info", "Gives addon and slimefun version and discord links"); + Slimefun slimefun = Slimefun.instance(); message = new String[] { "", ChatColors.color("&b" + addon.getName() + " Info"), - ChatColors.color("&bSlimefun Version: &7" + Objects.requireNonNull(Slimefun.instance()).getPluginVersion()), + ChatColors.color("&bSlimefun Version: &7" + (slimefun == null ? "null" : slimefun.getPluginVersion())), ChatColors.color("&bSlimefun Discord: &7Discord.gg/slimefun"), ChatColors.color("&bAddon Version: &7" + addon.getPluginVersion()), ChatColors.color("&bAddon Community: &7Discord.gg/SqD3gg5SAU"), diff --git a/src/main/java/io/github/mooy1/infinitylib/core/AbstractAddon.java b/src/main/java/io/github/mooy1/infinitylib/core/AbstractAddon.java index ebe1a1c..0bfc52a 100644 --- a/src/main/java/io/github/mooy1/infinitylib/core/AbstractAddon.java +++ b/src/main/java/io/github/mooy1/infinitylib/core/AbstractAddon.java @@ -66,7 +66,7 @@ public AbstractAddon(String githubUserName, String githubRepo, String autoUpdate /** * Addon Testing Constructor */ - protected AbstractAddon(JavaPluginLoader loader, PluginDescriptionFile description, File dataFolder, File file, + public AbstractAddon(JavaPluginLoader loader, PluginDescriptionFile description, File dataFolder, File file, String githubUserName, String githubRepo, String autoUpdateBranch, String autoUpdateKey) { this(loader, description, dataFolder, file, githubUserName, githubRepo, autoUpdateBranch, autoUpdateKey, Environment.TESTING); }