diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9e16544..b9cf60c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,10 +14,10 @@ jobs: - uses: actions/checkout@v2 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Set up JDK 11 + - name: Set up JDK 16 uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 16 - name: Cache SonarCloud packages uses: actions/cache@v1 with: diff --git a/README.md b/README.md index 5f6f994..8fca593 100644 --- a/README.md +++ b/README.md @@ -8,13 +8,17 @@ AcidIsland™ [![Bugs](https://sonarcloud.io/api/project_badges/measure?project=world.bentobox%3Aacidisland&metric=bugs)](https://sonarcloud.io/project/issues?id=world.bentobox%3Aacidisland&resolved=false&types=BUG) # Introduction -AcidIsland™ add-on for BentoBox, so to run an AcidIsland™ game, you must have BentoBox installed. It is not a Bukkit plugin and trying to use it as one will not work. +AcidIsland™ add-on for BentoBox, so to run an AcidIsland™ game, you must have BentoBox installed. Docs can be found at [https://docs.bentobox.world](https://docs.bentobox.world). ## The Story You're on an island, in a sea of acid! If you like Skyblock, try the AcidIsland™ game mode for a new challenge! -This is a variation of SkyBlock. Instead of falling, you must contend with acid water when expanding your island and players can boat to each other's islands. +Instead of falling you must contend with acid water when expanding your island, and players can boat to each other's islands. + +## Download + +You can download from GitHub, or ready made plugin packs from [https://download.bentobox.world](https://download.bentobox.world). ## Installation @@ -36,8 +40,8 @@ AcidIsland™ add-on uses the BentoBox API. Here are some other ones that you ma * Challenges - challenges * Biomes - enables biomes -You can find the projects on GitHub. +You can find the projects on GitHub or download load from [https://download.bentobox.world](https://download.bentobox.world). Bugs and Feature requests ========================= -File bug and feature requests here: https://github.com/BentoBoxWorld/AcidIsland/issues +File bug and feature requests here: [https://github.com/BentoBoxWorld/AcidIsland/issues](https://github.com/BentoBoxWorld/AcidIsland/issues) diff --git a/pom.xml b/pom.xml index da3255d..c2a7a47 100644 --- a/pom.xml +++ b/pom.xml @@ -54,18 +54,18 @@ UTF-8 UTF-8 - 1.8 + 16 - 2.0.4 + 2.0.9 - 1.16.3-R0.1-SNAPSHOT - 1.16.1 + 1.17-R0.1-SNAPSHOT + 1.17.0 ${build.version}-SNAPSHOT -LOCAL - 1.14.6 + 1.15.0 BentoBoxWorld_AcidIsland bentobox-world @@ -170,7 +170,7 @@ org.mockito mockito-core - 3.0.0 + 3.11.1 test @@ -198,7 +198,7 @@ org.eclipse.jdt org.eclipse.jdt.annotation - 2.2.200 + 2.2.600 @@ -265,14 +265,18 @@ maven-compiler-plugin 3.7.0 - ${java.version} - ${java.version} + ${java.version} org.apache.maven.plugins maven-surefire-plugin - 2.22.0 + 3.0.0-M5 + + + --illegal-access=permit + + org.apache.maven.plugins @@ -284,11 +288,11 @@ maven-javadoc-plugin 3.2.0 - 8 + 16 public false -Xdoclint:none - + ${java.home}/bin/javadoc diff --git a/src/main/java/world/bentobox/acidisland/AISettings.java b/src/main/java/world/bentobox/acidisland/AISettings.java index 6f98119..9797e26 100644 --- a/src/main/java/world/bentobox/acidisland/AISettings.java +++ b/src/main/java/world/bentobox/acidisland/AISettings.java @@ -178,13 +178,13 @@ public class AISettings implements WorldSettings { @ConfigComment("It is the same for every dimension : Overworld, Nether and End.") @ConfigComment("This value cannot be changed mid-game and the plugin will not start if it is different.") @ConfigEntry(path = "world.distance-between-islands", needsReset = true) - private int islandDistance = 192; + private int islandDistance = 64; @ConfigComment("Default protection range radius in blocks. Cannot be larger than distance.") @ConfigComment("Admins can change protection sizes for players individually using /acid range set ") @ConfigComment("or set this permission: acidisland.island.range.") @ConfigEntry(path = "world.protection-range", overrideOnChange = true) - private int islandProtectionRange = 100; + private int islandProtectionRange = 50; @ConfigComment("Start islands at these coordinates. This is where new islands will start in the") @ConfigComment("world. These must be a factor of your island distance, but the plugin will auto") diff --git a/src/main/java/world/bentobox/acidisland/AcidIsland.java b/src/main/java/world/bentobox/acidisland/AcidIsland.java index a9d111d..1accca7 100644 --- a/src/main/java/world/bentobox/acidisland/AcidIsland.java +++ b/src/main/java/world/bentobox/acidisland/AcidIsland.java @@ -143,7 +143,7 @@ public class AcidIsland extends GameModeAddon { WorldCreator wc = WorldCreator.name(worldName2).type(WorldType.FLAT).environment(env); World w = settings.isUseOwnGenerator() ? wc.createWorld() : wc.generator(chunkGenerator2).createWorld(); // Set spawn rates - if (w != null) { + if (w != null && getSettings() != null) { if (getSettings().getSpawnLimitMonsters() > 0) { w.setMonsterSpawnLimit(getSettings().getSpawnLimitMonsters()); } @@ -196,8 +196,7 @@ public class AcidIsland extends GameModeAddon { */ @Override public void allLoaded() { - // Reload settings and save them. This will occur after all addons have loaded - this.loadSettings(); + // Save settings. This will occur after all addons have loaded this.saveWorldSettings(); } } diff --git a/src/main/java/world/bentobox/acidisland/AcidIslandPladdon.java b/src/main/java/world/bentobox/acidisland/AcidIslandPladdon.java new file mode 100644 index 0000000..569bf2d --- /dev/null +++ b/src/main/java/world/bentobox/acidisland/AcidIslandPladdon.java @@ -0,0 +1,12 @@ +package world.bentobox.acidisland; + +import world.bentobox.bentobox.api.addons.Addon; +import world.bentobox.bentobox.api.addons.Pladdon; + +public class AcidIslandPladdon extends Pladdon { + + @Override + public Addon getAddon() { + return new AcidIsland(); + } +} diff --git a/src/main/java/world/bentobox/acidisland/world/AcidTask.java b/src/main/java/world/bentobox/acidisland/world/AcidTask.java index 1ba535d..8a62bf9 100644 --- a/src/main/java/world/bentobox/acidisland/world/AcidTask.java +++ b/src/main/java/world/bentobox/acidisland/world/AcidTask.java @@ -38,7 +38,7 @@ public class AcidTask { */ public AcidTask(AcidIsland addon) { this.addon = addon; - findMobsTask = Bukkit.getScheduler().runTaskTimerAsynchronously(addon.getPlugin(), this::findEntities, 0L, 20L); + findMobsTask = Bukkit.getScheduler().runTaskTimer(addon.getPlugin(), this::findEntities, 0L, 20L); } void findEntities() { diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml new file mode 100644 index 0000000..62e69c5 --- /dev/null +++ b/src/main/resources/plugin.yml @@ -0,0 +1,7 @@ +name: AcidIsland +main: world.bentobox.acidisland.AcidIslandPladdon +version: ${version} +api-version: 1.17 +description: AcidIsland +author: tastybento +depend: [BentoBox] diff --git a/src/test/java/world/bentobox/acidisland/AISettingsTest.java b/src/test/java/world/bentobox/acidisland/AISettingsTest.java index 0278808..d2e441a 100644 --- a/src/test/java/world/bentobox/acidisland/AISettingsTest.java +++ b/src/test/java/world/bentobox/acidisland/AISettingsTest.java @@ -193,7 +193,7 @@ public class AISettingsTest { */ @Test public void testGetIslandDistance() { - assertEquals(192, s.getIslandDistance()); + assertEquals(64, s.getIslandDistance()); } /** @@ -209,7 +209,7 @@ public class AISettingsTest { */ @Test public void testGetIslandProtectionRange() { - assertEquals(100, s.getIslandProtectionRange()); + assertEquals(50, s.getIslandProtectionRange()); } /** diff --git a/src/test/java/world/bentobox/acidisland/events/AcidEventTest.java b/src/test/java/world/bentobox/acidisland/events/AcidEventTest.java index c3d2c6b..0742a1b 100644 --- a/src/test/java/world/bentobox/acidisland/events/AcidEventTest.java +++ b/src/test/java/world/bentobox/acidisland/events/AcidEventTest.java @@ -15,8 +15,11 @@ import org.bukkit.potion.PotionEffectType; import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.junit.runner.RunWith; import org.mockito.Mock; +import org.powermock.modules.junit4.PowerMockRunner; +@RunWith(PowerMockRunner.class) public class AcidEventTest { @Mock diff --git a/src/test/java/world/bentobox/acidisland/events/AcidRainEventTest.java b/src/test/java/world/bentobox/acidisland/events/AcidRainEventTest.java index d4c28db..94af9fd 100644 --- a/src/test/java/world/bentobox/acidisland/events/AcidRainEventTest.java +++ b/src/test/java/world/bentobox/acidisland/events/AcidRainEventTest.java @@ -6,17 +6,20 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.mock; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + import org.bukkit.entity.Player; import org.bukkit.potion.PotionEffectType; import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.junit.runner.RunWith; import org.mockito.Mock; +import org.powermock.modules.junit4.PowerMockRunner; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - +@RunWith(PowerMockRunner.class) public class AcidRainEventTest { @Mock diff --git a/src/test/java/world/bentobox/acidisland/world/AcidTaskTest.java b/src/test/java/world/bentobox/acidisland/world/AcidTaskTest.java index 057e381..2745a7d 100644 --- a/src/test/java/world/bentobox/acidisland/world/AcidTaskTest.java +++ b/src/test/java/world/bentobox/acidisland/world/AcidTaskTest.java @@ -84,7 +84,7 @@ public class AcidTaskTest { public void setUp() { PowerMockito.mockStatic(Bukkit.class, Mockito.RETURNS_MOCKS); when(Bukkit.getScheduler()).thenReturn(scheduler); - when(scheduler.runTaskTimerAsynchronously(any(), any(Runnable.class), anyLong(), anyLong())).thenReturn(task); + when(scheduler.runTaskTimer(any(), any(Runnable.class), anyLong(), anyLong())).thenReturn(task); when(addon.getOverWorld()).thenReturn(world); when(addon.getNetherWorld()).thenReturn(nether); @@ -148,7 +148,7 @@ public class AcidTaskTest { */ @Test public void testAcidTask() { - verify(scheduler).runTaskTimerAsynchronously(eq(null), any(Runnable.class), eq(0L), eq(20L)); + verify(scheduler).runTaskTimer(eq(null), any(Runnable.class), eq(0L), eq(20L)); } /**