mirror of
https://github.com/BentoBoxWorld/Level.git
synced 2024-12-24 01:58:21 +01:00
Fix LevelTest
This commit is contained in:
parent
dad302a5fe
commit
82cbb487de
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user