Skip to content

Commit 8a0928f

Browse files
authored
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 #116
1 parent 45757d4 commit 8a0928f

File tree

8 files changed

+56
-49
lines changed

8 files changed

+56
-49
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,18 @@ jobs:
1515
with:
1616
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
1717
- name: Set up JDK 16
18-
uses: actions/setup-java@v1
18+
uses: actions/setup-java@v2
1919
with:
20-
java-version: 16
20+
distribution: 'adopt'
21+
java-version: '16'
2122
- name: Cache SonarCloud packages
22-
uses: actions/cache@v1
23+
uses: actions/cache@v2
2324
with:
2425
path: ~/.sonar/cache
2526
key: ${{ runner.os }}-sonar
2627
restore-keys: ${{ runner.os }}-sonar
2728
- name: Cache Maven packages
28-
uses: actions/cache@v1
29+
uses: actions/cache@v2
2930
with:
3031
path: ~/.m2
3132
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}

pom.xml

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@
5959
<powermock.version>2.0.9</powermock.version>
6060
<!-- More visible way how to change dependency versions -->
6161
<spigot.version>1.17-R0.1-SNAPSHOT</spigot.version>
62-
<bentobox.version>1.17.0</bentobox.version>
62+
<bentobox.version>1.18.0</bentobox.version>
6363
<!-- Revision variable removes warning about dynamic version -->
6464
<revision>${build.version}-SNAPSHOT</revision>
6565
<!-- Do not change unless you want different name for local builds. -->
6666
<build.number>-LOCAL</build.number>
6767
<!-- This allows to change between versions. -->
68-
<build.version>1.15.0</build.version>
68+
<build.version>1.15.1</build.version>
6969
<!-- Sonar Cloud -->
7070
<sonar.projectKey>BentoBoxWorld_AcidIsland</sonar.projectKey>
7171
<sonar.organization>bentobox-world</sonar.organization>
@@ -112,45 +112,21 @@
112112
<build.number></build.number>
113113
</properties>
114114
</profile>
115-
<profile>
116-
<id>sonar</id>
117-
<properties>
118-
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
119-
<sonar.organization>bentobox-world</sonar.organization>
120-
</properties>
121-
<build>
122-
<plugins>
123-
<plugin>
124-
<groupId>org.sonarsource.scanner.maven</groupId>
125-
<artifactId>sonar-maven-plugin</artifactId>
126-
<version>3.6.0.1398</version>
127-
<executions>
128-
<execution>
129-
<phase>verify</phase>
130-
<goals>
131-
<goal>sonar</goal>
132-
</goals>
133-
</execution>
134-
</executions>
135-
</plugin>
136-
</plugins>
137-
</build>
138-
</profile>
139115
</profiles>
140116

141117
<repositories>
142118
<repository>
143119
<id>spigot-repo</id>
144120
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots</url>
145121
</repository>
146-
<repository>
147-
<id>codemc</id>
148-
<url>https://repo.codemc.org/repository/maven-snapshots/</url>
149-
</repository>
150122
<repository>
151123
<id>codemc-repo</id>
152124
<url>https://repo.codemc.org/repository/maven-public/</url>
153125
</repository>
126+
<repository>
127+
<id>codemc</id>
128+
<url>https://repo.codemc.org/repository/maven-snapshots/</url>
129+
</repository>
154130
<repository>
155131
<id>ess-repo</id>
156132
<url>https://ci.ender.zone/plugin/repository/everything/</url>
@@ -274,8 +250,35 @@
274250
<version>3.0.0-M5</version>
275251
<configuration>
276252
<argLine>
277-
--illegal-access=permit
253+
--add-opens java.base/java.lang=ALL-UNNAMED
254+
--add-opens java.base/java.math=ALL-UNNAMED
255+
--add-opens java.base/java.io=ALL-UNNAMED
256+
--add-opens java.base/java.util=ALL-UNNAMED
257+
--add-opens
258+
java.base/java.util.stream=ALL-UNNAMED
259+
--add-opens java.base/java.text=ALL-UNNAMED
260+
--add-opens
261+
java.base/java.util.regex=ALL-UNNAMED
262+
--add-opens
263+
java.base/java.nio.channels.spi=ALL-UNNAMED
264+
--add-opens java.base/sun.nio.ch=ALL-UNNAMED
265+
--add-opens java.base/java.net=ALL-UNNAMED
266+
--add-opens
267+
java.base/java.util.concurrent=ALL-UNNAMED
268+
--add-opens java.base/sun.nio.fs=ALL-UNNAMED
269+
--add-opens java.base/sun.nio.cs=ALL-UNNAMED
270+
--add-opens java.base/java.nio.file=ALL-UNNAMED
271+
--add-opens
272+
java.base/java.nio.charset=ALL-UNNAMED
273+
--add-opens
274+
java.base/java.lang.reflect=ALL-UNNAMED
275+
--add-opens
276+
java.logging/java.util.logging=ALL-UNNAMED
277+
--add-opens java.base/java.lang.ref=ALL-UNNAMED
278+
--add-opens java.base/java.util.jar=ALL-UNNAMED
279+
--add-opens java.base/java.util.zip=ALL-UNNAMED
278280
</argLine>
281+
279282
</configuration>
280283
</plugin>
281284
<plugin>

