Fix LevelTest

This commit is contained in:
tastybento 2020-02-01 19:56:28 -08:00
parent dad302a5fe
commit 82cbb487de
2 changed files with 6 additions and 2 deletions

View File

@ -5,6 +5,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
@ -201,7 +202,7 @@ public class Level extends Addon {
registerRequestHandler(new TopTenRequestHandler(this));
// Check if WildStackers is enabled on the server
if (getPlugin().getServer().getPluginManager().getPlugin("WildStacker") != null) {
if (Bukkit.getPluginManager().getPlugin("WildStacker") != null) {
// I only added support for counting blocks into the island level
// Someone else can PR if they want spawners added to the Leveling system :)
CalcIslandLevel.stackersEnabled = true;

View File

@ -111,6 +111,9 @@ public class LevelTest {
private World world;
private UUID uuid;
@Mock
private PluginManager pim;
@BeforeClass
public static void beforeClass() throws IOException {
jFile = new File("addon.jar");
@ -135,7 +138,6 @@ public class LevelTest {
/**
* @throws java.lang.Exception
*/
@SuppressWarnings("deprecation")
@Before
public void setUp() throws Exception {
// Set up plugin
@ -217,6 +219,7 @@ public class LevelTest {
UnsafeValues unsafe = mock(UnsafeValues.class);
when(unsafe.getDataVersion()).thenReturn(777);
when(Bukkit.getUnsafe()).thenReturn(unsafe);
when(Bukkit.getPluginManager()).thenReturn(pim);
// placeholders
when(plugin.getPlaceholdersManager()).thenReturn(phm);