Skip to content

Commit d9adc9e

Browse files
authored
Merge pull request #168 from BentoBoxWorld/develop
Release 1.21.0
2 parents 876facc + 954135f commit d9adc9e

47 files changed

Lines changed: 1348 additions & 1282 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Publish to Modrinth
2+
3+
# Triggers when you publish a GitHub Release
4+
on:
5+
release:
6+
types: [published]
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: 'Release tag to publish (e.g. 2.6.0)'
11+
required: true
12+
type: string
13+
14+
jobs:
15+
publish:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
20+
steps:
21+
# 1. Check out the repository at the release tag
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
# 2. Set up Java 21
26+
- name: Set up Java 21
27+
uses: actions/setup-java@v4
28+
with:
29+
java-version: '21'
30+
distribution: 'temurin'
31+
32+
# 3. Cache Maven dependencies to speed up builds
33+
- name: Cache Maven packages
34+
uses: actions/cache@v4
35+
with:
36+
path: ~/.m2
37+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
38+
restore-keys: ${{ runner.os }}-m2
39+
40+
# 4. Build the JAR
41+
# GIT_BRANCH=origin/master activates the Maven 'master' profile which
42+
# produces a clean version number (e.g. 2.6.0) without -SNAPSHOT/-LOCAL.
43+
- name: Build with Maven
44+
run: mvn -B clean package -DskipTests
45+
env:
46+
GIT_BRANCH: origin/master
47+
48+
# 5. Upload the JAR to Modrinth
49+
#
50+
# Prerequisites — add these secrets in your GitHub repo settings
51+
# (Settings → Secrets and variables → Actions):
52+
#
53+
# MODRINTH_TOKEN — personal access token from https://modrinth.com/settings/pats
54+
# (scope: "Create versions")
55+
# MODRINTH_PROJECT_ID — your Modrinth project ID for AcidIsland, visible on the
56+
# project page under the three-dot menu ("Copy ID")
57+
#
58+
- name: Publish to Modrinth
59+
uses: cloudnode-pro/modrinth-publish@0be4916ad5f081d936eb5615aa35ce3f0949979c # v2
60+
with:
61+
token: ${{ secrets.MODRINTH_TOKEN }}
62+
project: ${{ secrets.MODRINTH_PROJECT_ID }}
63+
64+
# Use the release tag, or the manually supplied tag when triggered via workflow_dispatch
65+
version: ${{ github.event.release.tag_name || inputs.tag }}
66+
67+
# Use the GitHub release body as the changelog (empty when run manually)
68+
changelog: ${{ github.event.release.body }}
69+
70+
# AcidIsland is a BentoBox addon running on Paper-based servers
71+
loaders: |-
72+
paper
73+
purpur
74+
75+
# Minecraft versions supported (BentoBox API 3.12.0 targets Paper 1.21.11+)
76+
game-versions: |-
77+
1.21.5
78+
1.21.6
79+
1.21.7
80+
1.21.8
81+
1.21.9
82+
1.21.10
83+
1.21.11
84+
26.1
85+
26.1.1
86+
87+
# Path to the built JAR
88+
files: target/AcidIsland-${{ github.event.release.tag_name || inputs.tag }}.jar

