Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
a834093
Version 1.20.2
tastybento Jan 11, 2026
efe282d
Fix NPE in Essentials god mode check when EssentialsX fails to load
tastybento Apr 4, 2026
2db48bc
Update Spigot version to 1.21.11-R0.1-SNAPSHOT in pom.xml
tastybento Apr 4, 2026
ea46fca
Version 1.21.0
tastybento Apr 4, 2026
00f84e5
Migrate all tests from JUnit 4 + PowerMock to JUnit 5 + Mockito 5
tastybento Apr 4, 2026
8980b1a
Add missing JUnit tests for coverage
tastybento Apr 4, 2026
becd32a
Add CLAUDE.md for project documentation and build instructions
tastybento Apr 4, 2026
5369a23
Migrate locale files from legacy color codes to MiniMessage format
tastybento Apr 8, 2026
14a5322
Merge pull request #167 from BentoBoxWorld/feature/minimessage-transl…
tastybento Apr 8, 2026
21917e6
Require BentoBox 3.12.0 minimum for MiniMessage support
tastybento Apr 8, 2026
11decd0
Migrate to Paper API + MockBukkit test pattern; fix all test failures
tastybento Apr 8, 2026
104380a
Update CLAUDE.md
tastybento Apr 8, 2026
65e38d4
Update CLAUDE.md to reflect Paper API + JUnit 5 + MockBukkit migration
tastybento Apr 8, 2026
2cc4515
Add CLAUDE.md for project documentation and build instructions
tastybento Apr 11, 2026
dab9000
Add Cherry Grove Sanctuary starter island blueprint
tastybento Apr 11, 2026
8ee9ac8
Update addon.yml for BentoBox API version 3.14.0 and adjust blueprint…
tastybento Apr 11, 2026
7ab6456
Merge remote-tracking branch 'origin/develop' into develop
tastybento Apr 11, 2026
954135f
Add Modrinth publish GitHub Actions workflow
tastybento Apr 12, 2026
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
88 changes: 88 additions & 0 deletions .github/workflows/modrinth-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Publish to Modrinth

# Triggers when you publish a GitHub Release
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: 'Release tag to publish (e.g. 2.6.0)'
required: true
type: string

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
# 1. Check out the repository at the release tag
- name: Checkout repository
uses: actions/checkout@v4

# 2. Set up Java 21
- name: Set up Java 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'

# 3. Cache Maven dependencies to speed up builds
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

# 4. Build the JAR
# GIT_BRANCH=origin/master activates the Maven 'master' profile which
# produces a clean version number (e.g. 2.6.0) without -SNAPSHOT/-LOCAL.
- name: Build with Maven
run: mvn -B clean package -DskipTests
env:
GIT_BRANCH: origin/master

# 5. Upload the JAR to Modrinth
#
# Prerequisites — add these secrets in your GitHub repo settings
# (Settings → Secrets and variables → Actions):
#
# MODRINTH_TOKEN — personal access token from https://modrinth.com/settings/pats
# (scope: "Create versions")
# MODRINTH_PROJECT_ID — your Modrinth project ID for AcidIsland, visible on the
# project page under the three-dot menu ("Copy ID")
#
- name: Publish to Modrinth
uses: cloudnode-pro/modrinth-publish@0be4916ad5f081d936eb5615aa35ce3f0949979c # v2
with:
token: ${{ secrets.MODRINTH_TOKEN }}
project: ${{ secrets.MODRINTH_PROJECT_ID }}

# Use the release tag, or the manually supplied tag when triggered via workflow_dispatch
version: ${{ github.event.release.tag_name || inputs.tag }}

# Use the GitHub release body as the changelog (empty when run manually)
changelog: ${{ github.event.release.body }}

# AcidIsland is a BentoBox addon running on Paper-based servers
loaders: |-
paper
purpur

# Minecraft versions supported (BentoBox API 3.12.0 targets Paper 1.21.11+)
game-versions: |-
1.21.5
1.21.6
1.21.7
1.21.8
1.21.9
1.21.10
1.21.11
26.1
26.1.1

