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
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 21
- name: Set up JDK 25
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 21
java-version: 25
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/modrinth-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up JDK 21
- name: Set up JDK 25
uses: actions/setup-java@v4
with:
java-version: 21
java-version: 25
distribution: adopt
cache: maven

Expand Down Expand Up @@ -48,4 +48,6 @@ jobs:
26.1
26.1.1
26.1.2
26.2
26.3
files: /home/runner/work/Boxed/Boxed/target/Boxed-${{ github.event.release.tag_name }}.jar
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
use_release_asset: "true" # publish the jar attached to the release; do not rebuild
hangar_slug: "Boxed" # blank = skip Hangar
curseforge_id: "1515492"
game_versions: "26.2,26.1.2,26.1.1,26.1,1.21.11,1.21.10,1.21.9,1.21.8,1.21.7,1.21.6,1.21.5"
game_versions: "26.3,26.2,26.1.2,26.1.1,26.1,1.21.11,1.21.10,1.21.9,1.21.8,1.21.7,1.21.6,1.21.5"
version: ${{ inputs.version }} # empty on release events -> falls back to the release tag
secrets:
HANGAR_API_KEY: ${{ secrets.HANGAR_API_KEY }}
Expand Down
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co

## Project

Boxed is a BentoBox GameModeAddon for Minecraft (Paper) where each player is confined to a small expandable box. Completing Minecraft advancements grows the box. Built against `bentobox` 3.17.0, Paper API 1.21.11, Java 21.
Boxed is a BentoBox GameModeAddon for Minecraft (Paper) where each player is confined to a small expandable box. Completing Minecraft advancements grows the box. Built against `bentobox` 3.23.7, Paper API 26.3, Java 25.

## Build / Test

Expand Down Expand Up @@ -51,7 +51,7 @@ Because advancements are per-world in vanilla but Boxed runs multiple worlds on

## Testing notes

Tests use JUnit 5 (Jupiter) + Mockito 5 `mockStatic` + MockBukkit (`v1.21-SNAPSHOT` via jitpack.io). There is no PowerMock and no custom `ServerMocks` helper. All test classes extend `CommonTestSetup`, which:
Tests use JUnit 5 (Jupiter) + Mockito 5.20.0 `mockStatic` + MockBukkit (`v26.3` version 4.119.0 via jitpack.io). There is no PowerMock and no custom `ServerMocks` helper. All test classes extend `CommonTestSetup`, which:

- Calls `MockBukkit.mock()` and registers `Mockito.mockStatic(Bukkit.class, RETURNS_DEEP_STUBS)` — use the inherited `mockedBukkit` field to stub `Bukkit.*` calls rather than creating your own.
- Exposes ready-made `@Mock` fields (`plugin`, `mockPlayer`, `world`, `location`, `iwm`, `im`, `island`, `pim`, `itemFactory`, `inv`, `notifier`, `fm`, `spigot`, `hooksManager`, `bm`, `sch`, `lm`, `phm`) plus the MockBukkit `server` and `mockedUtil` statics. Don't re-declare these in subclasses.
Expand Down
18 changes: 9 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,20 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>21</java.version>
<java.version>25</java.version>
<!-- Non-minecraft related dependencies -->
<junit.version>5.10.2</junit.version>
<mockito.version>5.11.0</mockito.version>
<mock-bukkit.version>4.110.0</mock-bukkit.version>
<mockito.version>5.20.0</mockito.version>
<mock-bukkit.version>4.119.0</mock-bukkit.version>
<!-- More visible way how to change dependency versions -->
<paper.version>1.21.11-R0.1-SNAPSHOT</paper.version>
<bentobox.version>3.17.0</bentobox.version>
<paper.version>26.3.build.231-stable</paper.version>
<bentobox.version>3.23.7</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>3.4.1</build.version>
<build.version>3.5.0</build.version>

