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
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Rewild

Registered in the owner's ops process (`~/Code/ops`). Area: `minecraft-plugins` (lead: Minecraft: Plugins Lead). Added 2026-11-09 from the ops starter kit; the repo itself dates from 2026-11-07 (as WildernessRegen).
Registered in the owner's ops process (`~/Code/ops`). Area: `minecraft-plugins` (lead: Minecraft: Plugins Lead). Added 2026-11-09 from the ops starter kit; the repo itself dates from 2026-11-07.

**Before doing anything here, run `~/Code/ops/scripts/repo-context`.** It shows who leads this repo, whether that session is active, what's pending, and which briefs apply. If it says the repo has no active owner, tell the director ("Helm") before starting work.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Before either kind of change, the plugin checks the bedrock pattern of the fresh

If the server has no claim plugin at all, set `claims.plugin: none`.

**Upgrading from 0.2.x:** 0.2.x only recorded some placed blocks, so chunks it tracked stay unknown and never rewild. Only land generated after the upgrade can. The `intent` settings in config.yml do nothing now and can be deleted. `/wr`, `/wildernessregen` and the `wildernessregen.admin` permission are gone; use `/rewild` and `rewild.admin`.
**Upgrading from 0.2.x:** 0.2.x only recorded some placed blocks, so chunks it tracked stay unknown and never rewild. Only land generated after the upgrade can. The `intent` settings in config.yml do nothing now and can be deleted.admin` permission are gone; use `/rewild` and `rewild.admin`.

## Commands

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

group = "com.extantape"
version = "0.3.1"
version = "0.3.2"

java {
toolchain.languageVersion.set(JavaLanguageVersion.of(25))
Expand Down
4 changes: 4 additions & 0 deletions docs/decisions.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ Decisions in the design brief that weren't reopened: off by default in every wor
- Plugins report through `KeepProvider` (whole chunks, as before, and now block areas) or with `/rewild keep <world> <x y z> [<x y z>] plugin:<Name> [note]` and `/rewild unkeep`. An admin's keeps always count; a plugin's count while it's respected. `--json` on `keep list` and `plugins`.
- Player-placed blocks are found by Rewild's own tracking, which now records every placed block. CoreProtect stays optional and unused, so Rewild doesn't depend on it while it's off on 26.3. Chunks generated before 0.3.0's tracking began stay unknown, because 0.2.x recorded only some placed blocks.
- `/wr`, `/wildernessregen` and `wildernessregen.admin` are removed, as announced for the release after 0.2.x.

## 2026-11-14

- **No old names (owner, D196):** "Make sure none of the plugins retain old references or commands". The folder move from the plugin's earlier name and its tests are removed. Released as 0.3.2.
9 changes: 9 additions & 0 deletions docs/releases/v0.3.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
No old names (owner, D196). Rewild no longer looks for the folder of the plugin it was renamed from, and its last mentions are gone from the docs and tests. Nothing changes for a server already on 0.3.x.

## Upgrading

Replace the jar. No config or data changes.

## Tested

Unit tests pass.
2 changes: 0 additions & 2 deletions docs/test-audit.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,9 @@ Rewild changes world files, so its safety promises come first. "Acceptance" is `
| Crash-safe at every step, including undo | unit `crashAtEveryStepResumesToTheSameResult`, `crashDuringUndoResumes`; acceptance kill -9 |
| Read-only world or unwritable trash: no change at all | unit `readOnlyWorldFolderFailsWithoutChangingAnything`, `trashThatCantBeWrittenStopsBeforeAnyChange` |
| Below-ground repair only under the cut; refused if bedrock differs | unit `belowGroundRepairReplacesOnlySectionsUnderTheCut`, `referenceWithDifferentBedrockIsRefused` |
| Upgrade from WildernessRegen: folder moved, fails closed | unit `MigrationTest`; acceptance "Upgrade from WildernessRegen" |

**Gaps added this audit:** the never-reset test in bold.

**Found and fixed:** 0.2.0 still told admins to use `/wr` in several messages and log lines (a miss in the rename). 0.2.1 names `/rewild` everywhere; the deprecation notice still names `/wr` on purpose.

**Skipped, with reasons:**
- How a reset area looks and blends in a real client: real client only, in the README's untested list.
Expand Down
32 changes: 0 additions & 32 deletions src/main/java/com/extantape/rewild/Migration.java

This file was deleted.

