Merge branch 'develop'

This commit is contained in:
tastybento 2021-06-27 17:26:32 -07:00
commit 45757d4ab4
12 changed files with 64 additions and 32 deletions

View File

@ -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:

View File

@ -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)

28
pom.xml
View File

@ -54,18 +54,18 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<java.version>16</java.version>
<!-- Non-minecraft related dependencies -->
<powermock.version>2.0.4</powermock.version>
<powermock.version>2.0.9</powermock.version>
<!-- More visible way how to change dependency versions -->
<spigot.version>1.16.3-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>1.16.1</bentobox.version>
<spigot.version>1.17-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>1.17.0</bentobox.version>
<!-- Revision variable removes warning about dynamic version -->
<revision>${build.version}-SNAPSHOT</revision>
<!-- Do not change unless you want different name for local builds. -->
<build.number>-LOCAL</build.number>
<!-- This allows to change between versions. -->
<build.version>1.14.6</build.version>
<build.version>1.15.0</build.version>
<!-- Sonar Cloud -->
<sonar.projectKey>BentoBoxWorld_AcidIsland</sonar.projectKey>
<sonar.organization>bentobox-world</sonar.organization>
@ -170,7 +170,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.0.0</version>
<version>3.11.1</version>
<scope>test</scope>
</dependency>
<dependency>
@ -198,7 +198,7 @@
<dependency>
<groupId>org.eclipse.jdt</groupId>
<artifactId>org.eclipse.jdt.annotation</artifactId>
<version>2.2.200</version>
<version>2.2.600</version>
</dependency>
<!-- EssentialsX -->
<dependency>
@ -265,14 +265,18 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<release>${java.version}</release>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<version>3.0.0-M5</version>
<configuration>
<argLine>
--illegal-access=permit
</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@ -284,11 +288,11 @@
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<source>8</source>
<source>16</source>
<show>public</show>
<failOnError>false</failOnError>
<additionalJOption>-Xdoclint:none</additionalJOption>
<!-- <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable> -->
<javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
</configuration>
<executions>
<execution>

View File

@ -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 <player> <new range>")
@ConfigComment("or set this permission: acidisland.island.range.<number>")
@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")

View File

@ -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();
}
}

View File

@ -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();
}
}

View File

@ -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() {

View File

@ -0,0 +1,7 @@
name: AcidIsland
main: world.bentobox.acidisland.AcidIslandPladdon
version: ${version}
api-version: 1.17
description: AcidIsland
author: tastybento
depend: [BentoBox]

View File

@ -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());
}
/**

View File

@ -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

View File

@ -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

View File

@ -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));
}
/**