# Path to the built JAR
files: target/AcidIsland-${{ github.event.release.tag_name || inputs.tag }}.jar
174 changes: 174 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Overview

AcidIsland is a BentoBox GameModeAddon for Minecraft (Paper). It implements a Skyblock-like game mode where the ocean is acid that damages players, mobs, and items. Requires BentoBox 3.12.0+ as the parent plugin framework.

## Build Commands

```bash
mvn clean package # Build (default goal)
mvn clean test # Run all tests
mvn test -Dtest=AcidEffectTest # Run a single test class
mvn test -Dtest=AcidEffectTest#testMethod # Run a single test method
mvn -DskipTests clean package # Build without tests
```

Java 21 is required. The project uses Maven with the Shade plugin to produce the final JAR.

## Architecture

### Addon Lifecycle

This is a BentoBox addon, not a standalone plugin. The lifecycle flows through:
1. **`AcidIslandPladdon`** — Bukkit plugin entry point (Pladdon wrapper), instantiates the addon
2. **`AcidIsland`** (extends `GameModeAddon`) — Main addon class with `onLoad()` → `createWorlds()` → `onEnable()` → `allLoaded()` lifecycle
3. **`AISettings`** — Configuration POJO with BentoBox `@ConfigEntry` annotations, implements `WorldSettings`

### Key Packages

- **`listeners/`** — `AcidEffect` is the core gameplay listener handling all acid damage (players, mobs, items, armor protection, potion effects, Essentials integration). `LavaCheck` prevents normal stone generation from lava+acid water.
- **`world/`** — `ChunkGeneratorWorld` generates ocean floor terrain using Perlin noise. `AcidTask` is a repeating task applying acid damage to entities in water. `AcidBiomeProvider` provides biomes per environment type.
- **`events/`** — Custom Bukkit events (`AcidEvent`, `AcidRainEvent`, `EntityDamageByAcidEvent`, etc.) that are cancellable, allowing other plugins to modify acid behavior.

### Testing

Tests use **JUnit 5 + MockBukkit + Mockito 5**. The standard pattern for each test class:

```java
@ExtendWith(MockitoExtension.class)
@MockitoSettings(strictness = Strictness.LENIENT)
public class MyTest {
private ServerMock server;
private MockedStatic<Bukkit> mockedBukkit;

@BeforeEach
public void setUp() {
server = MockBukkit.mock(); // always first
mockedBukkit = Mockito.mockStatic(Bukkit.class, Mockito.RETURNS_DEEP_STUBS);
mockedBukkit.when(Bukkit::getMinecraftVersion).thenReturn("1.21.11");
mockedBukkit.when(Bukkit::getServer).thenReturn(server);
// ...
}

@AfterEach
public void tearDown() {
mockedBukkit.closeOnDemand();
MockBukkit.unmock();
}
}
```

Key rules:
- **Do NOT call `Mockito.framework().clearInlineMocks()` in `@AfterEach`** — it disables `@BeforeAll` mocks and interferes with MockitoExtension's mock lifecycle for subsequent tests.
- Always mock `Bukkit::getMinecraftVersion` — BentoBox 3.12.0 calls it in a static initializer and Paper API is required for it to exist on the classpath.
- `paper-api` is a `provided` dependency (not `spigot-api`) — this is what puts `getMinecraftVersion()` on the compile/test classpath.
- MockBukkit's JUnit transitive deps are excluded in `pom.xml` to avoid JUnit 6 version conflicts with surefire.
- Do not use `new ItemStack(Material.AIR)` in tests — use `null` for empty armor slots; Paper 1.21's ItemStack handles AIR differently.
- Do not reference `world.bentobox.bentobox.lists.Flags` static fields in tests — the class static initializer requires full BentoBox initialization. Use the string flag ID instead (e.g., `"ANIMAL_NATURAL_SPAWN"`).

### Locales

All 24 locale files use **MiniMessage format** (e.g., `<red>`, `<dark_blue>`). Legacy `&` color codes must not be used. BentoBox 3.12.0+ is required for MiniMessage support.

### Configuration