19 changes: 2 additions & 17 deletions src/main/java/com/extantape/rewild/RewildPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,9 @@ public final class RewildPlugin extends JavaPlugin {
private RunService runs;
private Preview preview;
private MapLayer mapLayer = MapLayer.NONE;
/** Set when the move from plugins/WildernessRegen failed. Then nothing runs at all, so no data is stranded. */
private String migrationProblem;

/** Runs before any world loads: apply or undo approved runs while no chunk is open. */
@Override
public void onLoad() {
Migration.Result moved = Migration.moveIfMissing(getDataFolder().toPath().resolveSibling("WildernessRegen"), getDataFolder().toPath());
if (moved.failed()) {
migrationProblem = moved.message();
getLogger().severe(moved.message());
return;
}
if (moved.message() != null) getLogger().warning(moved.message());
saveDefaultConfig();
reloadConfig();
config = new RegenConfig(getConfig());
Expand Down Expand Up @@ -81,11 +71,6 @@ public void onLoad() {

@Override
public void onEnable() {
if (migrationProblem != null) {
getLogger().severe("Rewild is turning itself off, so nothing resets until the folder is moved. " + migrationProblem);
getServer().getPluginManager().disablePlugin(this);
return;
}
warnUnknownMaterials();
tracking = new Tracking(this, config);
tracking.start(startupStores);
Expand All @@ -102,10 +87,10 @@ public void onEnable() {
getLogger().warning("BlueMap is installed but its API couldn't be loaded; no map layer: " + e);
}
}
RewildCommand wr = new RewildCommand(this);
RewildCommand command = new RewildCommand(this);
getLifecycleManager().registerEventHandler(io.papermc.paper.plugin.lifecycle.event.types.LifecycleEvents.COMMANDS,
event -> {
event.registrar().register("rewild", "Rewild admin tools", wr);
event.registrar().register("rewild", "Rewild admin tools", command);
});
if (config.dryRun) getLogger().info("Dry run is on: approved runs are checked at startup and nothing resets.");
if (tracking.states().isEmpty()) getLogger().info("No world is enabled yet. Add one under worlds: in config.yml.");
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/extantape/rewild/region/RegionFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public void writeAtomically() throws IOException {
}

public static void writeFileAtomically(Path target, byte[] bytes) throws IOException {
Path tmp = target.resolveSibling(target.getFileName() + ".wr-tmp");
Path tmp = target.resolveSibling(target.getFileName() + ".rewild-tmp");
try (FileChannel ch = FileChannel.open(tmp, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.WRITE)) {
ByteBuffer buf = ByteBuffer.wrap(bytes);
while (buf.hasRemaining()) ch.write(buf);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/extantape/rewild/run/Applier.java
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ private void backup(Map<Path, List<Run.Entry>> files, Path serverRoot, Path tras

static void copyDurably(Path from, Path to) throws IOException {
Files.createDirectories(to.getParent());
Path tmp = to.resolveSibling(to.getFileName() + ".wr-tmp");
Path tmp = to.resolveSibling(to.getFileName() + ".rewild-tmp");
Files.copy(from, tmp, StandardCopyOption.REPLACE_EXISTING);
try (var ch = java.nio.channels.FileChannel.open(tmp, java.nio.file.StandardOpenOption.WRITE)) {
ch.force(true);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/extantape/rewild/store/WorldStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public synchronized void compact() throws IOException {
flush();
long next = generation + 1;
Path snapshot = dir.resolve("chunks." + next + ".bin");
Path tmp = dir.resolve("chunks." + next + ".bin.wr-tmp");
Path tmp = dir.resolve("chunks." + next + ".bin.rewild-tmp");
try (FileChannel ch = FileChannel.open(tmp, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.WRITE);
DataOutputStream out = new DataOutputStream(new BufferedOutputStream(java.nio.channels.Channels.newOutputStream(ch), 1 << 16))) {
out.writeInt(MAGIC);
Expand Down
63 changes: 0 additions & 63 deletions src/test/java/com/extantape/rewild/MigrationTest.java

This file was deleted.

2 changes: 1 addition & 1 deletion src/test/java/com/extantape/rewild/region/RegionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void chunksSurviveWriteAndRemoveLeavesNeighbours() throws Exception {
assertEquals(1, again.count());
assertNull(again.get(0));
assertArrayEquals(before, again.get(RegionFile.index(1, 0)).data());
assertFalse(Files.exists(p.resolveSibling("r.0.0.mca.wr-tmp")));
assertFalse(Files.exists(p.resolveSibling("r.0.0.mca.rewild-tmp")));
}

@Test
Expand Down
13 changes: 0 additions & 13 deletions test/acceptance.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -526,19 +526,6 @@ const pWhy = await ps.cmd(`rewild why world ${px >> 4} ${pz >> 4}`, /Chunk -?\d+
check('fresh install on a played world: the mined chunk is unknown', /unknown/.test(pWhy))
await ps.stop()

console.log('\n## Upgrade from WildernessRegen')
{
const { renameSync, readdirSync } = await import('node:fs')
const now = path.join(played, 'plugins/Rewild'), old = path.join(played, 'plugins/WildernessRegen')
const before = readdirSync(now).sort().join(',')
renameSync(now, old)
await ps.start()
check('plugins/WildernessRegen is moved to plugins/Rewild on first start', existsSync(path.join(now, 'config.yml')) && !existsSync(old) && readdirSync(now).sort().join(',') === before, readdirSync(now).sort().join(','))
check('the log says what was moved', /Moved plugins\/WildernessRegen to plugins\/Rewild/.test(ps.log))
const oldWhy = await ps.cmd(`wr why world ${px >> 4} ${pz >> 4}`, /Unknown or incomplete command|Chunk -?\d+/)
check('the old command /wr is gone in 0.3.0, as announced', !/Chunk -?\d+/.test(oldWhy), oldWhy.split('\n').slice(-2).join(' ').slice(0, 160))
await ps.stop()
}
ps.remove()

process.exitCode = report(path.join(REPO, `build/acceptance-${VERSION}.json`)) ? 1 : 0
Loading