mirror of
https://github.com/BentoBoxWorld/Level.git
synced 2024-12-19 23:57:36 +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.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.eclipse.jdt.annotation.NonNull;
|
import org.eclipse.jdt.annotation.NonNull;
|
||||||
import org.eclipse.jdt.annotation.Nullable;
|
import org.eclipse.jdt.annotation.Nullable;
|
||||||
@ -201,7 +202,7 @@ public class Level extends Addon {
|
|||||||
registerRequestHandler(new TopTenRequestHandler(this));
|
registerRequestHandler(new TopTenRequestHandler(this));
|
||||||
|
|
||||||
// Check if WildStackers is enabled on the server
|
// 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
|
// I only added support for counting blocks into the island level
|
||||||
// Someone else can PR if they want spawners added to the Leveling system :)
|
// Someone else can PR if they want spawners added to the Leveling system :)
|
||||||
CalcIslandLevel.stackersEnabled = true;
|
CalcIslandLevel.stackersEnabled = true;
|
||||||
|
@ -111,6 +111,9 @@ public class LevelTest {
|
|||||||
private World world;
|
private World world;
|
||||||
private UUID uuid;
|
private UUID uuid;
|
||||||
|
|
||||||
|
@Mock
|
||||||
|
private PluginManager pim;
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void beforeClass() throws IOException {
|
public static void beforeClass() throws IOException {
|
||||||
jFile = new File("addon.jar");
|
jFile = new File("addon.jar");
|
||||||
@ -135,7 +138,6 @@ public class LevelTest {
|
|||||||
/**
|
/**
|
||||||
* @throws java.lang.Exception
|
* @throws java.lang.Exception
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
// Set up plugin
|
// Set up plugin
|
||||||
@ -217,6 +219,7 @@ public class LevelTest {
|
|||||||
UnsafeValues unsafe = mock(UnsafeValues.class);
|
UnsafeValues unsafe = mock(UnsafeValues.class);
|
||||||
when(unsafe.getDataVersion()).thenReturn(777);
|
when(unsafe.getDataVersion()).thenReturn(777);
|
||||||
when(Bukkit.getUnsafe()).thenReturn(unsafe);
|
when(Bukkit.getUnsafe()).thenReturn(unsafe);
|
||||||
|
when(Bukkit.getPluginManager()).thenReturn(pim);
|
||||||
|
|
||||||
// placeholders
|
// placeholders
|
||||||
when(plugin.getPlaceholdersManager()).thenReturn(phm);
|
when(plugin.getPlaceholdersManager()).thenReturn(phm);
|
||||||
|
Loading…
Reference in New Issue
Block a user