Skip to content

Commit

Permalink
Fix tests and update API requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Nov 10, 2024
1 parent deda533 commit 52c12e2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 15 deletions.
3 changes: 2 additions & 1 deletion src/main/java/world/bentobox/limits/Limits.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.stream.Collectors;

import org.bukkit.Material;
import org.bukkit.Registry;
import org.bukkit.World;
import org.bukkit.entity.EntityType;
import org.eclipse.jdt.annotation.Nullable;
Expand Down Expand Up @@ -137,7 +138,7 @@ public JoinListener getJoinListener() {

private void registerPlaceholders(GameModeAddon gm) {
if (getPlugin().getPlaceholdersManager() == null) return;
Arrays.stream(Material.values())
Registry.MATERIAL.stream()
.filter(Material::isBlock)
.forEach(m -> registerCountAndLimitPlaceholders(m, gm));

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/addon.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Limits
main: world.bentobox.limits.Limits
version: ${version}${build.number}
api-version: 2.3.0
api-version: 2.7.1

authors: tastybento

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: BentoBox-Limits
main: world.bentobox.limits.LimitsPladdon
version: ${project.version}${build.number}
api-version: "1.19"
api-version: "1.21"

authors: [tastybento]
contributors: ["The BentoBoxWorld Community"]
Expand Down
12 changes: 0 additions & 12 deletions src/test/java/world/bentobox/limits/LimitsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Ignore;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
Expand Down Expand Up @@ -268,7 +265,6 @@ private static void deleteAll(File file) throws IOException {
* Test method for {@link world.bentobox.limits.Limits#onEnable()}.
*/
@Test
@Ignore
public void testOnEnable() {
addon.onEnable();
File f = new File("config.yml");
Expand All @@ -288,7 +284,6 @@ public void testOnDisable() {
* Test method for {@link world.bentobox.limits.Limits#getSettings()}.
*/
@Test
@Ignore
public void testGetSettings() {
assertNull(addon.getSettings());
addon.onEnable();
Expand All @@ -300,7 +295,6 @@ public void testGetSettings() {
* Test method for {@link world.bentobox.limits.Limits#getGameModes()}.
*/
@Test
@Ignore
public void testGetGameModes() {
assertTrue(addon.getGameModes().isEmpty());
addon.onEnable();
Expand All @@ -311,7 +305,6 @@ public void testGetGameModes() {
* Test method for {@link world.bentobox.limits.Limits#getBlockLimitListener()}.
*/
@Test
@Ignore
public void testGetBlockLimitListener() {
assertNull(addon.getBlockLimitListener());
addon.onEnable();
Expand All @@ -322,7 +315,6 @@ public void testGetBlockLimitListener() {
* Test method for {@link world.bentobox.limits.Limits#inGameModeWorld(org.bukkit.World)}.
*/
@Test
@Ignore
public void testInGameModeWorld() {
addon.onEnable();
assertFalse(addon.inGameModeWorld(world));
Expand All @@ -334,7 +326,6 @@ public void testInGameModeWorld() {
* Test method for {@link world.bentobox.limits.Limits#getGameModeName(org.bukkit.World)}.
*/
@Test
@Ignore
public void testGetGameModeName() {
when(gameMode.inWorld(world)).thenReturn(true);
assertTrue(addon.getGameModeName(world).isEmpty());
Expand All @@ -346,7 +337,6 @@ public void testGetGameModeName() {
* Test method for {@link world.bentobox.limits.Limits#getGameModePermPrefix(org.bukkit.World)}.
*/
@Test
@Ignore
public void testGetGameModePermPrefix() {
when(gameMode.inWorld(world)).thenReturn(true);
addon.onEnable();
Expand All @@ -357,7 +347,6 @@ public void testGetGameModePermPrefix() {
* Test method for {@link world.bentobox.limits.Limits#isCoveredGameMode(java.lang.String)}.
*/
@Test
@Ignore
public void testIsCoveredGameMode() {
assertFalse(addon.isCoveredGameMode("BSkyBlock"));
addon.onEnable();
Expand All @@ -368,7 +357,6 @@ public void testIsCoveredGameMode() {
* Test method for {@link world.bentobox.limits.Limits#getJoinListener()}.
*/
@Test
@Ignore
public void testGetJoinListener() {
assertNull(addon.getJoinListener());
addon.onEnable();
Expand Down

0 comments on commit 52c12e2

Please sign in to comment.