Version 1.15.1 (#117)

* Version 1.15.1

* Require non-null Settings

* Update Github Action versions

* Assert if worlds are null. They should never be.

* JavaDoc fixes

* Use instanceof pattern

* Change plugin name to Pladdon

* Remove unused sonar profile.

* Build against BentoBox 1.18 API

* Ensure a clean startup without warnings.

Note for pladdons, the plugin.yml must list BentoBox as a depend in YAML
list format.

Must place the release repo before the snarpshote repo in the POM.

* Prevent Axolotl from dying in acid.

Fixes https://github.com/BentoBoxWorld/AcidIsland/issues/116
This commit is contained in:
tastybento 2021-11-27 11:16:18 -08:00 committed by GitHub
parent 45757d4ab4
commit 8a0928f087
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 56 additions and 49 deletions

View File

@ -15,17 +15,18 @@ jobs:
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 16
uses: actions/setup-java@v1
uses: actions/setup-java@v2
with:
java-version: 16
distribution: 'adopt'
java-version: '16'
- name: Cache SonarCloud packages
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}

65
pom.xml
View File

@ -59,13 +59,13 @@
<powermock.version>2.0.9</powermock.version>
<!-- More visible way how to change dependency versions -->
<spigot.version>1.17-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>1.17.0</bentobox.version>
<bentobox.version>1.18.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.15.0</build.version>
<build.version>1.15.1</build.version>
<!-- Sonar Cloud -->
<sonar.projectKey>BentoBoxWorld_AcidIsland</sonar.projectKey>
<sonar.organization>bentobox-world</sonar.organization>
@ -112,30 +112,6 @@
<build.number></build.number>
</properties>
</profile>
<profile>
<id>sonar</id>
<properties>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<sonar.organization>bentobox-world</sonar.organization>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.6.0.1398</version>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>sonar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<repositories>
@ -143,14 +119,14 @@
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots</url>
</repository>
<repository>
<id>codemc</id>
<url>https://repo.codemc.org/repository/maven-snapshots/</url>
</repository>
<repository>
<id>codemc-repo</id>
<url>https://repo.codemc.org/repository/maven-public/</url>
</repository>
<repository>
<id>codemc</id>
<url>https://repo.codemc.org/repository/maven-snapshots/</url>
</repository>
<repository>
<id>ess-repo</id>
<url>https://ci.ender.zone/plugin/repository/everything/</url>
@ -274,8 +250,35 @@
<version>3.0.0-M5</version>
<configuration>
<argLine>
--illegal-access=permit
--add-opens java.base/java.lang=ALL-UNNAMED
--add-opens java.base/java.math=ALL-UNNAMED
--add-opens java.base/java.io=ALL-UNNAMED
--add-opens java.base/java.util=ALL-UNNAMED
--add-opens
java.base/java.util.stream=ALL-UNNAMED
--add-opens java.base/java.text=ALL-UNNAMED
--add-opens
java.base/java.util.regex=ALL-UNNAMED
--add-opens
java.base/java.nio.channels.spi=ALL-UNNAMED
--add-opens java.base/sun.nio.ch=ALL-UNNAMED
--add-opens java.base/java.net=ALL-UNNAMED
--add-opens
java.base/java.util.concurrent=ALL-UNNAMED
--add-opens java.base/sun.nio.fs=ALL-UNNAMED
--add-opens java.base/sun.nio.cs=ALL-UNNAMED
--add-opens java.base/java.nio.file=ALL-UNNAMED
--add-opens
java.base/java.nio.charset=ALL-UNNAMED
--add-opens
java.base/java.lang.reflect=ALL-UNNAMED
--add-opens
java.logging/java.util.logging=ALL-UNNAMED
--add-opens java.base/java.lang.ref=ALL-UNNAMED
--add-opens java.base/java.util.jar=ALL-UNNAMED
--add-opens java.base/java.util.zip=ALL-UNNAMED
</argLine>
</configuration>
</plugin>
<plugin>

View File

@ -1695,7 +1695,7 @@ public class AISettings implements WorldSettings {
/**
*
* @param acidRainEffects
* @param acidRainEffects potion effects from rain
* @since 1.9.1
*/
public void setAcidRainEffects(List<PotionEffectType> acidRainEffects) {

View File

@ -1,5 +1,7 @@
package world.bentobox.acidisland;
import java.util.Objects;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.World.Environment;
@ -96,9 +98,9 @@ public class AcidIsland extends GameModeAddon {
if (acidTask != null) acidTask.cancelTasks();
}
@Nullable
@NonNull
public AISettings getSettings() {
return settings;
return Objects.requireNonNull(settings);
}
/* (non-Javadoc)

View File

@ -26,9 +26,9 @@ public abstract class AbstractAcidEvent extends Event implements Cancellable {
/**
* @param player
* @param rainDamage
* @param protection
* @param player player
* @param protection protection value
* @param potionEffects the potion effects applied
*/
protected AbstractAcidEvent(Player player, double protection, List<PotionEffectType> potionEffects) {
this.player = player;

View File

@ -324,8 +324,7 @@ public class AcidEffect implements Listener {
private static boolean damage(ItemStack item) {
ItemMeta im = item.getItemMeta();
if (im instanceof Damageable) {
Damageable d = (Damageable)im;
if (im instanceof Damageable d) {
d.setDamage(d.getDamage() + 1);
item.setItemMeta((ItemMeta) d);
return d.getDamage() >= item.getType().getMaxDurability();

View File

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.WeakHashMap;
import java.util.concurrent.ConcurrentHashMap;
@ -28,7 +29,7 @@ import world.bentobox.acidisland.listeners.AcidEffect;
public class AcidTask {
private final AcidIsland addon;
private static final List<EntityType> IMMUNE = Arrays.asList(EntityType.TURTLE, EntityType.POLAR_BEAR, EntityType.DROWNED);
private static final List<EntityType> IMMUNE = Arrays.asList(EntityType.TURTLE, EntityType.POLAR_BEAR, EntityType.DROWNED, EntityType.AXOLOTL);
private Map<Entity, Long> itemsInWater = new ConcurrentHashMap<>();
private final BukkitTask findMobsTask;
@ -103,10 +104,10 @@ public class AcidTask {
List<Entity> entityStream = new ArrayList<>(addon.getOverWorld().getEntities());
// Nether and end
if (addon.getSettings().isNetherGenerate() && addon.getSettings().isNetherIslands()) {
entityStream.addAll(addon.getNetherWorld().getEntities());
entityStream.addAll(Objects.requireNonNull(addon.getNetherWorld()).getEntities());
}
if (addon.getSettings().isEndGenerate() && addon.getSettings().isEndIslands()) {
entityStream.addAll(addon.getEndWorld().getEntities());
entityStream.addAll(Objects.requireNonNull(addon.getEndWorld()).getEntities());
}
return entityStream;
}

View File

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