Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ A: It's whatever you want it to be!

## Installation

0. Install BentoBox and run it on the server at least once to create its data folders.
1. Place this jar in the addons folder of the BentoBox plugin.
2. Restart the server.
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.
4. Stop the server.
5. Edit config.yml and the .yml config files how you want.
6. Delete any worlds that were created by default if you made changes that would affect them.
7. Restart the server.
1. Install BentoBox and run it on the server at least once to create its data folders.
2. Place this jar in the addons folder of the BentoBox plugin.
3. Restart the server.
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.
5. Stop the server.
6. Edit config.yml and the .yml config files how you want.
7. Delete any worlds that were created by default if you made changes that would affect them.
8. Restart the server.

## Phase config files

Expand Down
42 changes: 26 additions & 16 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>21</java.version>
<!-- Non-minecraft related dependencies -->
<powermock.version>2.0.9</powermock.version>
<junit.version>5.10.2</junit.version>
<mockito.version>5.11.0</mockito.version>
<mock-bukkit.version>v1.21-SNAPSHOT</mock-bukkit.version>
<!-- More visible way how to change dependency versions -->
<bentobox.version>2.7.1-SNAPSHOT</bentobox.version>
<items-adder.version>4.0.10</items-adder.version>
Expand All @@ -63,7 +65,7 @@
<!-- 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.21.1</build.version>
<build.version>1.22.0</build.version>
<!-- SonarCloud -->
<sonar.projectKey>BentoBoxWorld_AOneBlock</sonar.projectKey>
<sonar.organization>bentobox-world</sonar.organization>
Expand Down Expand Up @@ -183,24 +185,32 @@
<scope>provided</scope>
</dependency>
<!-- Mockito (Unit testing) -->
<!-- Mockito (Unit testing) This goes at the top to ensure the dependencies are accurate. -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>5.11.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.11.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito2</artifactId>
<version>${powermock.version}</version>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<!-- BentoBox -->
<dependency>
<groupId>world.bentobox</groupId>
<artifactId>bentobox</artifactId>
Expand Down Expand Up @@ -290,7 +300,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<version>3.5.4</version>
<configuration>
<argLine>
--add-opens java.base/java.lang=ALL-UNNAMED
Expand Down
16 changes: 12 additions & 4 deletions src/main/java/world/bentobox/aoneblock/AOneBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
import world.bentobox.aoneblock.generators.ChunkGeneratorWorld;
import world.bentobox.aoneblock.listeners.BlockListener;
import world.bentobox.aoneblock.listeners.BlockProtect;
import world.bentobox.aoneblock.listeners.BossBarListener;
import world.bentobox.aoneblock.listeners.HoloListener;
import world.bentobox.aoneblock.listeners.InfoListener;
import world.bentobox.aoneblock.listeners.ItemsAdderListener;
import world.bentobox.aoneblock.listeners.JoinLeaveListener;
import world.bentobox.aoneblock.listeners.BossBarListener;
import world.bentobox.aoneblock.listeners.NoBlockHandler;
import world.bentobox.aoneblock.listeners.StartSafetyListener;
import world.bentobox.aoneblock.oneblocks.OneBlockCustomBlockCreator;
Expand Down Expand Up @@ -79,7 +79,7 @@ public class AOneBlock extends GameModeAddon {
.defaultSetting(false)
.build();
/** The listener for the boss bar */
private BossBarListener bossBar = new BossBarListener(this);
private final BossBarListener bossBar = new BossBarListener(this);
/**
* Flag to enable or disable the OneBlock boss bar.
*/
Expand Down Expand Up @@ -130,7 +130,13 @@ public void onLoad() {
// Register protection flag with BentoBox
getPlugin().getFlagsManager().registerFlag(this, START_SAFETY);
// Bossbar
getPlugin().getFlagsManager().registerFlag(this, this.ONEBLOCK_BOSSBAR);
if (getSettings().isBossBar()) {
getPlugin().getFlagsManager().registerFlag(this, this.ONEBLOCK_BOSSBAR);
}
// Actionbar
if (getSettings().isActionBar()) {
getPlugin().getFlagsManager().registerFlag(this, this.ONEBLOCK_ACTIONBAR);
}
// Magic Block protection
getPlugin().getFlagsManager().registerFlag(this, this.MAGIC_BLOCK);
}
Expand Down Expand Up @@ -171,7 +177,9 @@ public void onEnable() {
registerListener(new BlockProtect(this));
registerListener(new JoinLeaveListener(this));
registerListener(new InfoListener(this));
registerListener(bossBar);
if (getSettings().isBossBar() && getSettings().isActionBar()) {
registerListener(bossBar);
}
// Register placeholders
phManager = new AOneBlockPlaceholders(this, getPlugin().getPlaceholdersManager());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private Optional<Island> getUsersIsland(User user) {
.filter(is -> user.getUniqueId().equals(is.getOwner())).toList();
if (ownedIslands.size() == 1) {
// Replace with the owned island
i = ownedIslands.get(0); // pick one
i = ownedIslands.getFirst(); // pick one
}
// Return what we have found
return Optional.ofNullable(i);
Expand Down
Loading