src/main/java/world/bentobox/acidisland/AISettings.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1695,7 +1695,7 @@ public List<PotionEffectType> getAcidRainEffects() {
16951695

16961696
/**
16971697
*
1698-
* @param acidRainEffects
1698+
* @param acidRainEffects potion effects from rain
16991699
* @since 1.9.1
17001700
*/
17011701
public void setAcidRainEffects(List<PotionEffectType> acidRainEffects) {

src/main/java/world/bentobox/acidisland/AcidIsland.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package world.bentobox.acidisland;
22

3+
import java.util.Objects;
4+
35
import org.bukkit.Bukkit;
46
import org.bukkit.World;
57
import org.bukkit.World.Environment;
@@ -96,9 +98,9 @@ public void onDisable() {
9698
if (acidTask != null) acidTask.cancelTasks();
9799
}
98100

99-
@Nullable
101+
@NonNull
100102
public AISettings getSettings() {
101-
return settings;
103+
return Objects.requireNonNull(settings);
102104
}
103105

104106
/* (non-Javadoc)

src/main/java/world/bentobox/acidisland/events/AbstractAcidEvent.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ public abstract class AbstractAcidEvent extends Event implements Cancellable {
2626

2727

2828
/**
29-
* @param player
30-
* @param rainDamage
31-
* @param protection
29+
* @param player player
30+
* @param protection protection value
31+
* @param potionEffects the potion effects applied
3232
*/
3333
protected AbstractAcidEvent(Player player, double protection, List<PotionEffectType> potionEffects) {
3434
this.player = player;

src/main/java/world/bentobox/acidisland/listeners/AcidEffect.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,7 @@ public static double getDamageReduced(LivingEntity le) {
324324
private static boolean damage(ItemStack item) {
325325
ItemMeta im = item.getItemMeta();
326326

327-
if (im instanceof Damageable) {
328-
Damageable d = (Damageable)im;
327+
if (im instanceof Damageable d) {
329328
d.setDamage(d.getDamage() + 1);
330329
item.setItemMeta((ItemMeta) d);
331330
return d.getDamage() >= item.getType().getMaxDurability();

src/main/java/world/bentobox/acidisland/world/AcidTask.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import java.util.Arrays;
55
import java.util.List;
66
import java.util.Map;
7+
import java.util.Objects;
78
import java.util.WeakHashMap;
89
import java.util.concurrent.ConcurrentHashMap;
910

@@ -28,7 +29,7 @@
2829

2930
public class AcidTask {
3031
private final AcidIsland addon;
31-
private static final List<EntityType> IMMUNE = Arrays.asList(EntityType.TURTLE, EntityType.POLAR_BEAR, EntityType.DROWNED);
32+
private static final List<EntityType> IMMUNE = Arrays.asList(EntityType.TURTLE, EntityType.POLAR_BEAR, EntityType.DROWNED, EntityType.AXOLOTL);
3233
private Map<Entity, Long> itemsInWater = new ConcurrentHashMap<>();
3334
private final BukkitTask findMobsTask;
3435

@@ -103,10 +104,10 @@ List<Entity> getEntityStream() {
103104
List<Entity> entityStream = new ArrayList<>(addon.getOverWorld().getEntities());
104105
// Nether and end
105106
if (addon.getSettings().isNetherGenerate() && addon.getSettings().isNetherIslands()) {
106-
entityStream.addAll(addon.getNetherWorld().getEntities());
107+
entityStream.addAll(Objects.requireNonNull(addon.getNetherWorld()).getEntities());
107108
}
108109
if (addon.getSettings().isEndGenerate() && addon.getSettings().isEndIslands()) {
109-
entityStream.addAll(addon.getEndWorld().getEntities());
110+
entityStream.addAll(Objects.requireNonNull(addon.getEndWorld()).getEntities());
110111
}
111112
return entityStream;
112113
}

src/main/resources/plugin.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
name: AcidIsland
1+
name: Pladdon
22
main: world.bentobox.acidisland.AcidIslandPladdon
33
version: ${version}
4-
api-version: 1.17
4+
api-version: 1.16
55
description: AcidIsland
66
author: tastybento
7-
depend: [BentoBox]
7+
depend:
8+
- BentoBox

0 commit comments

Comments
 (0)