<sonar.projectKey>BentoBoxWorld_Boxed</sonar.projectKey>
<sonar.organization>bentobox-world</sonar.organization>
Expand Down Expand Up @@ -165,7 +165,7 @@
<!-- MockBukkit -->
<dependency>
<groupId>org.mockbukkit.mockbukkit</groupId>
<artifactId>mockbukkit-v1.21</artifactId>
<artifactId>mockbukkit-v26.3</artifactId>
<version>${mock-bukkit.version}</version>
<scope>test</scope>
</dependency>
Expand Down Expand Up @@ -312,7 +312,7 @@
<configuration>
<archive>
<manifestEntries>
<paperweight-mappings-namespace>spigot</paperweight-mappings-namespace>
<paperweight-mappings-namespace>mojang</paperweight-mappings-namespace>
</manifestEntries>
</archive>
</configuration>
Expand Down Expand Up @@ -363,7 +363,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.10</version>
<version>0.8.15</version>
<configuration>
<append>true</append>
<excludes>
Expand Down
52 changes: 52 additions & 0 deletions src/main/java/world/bentobox/boxed/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,31 @@ public class Settings implements WorldSettings {
@ConfigEntry(path = "world.falling-banned-commands")
private List<String> fallingBannedCommands = new ArrayList<>();

@ConfigComment("Per-world override for vanilla structure generation and structure searches")
@ConfigComment("(/locate, Eyes of Ender, explorer/treasure maps, dolphins, cartographer trades).")
@ConfigComment("Boxed generates vanilla worlds with structures, so this allows per-structure control.")
@ConfigComment("Key is the vanilla structure id (e.g. trial_chambers, ancient-city), value is:")
@ConfigComment(" false - disable the structure in Boxed worlds")
@ConfigComment(" true - force it on even if BentoBox's global world.disabled-structures disables it")
@ConfigComment("Structures not listed inherit BentoBox's global world.disabled-structures setting.")
@ConfigComment("Example:")
@ConfigComment(" structure-settings:")
@ConfigComment(" monument: false")
@ConfigComment(" trial_chambers: false")
@ConfigComment("Requires BentoBox 3.19.1 or later.")
@ConfigEntry(path = "world.structure-settings", since = "3.5.0")
private Map<String, Boolean> structureSettings = new HashMap<>();

// ---------------------------------------------

/* ISLAND */
@ConfigComment("Disable the team system in Boxed worlds.")
@ConfigComment("When true, players cannot invite, accept team invites, kick, leave, promote, demote")
@ConfigComment("or change island owner. Trust and coop still work and are the alternative to teams.")
@ConfigComment("After turning this on, run /boxadmin team disbandall once to remove existing team members.")
@ConfigComment("Requires BentoBox 3.16.0 or later.")
@ConfigEntry(path = "area.teams-disabled", since = "3.5.0")
private boolean teamsDisabled = false;
@ConfigComment("Default max team size")
@ConfigComment("Permission size cannot be less than the default below. ")
@ConfigEntry(path = "area.max-team-size")
Expand Down Expand Up @@ -1824,4 +1846,34 @@ public void setAllowStructures(boolean allowStructures) {
this.allowStructures = allowStructures;
}

/**
* @return per-structure generation overrides for this game mode's worlds
*/
@Override
public Map<String, Boolean> getStructureSettings() {
return structureSettings;
}

/**
* @param structureSettings per-structure generation overrides to set
*/
public void setStructureSettings(Map<String, Boolean> structureSettings) {
this.structureSettings = structureSettings;
}

/**
* @return true if the team subsystem is disabled in this game mode's worlds
*/
@Override
public boolean isTeamsDisabled() {
return teamsDisabled;
}

/**
* @param teamsDisabled whether to disable the team subsystem
*/
public void setTeamsDisabled(boolean teamsDisabled) {
this.teamsDisabled = teamsDisabled;
}

}
2 changes: 1 addition & 1 deletion src/main/resources/addon.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Boxed
main: world.bentobox.boxed.Boxed
version: ${version}${build.number}
api-version: 3.9.0
api-version: 3.23.0
metrics: true
icon: "COMPOSTER"
repository: "BentoBoxWorld/Boxed"
Expand Down
21 changes: 21 additions & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,28 @@ world:
# Falling banned commands - players cannot use these commands when falling
# if the PREVENT_TELEPORT_WHEN_FALLING world setting flag is active
falling-banned-commands: []
# Per-world override for vanilla structure generation and structure searches
# (/locate, Eyes of Ender, explorer/treasure maps, dolphins, cartographer trades).
# Boxed generates vanilla worlds with structures, so this allows per-structure control.
# Key is the vanilla structure id (e.g. trial_chambers, ancient-city), value is:
# false - disable the structure in Boxed worlds
# true - force it on even if BentoBox's global world.disabled-structures disables it
# Structures not listed inherit BentoBox's global world.disabled-structures setting.
# Example:
# structure-settings:
# monument: false
# trial_chambers: false
# Requires BentoBox 3.19.1 or later.
# Added since 3.5.0.
structure-settings: {}
area:
# Disable the team system in Boxed worlds.
# When true, players cannot invite, accept team invites, kick, leave, promote, demote
# or change island owner. Trust and coop still work and are the alternative to teams.
# After turning this on, run /boxadmin team disbandall once to remove existing team members.
# Requires BentoBox 3.16.0 or later.
# Added since 3.5.0.
teams-disabled: false
# Default max team size
# Permission size cannot be less than the default below.
max-team-size: 4
Expand Down
19 changes: 19 additions & 0 deletions src/test/java/world/bentobox/boxed/SettingsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -401,4 +401,23 @@ void testGetAdminCommand() {
assertEquals("admin", s.getAdminCommandAliases());
}

/**
* Test method for {@link world.bentobox.boxed.Settings#setStructureSettings(java.util.Map)}.
*/
@Test
void testSetStructureSettings() {
Map<String, Boolean> structureSettings = Collections.emptyMap();
s.setStructureSettings(structureSettings);
assertEquals(structureSettings, s.getStructureSettings());
}

/**
* Test method for {@link world.bentobox.boxed.Settings#setTeamsDisabled(boolean)}.
*/
@Test
void testSetTeamsDisabled() {
s.setTeamsDisabled(true);
assertTrue(s.isTeamsDisabled());
}

}
Loading