Skip to content

Commit 6e88cf3

Browse files
authored
Merge pull request #465 from BentoBoxWorld/develop
Version 1.22.0
2 parents 6ed7602 + 72fe06f commit 6e88cf3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+2628
-1548
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@ A: It's whatever you want it to be!
8484

8585
## Installation
8686

87-
0. Install BentoBox and run it on the server at least once to create its data folders.
88-
1. Place this jar in the addons folder of the BentoBox plugin.
89-
2. Restart the server.
90-
3. The addon will create worlds and a data folder and inside the folder will be a config.yml and config files in phases folder.
91-
4. Stop the server.
92-
5. Edit config.yml and the .yml config files how you want.
93-
6. Delete any worlds that were created by default if you made changes that would affect them.
94-
7. Restart the server.
87+
1. Install BentoBox and run it on the server at least once to create its data folders.
88+
2. Place this jar in the addons folder of the BentoBox plugin.
89+
3. Restart the server.
90+
4. The addon will create worlds and a data folder and inside the folder will be a config.yml and config files in phases folder.
91+
5. Stop the server.
92+
6. Edit config.yml and the .yml config files how you want.
93+
7. Delete any worlds that were created by default if you made changes that would affect them.
94+
8. Restart the server.
9595

9696
## Phase config files
9797

pom.xml

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@
5252
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
5353
<java.version>21</java.version>
5454
<!-- Non-minecraft related dependencies -->
55-
<powermock.version>2.0.9</powermock.version>
55+
<junit.version>5.10.2</junit.version>
56+
<mockito.version>5.11.0</mockito.version>
57+
<mock-bukkit.version>v1.21-SNAPSHOT</mock-bukkit.version>
5658
<!-- More visible way how to change dependency versions -->
5759
<bentobox.version>2.7.1-SNAPSHOT</bentobox.version>
5860
<items-adder.version>4.0.10</items-adder.version>
@@ -63,7 +65,7 @@
6365
<!-- Do not change unless you want different name for local builds. -->
6466
<build.number>-LOCAL</build.number>
6567
<!-- This allows to change between versions. -->
66-
<build.version>1.21.1</build.version>
68+
<build.version>1.22.0</build.version>
6769
<!-- SonarCloud -->
6870
<sonar.projectKey>BentoBoxWorld_AOneBlock</sonar.projectKey>
6971
<sonar.organization>bentobox-world</sonar.organization>
@@ -183,24 +185,32 @@
183185
<scope>provided</scope>
184186
</dependency>
185187
<!-- Mockito (Unit testing) -->
188+
<!-- Mockito (Unit testing) This goes at the top to ensure the dependencies are accurate. -->
189+
<dependency>
190+
<groupId>org.junit.jupiter</groupId>
191+
<artifactId>junit-jupiter-api</artifactId>
192+
<version>${junit.version}</version>
193+
<scope>test</scope>
194+
</dependency>
195+
<dependency>
196+
<groupId>org.junit.jupiter</groupId>
197+
<artifactId>junit-jupiter-engine</artifactId>
198+
<version>${junit.version}</version>
199+
<scope>test</scope>
200+
</dependency>
201+
<dependency>
202+
<groupId>org.mockito</groupId>
203+
<artifactId>mockito-junit-jupiter</artifactId>
204+
<version>5.11.0</version>
205+
<scope>test</scope>
206+
</dependency>
186207
<dependency>
187208
<groupId>org.mockito</groupId>
188209
<artifactId>mockito-core</artifactId>
189-
<version>3.11.1</version>
190-
<scope>test</scope>
191-
</dependency>
192-
<dependency>
193-
<groupId>org.powermock</groupId>
194-
<artifactId>powermock-module-junit4</artifactId>
195-
<version>${powermock.version}</version>
196-
<scope>test</scope>
197-
</dependency>
198-
<dependency>
199-
<groupId>org.powermock</groupId>
200-
<artifactId>powermock-api-mockito2</artifactId>
201-
<version>${powermock.version}</version>
210+
<version>${mockito.version}</version>
202211
<scope>test</scope>
203212
</dependency>
213+
<!-- BentoBox -->
204214
<dependency>
205215
<groupId>world.bentobox</groupId>
206216
<artifactId>bentobox</artifactId>
@@ -290,7 +300,7 @@
290300
<plugin>
291301
<groupId>org.apache.maven.plugins</groupId>
292302
<artifactId>maven-surefire-plugin</artifactId>
293-
<version>3.0.0-M5</version>
303+
<version>3.5.4</version>
294304
<configuration>
295305
<argLine>
296306
--add-opens java.base/java.lang=ALL-UNNAMED