- `src/main/resources/config.yml` — Default config with acid damage values, rain settings, potion effects, world generation params
- `src/main/resources/addon.yml` — BentoBox addon metadata and permissions (requires `api-version: 3.12.0`)
- `src/main/resources/locales/` — 24 language translation files (MiniMessage format)
- `src/main/resources/blueprints/` — Island templates (overworld, nether, end)

## CI

GitHub Actions workflow on `develop` branch and PRs: builds with Java 21, runs JaCoCo coverage, reports to SonarCloud.

## Dependency Source Lookup

When you need to inspect source code for a dependency (e.g., BentoBox, addons):

1. **Check local Maven repo first**: `~/.m2/repository/` — sources jars are named `*-sources.jar`
2. **Check the workspace**: Look for sibling directories or Git submodules that may contain the dependency as a local project (e.g., `../bentoBox`, `../addon-*`)
3. **Check Maven local cache for already-extracted sources** before downloading anything
4. Only download a jar or fetch from the internet if the above steps yield nothing useful

Prefer reading `.java` source files directly from a local Git clone over decompiling or extracting a jar.

In general, the latest version of BentoBox should be targeted.

## Project Layout

Related projects are checked out as siblings under `~/git/`:

**Core:**
- `bentobox/` — core BentoBox framework

**Game modes:**
- `addon-acidisland/` — AcidIsland game mode
- `addon-bskyblock/` — BSkyBlock game mode
- `Boxed/` — Boxed game mode (expandable box area)
- `CaveBlock/` — CaveBlock game mode
- `OneBlock/` — AOneBlock game mode
- `SkyGrid/` — SkyGrid game mode
- `RaftMode/` — Raft survival game mode
- `StrangerRealms/` — StrangerRealms game mode
- `Brix/` — plot game mode
- `parkour/` — Parkour game mode
- `poseidon/` — Poseidon game mode
- `gg/` — gg game mode

**Addons:**
- `addon-level/` — island level calculation
- `addon-challenges/` — challenges system
- `addon-welcomewarpsigns/` — warp signs
- `addon-limits/` — block/entity limits
- `addon-invSwitcher/` / `invSwitcher/` — inventory switcher
- `addon-biomes/` / `Biomes/` — biomes management
- `Bank/` — island bank
- `Border/` — world border for islands
- `Chat/` — island chat
- `CheckMeOut/` — island submission/voting
- `ControlPanel/` — game mode control panel
- `Converter/` — ASkyBlock to BSkyBlock converter
- `DimensionalTrees/` — dimension-specific trees
- `discordwebhook/` — Discord integration
- `Downloads/` — BentoBox downloads site
- `DragonFights/` — per-island ender dragon fights
- `ExtraMobs/` — additional mob spawning rules
- `FarmersDance/` — twerking crop growth
- `GravityFlux/` — gravity addon
- `Greenhouses-addon/` — greenhouse biomes
- `IslandFly/` — island flight permission
- `IslandRankup/` — island rankup system
- `Likes/` — island likes/dislikes
- `Limits/` — block/entity limits
- `lost-sheep/` — lost sheep adventure
- `MagicCobblestoneGenerator/` — custom cobblestone generator
- `PortalStart/` — portal-based island start
- `pp/` — pp addon
- `Regionerator/` — region management
- `Residence/` — residence addon
- `TopBlock/` — top ten for OneBlock
- `TwerkingForTrees/` — twerking tree growth
- `Upgrades/` — island upgrades (Vault)
- `Visit/` — island visiting
- `weblink/` — web link addon
- `CrowdBound/` — CrowdBound addon

**Data packs:**
- `BoxedDataPack/` — advancement datapack for Boxed

**Documentation & tools:**
- `docs/` — main documentation site
- `docs-chinese/` — Chinese documentation
- `docs-french/` — French documentation
- `BentoBoxWorld.github.io/` — GitHub Pages site
- `website/` — website
- `translation-tool/` — translation tool

Check these for source before any network fetch.

## Key Dependencies (source locations)

- `world.bentobox:bentobox` → `~/git/bentobox/src/`
Loading
Loading