CLAUDE.md

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
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.
8+
9+
## Build Commands
10+
11+
```bash
12+
mvn clean package # Build (default goal)
13+
mvn clean test # Run all tests
14+
mvn test -Dtest=AcidEffectTest # Run a single test class
15+
mvn test -Dtest=AcidEffectTest#testMethod # Run a single test method
16+
mvn -DskipTests clean package # Build without tests
17+
```
18+
19+
Java 21 is required. The project uses Maven with the Shade plugin to produce the final JAR.
20+
21+
## Architecture
22+
23+
### Addon Lifecycle
24+
25+
This is a BentoBox addon, not a standalone plugin. The lifecycle flows through:
26+
1. **`AcidIslandPladdon`** — Bukkit plugin entry point (Pladdon wrapper), instantiates the addon
27+
2. **`AcidIsland`** (extends `GameModeAddon`) — Main addon class with `onLoad()``createWorlds()``onEnable()``allLoaded()` lifecycle
28+
3. **`AISettings`** — Configuration POJO with BentoBox `@ConfigEntry` annotations, implements `WorldSettings`
29+
30+
### Key Packages
31+
32+
- **`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.
33+
- **`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.
34+
- **`events/`** — Custom Bukkit events (`AcidEvent`, `AcidRainEvent`, `EntityDamageByAcidEvent`, etc.) that are cancellable, allowing other plugins to modify acid behavior.
35+
36+
### Testing
37+
38+
Tests use **JUnit 5 + MockBukkit + Mockito 5**. The standard pattern for each test class:
39+
40+
```java
41+
@ExtendWith(MockitoExtension.class)
42+
@MockitoSettings(strictness = Strictness.LENIENT)
43+
public class MyTest {
44+
private ServerMock server;
45+
private MockedStatic<Bukkit> mockedBukkit;
46+
47+
@BeforeEach
48+
public void setUp() {
49+
server = MockBukkit.mock(); // always first
50+
mockedBukkit = Mockito.mockStatic(Bukkit.class, Mockito.RETURNS_DEEP_STUBS);
51+
mockedBukkit.when(Bukkit::getMinecraftVersion).thenReturn("1.21.11");
52+
mockedBukkit.when(Bukkit::getServer).thenReturn(server);
53+
// ...
54+
}
55+
56+
@AfterEach
57+
public void tearDown() {
58+
mockedBukkit.closeOnDemand();
59+
MockBukkit.unmock();
60+
}
61+
}
62+
```
63+
64+
Key rules:
65+
- **Do NOT call `Mockito.framework().clearInlineMocks()` in `@AfterEach`** — it disables `@BeforeAll` mocks and interferes with MockitoExtension's mock lifecycle for subsequent tests.
66+
- 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.
67+
- `paper-api` is a `provided` dependency (not `spigot-api`) — this is what puts `getMinecraftVersion()` on the compile/test classpath.
68+
- MockBukkit's JUnit transitive deps are excluded in `pom.xml` to avoid JUnit 6 version conflicts with surefire.
69+
- Do not use `new ItemStack(Material.AIR)` in tests — use `null` for empty armor slots; Paper 1.21's ItemStack handles AIR differently.
70+
- 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"`).
71+
72+
### Locales
73+
74+
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.
75+
76+
### Configuration
77+
78+
- `src/main/resources/config.yml` — Default config with acid damage values, rain settings, potion effects, world generation params
79+
- `src/main/resources/addon.yml` — BentoBox addon metadata and permissions (requires `api-version: 3.12.0`)
80+
- `src/main/resources/locales/` — 24 language translation files (MiniMessage format)
81+
- `src/main/resources/blueprints/` — Island templates (overworld, nether, end)
82+
83+
## CI
84+
85+
GitHub Actions workflow on `develop` branch and PRs: builds with Java 21, runs JaCoCo coverage, reports to SonarCloud.
86+
87+
## Dependency Source Lookup
88+
89+
When you need to inspect source code for a dependency (e.g., BentoBox, addons):
90+
91+
1. **Check local Maven repo first**: `~/.m2/repository/` — sources jars are named `*-sources.jar`
92+
2. **Check the workspace**: Look for sibling directories or Git submodules that may contain the dependency as a local project (e.g., `../bentoBox`, `../addon-*`)
93+
3. **Check Maven local cache for already-extracted sources** before downloading anything
94+
4. Only download a jar or fetch from the internet if the above steps yield nothing useful
95+
96+
Prefer reading `.java` source files directly from a local Git clone over decompiling or extracting a jar.
97+
98+
In general, the latest version of BentoBox should be targeted.
99+
100+
## Project Layout
101+
102+
Related projects are checked out as siblings under `~/git/`:
103+
104+
**Core:**
105+
- `bentobox/` — core BentoBox framework
106+
107+
**Game modes:**
108+
- `addon-acidisland/` — AcidIsland game mode
109+
- `addon-bskyblock/` — BSkyBlock game mode
110+
- `Boxed/` — Boxed game mode (expandable box area)
111+
- `CaveBlock/` — CaveBlock game mode
112+
- `OneBlock/` — AOneBlock game mode
113+
- `SkyGrid/` — SkyGrid game mode
114+
- `RaftMode/` — Raft survival game mode
115+
- `StrangerRealms/` — StrangerRealms game mode
116+
- `Brix/` — plot game mode
117+
- `parkour/` — Parkour game mode
118+
- `poseidon/` — Poseidon game mode
119+
- `gg/` — gg game mode
120+
121+
**Addons:**
122+
- `addon-level/` — island level calculation
123+
- `addon-challenges/` — challenges system
124+
- `addon-welcomewarpsigns/` — warp signs
125+
- `addon-limits/` — block/entity limits
126+
- `addon-invSwitcher/` / `invSwitcher/` — inventory switcher
127+
- `addon-biomes/` / `Biomes/` — biomes management
128+
- `Bank/` — island bank
129+
- `Border/` — world border for islands
130+
- `Chat/` — island chat
131+
- `CheckMeOut/` — island submission/voting
132+
- `ControlPanel/` — game mode control panel
133+
- `Converter/` — ASkyBlock to BSkyBlock converter
134+
- `DimensionalTrees/` — dimension-specific trees
135+
- `discordwebhook/` — Discord integration
136+
- `Downloads/` — BentoBox downloads site
137+
- `DragonFights/` — per-island ender dragon fights
138+
- `ExtraMobs/` — additional mob spawning rules
139+
- `FarmersDance/` — twerking crop growth
140+
- `GravityFlux/` — gravity addon
141+
- `Greenhouses-addon/` — greenhouse biomes
142+
- `IslandFly/` — island flight permission
143+
- `IslandRankup/` — island rankup system
144+
- `Likes/` — island likes/dislikes
145+
- `Limits/` — block/entity limits
146+
- `lost-sheep/` — lost sheep adventure
147+
- `MagicCobblestoneGenerator/` — custom cobblestone generator
148+
- `PortalStart/` — portal-based island start
149+
- `pp/` — pp addon
150+
- `Regionerator/` — region management
151+
- `Residence/` — residence addon
152+
- `TopBlock/` — top ten for OneBlock
153+
- `TwerkingForTrees/` — twerking tree growth
154+
- `Upgrades/` — island upgrades (Vault)
155+
- `Visit/` — island visiting
156+
- `weblink/` — web link addon
157+
- `CrowdBound/` — CrowdBound addon
158+
159+
**Data packs:**
160+
- `BoxedDataPack/` — advancement datapack for Boxed
161+
162+
**Documentation & tools:**
163+
- `docs/` — main documentation site
164+
- `docs-chinese/` — Chinese documentation
165+
- `docs-french/` — French documentation
166+
- `BentoBoxWorld.github.io/` — GitHub Pages site
167+
- `website/` — website
168+
- `translation-tool/` — translation tool
169+
170+
Check these for source before any network fetch.
171+
172+
## Key Dependencies (source locations)
173+
174+
- `world.bentobox:bentobox``~/git/bentobox/src/`

0 commit comments

Comments
 (0)