src/main/java/world/bentobox/aoneblock/AOneBlock.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
import world.bentobox.aoneblock.generators.ChunkGeneratorWorld;
2020
import world.bentobox.aoneblock.listeners.BlockListener;
2121
import world.bentobox.aoneblock.listeners.BlockProtect;
22+
import world.bentobox.aoneblock.listeners.BossBarListener;
2223
import world.bentobox.aoneblock.listeners.HoloListener;
2324
import world.bentobox.aoneblock.listeners.InfoListener;
2425
import world.bentobox.aoneblock.listeners.ItemsAdderListener;
2526
import world.bentobox.aoneblock.listeners.JoinLeaveListener;
26-
import world.bentobox.aoneblock.listeners.BossBarListener;
2727
import world.bentobox.aoneblock.listeners.NoBlockHandler;
2828
import world.bentobox.aoneblock.listeners.StartSafetyListener;
2929
import world.bentobox.aoneblock.oneblocks.OneBlockCustomBlockCreator;
@@ -79,7 +79,7 @@ public class AOneBlock extends GameModeAddon {
7979
.defaultSetting(false)
8080
.build();
8181
/** The listener for the boss bar */
82-
private BossBarListener bossBar = new BossBarListener(this);
82+
private final BossBarListener bossBar = new BossBarListener(this);
8383
/**
8484
* Flag to enable or disable the OneBlock boss bar.
8585
*/
@@ -130,7 +130,13 @@ public void onLoad() {
130130
// Register protection flag with BentoBox
131131
getPlugin().getFlagsManager().registerFlag(this, START_SAFETY);
132132
// Bossbar
133-
getPlugin().getFlagsManager().registerFlag(this, this.ONEBLOCK_BOSSBAR);
133+
if (getSettings().isBossBar()) {
134+
getPlugin().getFlagsManager().registerFlag(this, this.ONEBLOCK_BOSSBAR);
135+
}
136+
// Actionbar
137+
if (getSettings().isActionBar()) {
138+
getPlugin().getFlagsManager().registerFlag(this, this.ONEBLOCK_ACTIONBAR);
139+
}
134140
// Magic Block protection
135141
getPlugin().getFlagsManager().registerFlag(this, this.MAGIC_BLOCK);
136142
}
@@ -171,7 +177,9 @@ public void onEnable() {
171177
registerListener(new BlockProtect(this));
172178
registerListener(new JoinLeaveListener(this));
173179
registerListener(new InfoListener(this));
174-
registerListener(bossBar);
180+
if (getSettings().isBossBar() && getSettings().isActionBar()) {
181+
registerListener(bossBar);
182+
}
175183
// Register placeholders
176184
phManager = new AOneBlockPlaceholders(this, getPlugin().getPlaceholdersManager());
177185

src/main/java/world/bentobox/aoneblock/AOneBlockPlaceholders.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ private Optional<Island> getUsersIsland(User user) {
8282
.filter(is -> user.getUniqueId().equals(is.getOwner())).toList();
8383
if (ownedIslands.size() == 1) {
8484
// Replace with the owned island
85-
i = ownedIslands.get(0); // pick one
85+
i = ownedIslands.getFirst(); // pick one
8686
}
8787
// Return what we have found
8888
return Optional.ofNullable(i);

0 commit comments

Comments
 (0)