Skip to content

Make the generator AcidIsland-aware - #174

Closed
tastybento wants to merge 1 commit into
developfrom
feature/acid-island-aware
Closed

Make the generator AcidIsland-aware#174
tastybento wants to merge 1 commit into
developfrom
feature/acid-island-aware

Conversation

@tastybento

Copy link
Copy Markdown
Member

Problem

Fixes #173.

Vanilla forms two different blocks from lava + water, at two different positions:

Case Block that changes New state
Classic generator (lava beside water) the lava block COBBLESTONE
Lava poured down into water/ocean the water block STONE

AcidIsland only blocks the second case: LavaCheck listens to BlockFromToEvent where the target block is water and, one tick later, reverts the block to water if it is still STONE. That is why AcidIsland players cannot farm the ocean with a lava bucket, while normal cobblestone generators keep working.

This addon defeated that protection. VanillaGeneratorListener runs on BlockFormEvent at MONITOR and rewrites the new state to a generator block, so AcidIsland's next-tick == STONE check no longer matched and the block survived. A single lava bucket over an ocean could therefore be used to convert huge amounts of water into diamond ore and to boost the island level massively. Since Util.getWorld() maps nether and end back to the overworld, AcidIsland intends this protection in all three dimensions, which matches the report.

Fix

  • New AcidIslandHelper utility that reports whether AcidIsland will revert stone formed in water: it looks the game mode up with IslandWorldManager#getAddon(World), checks that its name is AcidIsland, and reads getAcidDamage() from its world settings reflectively (cached Method). AcidIsland is only a soft dependency, so this adds no new build dependency and does nothing when AcidIsland is not installed.
  • VanillaGeneratorListener skips generation when a water block turns into stone in such a world, and reports the reason through Why, so /[admin] why generator explains it. Cobblestone generators form their block at the lava block, so they are unaffected.
  • New acid-island-aware config option (default true) to turn the behaviour off.

Tests

New VanillaGeneratorListenerTest, the first test for this listener, covering five cases: block is skipped in acid water; block is still replaced when acid damage is 0, when the option is disabled, and in other game modes; and the classic cobblestone generator still works in AcidIsland.

Full suite: 170 tests, 0 failures.

Note

This only helps AcidIsland. In game modes with no acid water, a large protected ocean can still be used the same way, since nothing reverts the stone there. A general option to skip water-to-stone generation in any game mode could be added if wanted, but it was left out here because it would silently disable legitimate STONE type generators.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SDLdE5LSXRwc6NQhYvzyiv

AcidIsland water is acid, so its LavaCheck listener turns stone, that
vanilla creates when lava pours into water, back into water. It does that
by checking one tick later if the block is still stone. This addon
replaced the forming stone with a generator block before that check ran,
so the block survived and a single lava bucket could be used to convert
an entire ocean into generator blocks.

The addon now skips block generation when a water block turns into stone
in a world that is managed by AcidIsland and that has acid damage
enabled, so AcidIsland can revert it as it normally does. Cobblestone
generators form the block at the lava block, so they are not affected.

AcidIsland is a soft dependency, so the game mode is recognised by its
name and the acid damage value is read reflectively.

Can be disabled with the new `acid-island-aware` config option.

#173

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SDLdE5LSXRwc6NQhYvzyiv
@sonarqubecloud

Copy link
Copy Markdown

@BONNe

BONNe commented Aug 11, 2026

Copy link
Copy Markdown
Member

Like I am not appose to this, but people could just disable stone generators in acid island, as this is basically what it will do.
Should it be done automatically as this code would do or manually by OP? I do not know what is correct way.

@tastybento

Copy link
Copy Markdown
Member Author

Thanks @BONNe, that answers it — I did not realise the generator type was already a per-tier switch over the four lava mechanics, and the height range covers the sea level case neatly too.

Agreed that this is better handled by the admin than automatically: the code here silently stops a STONE tier that an admin deliberately configured, and it does nothing for the same ocean abuse on game modes without acid water. Closing in favour of the manual route.

The real gap is that none of this is discoverable. The docs only said Generator type: COBBLESTONE, STONE or BASALT. Self explanatory., and in the GUI the hint about which mechanic each type reacts to only appears inside the type picker, not on the button that opens it. I will send a docs PR with your four-mechanic breakdown plus the two remedies (do not hand out STONE tiers, or give them a height range that excludes sea level), and a small locale change so the Generator Type button itself explains what the types key off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lava over water

2 participants