mirror of
https://github.com/RonanPlugins/BetterRTP.git
synced 2026-11-28 08:44:07 +00:00
Compare commits
21
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3c94704a03 | ||
|
|
ba918fa100 | ||
|
|
76fc1ffe9b | ||
|
|
04309fba14 | ||
|
|
97ee43e434 | ||
|
|
6992e3a41a | ||
|
|
b69d4aa787 | ||
|
|
c7a1a4e069 | ||
|
|
1d4389188f | ||
|
|
ab9911605c | ||
|
|
6eca1c5c73 | ||
|
|
621f3a6876 | ||
|
|
bd45e4cb87 | ||
|
|
b878c992f9 | ||
|
|
aeeffc9e1b | ||
|
|
09ce7e79d2 | ||
|
|
e017aa83c6 | ||
|
|
ff79654444 | ||
|
|
c2a45e8b7b | ||
|
|
9f0801fda4 | ||
|
|
66fe5b9001 |
No files matched your search
@@ -7,12 +7,12 @@
|
|||||||
<groupId>me.SuperRonanCraft</groupId>
|
<groupId>me.SuperRonanCraft</groupId>
|
||||||
<artifactId>BetterRTP</artifactId>
|
<artifactId>BetterRTP</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<version>3.6.16</version>
|
<version>3.6.15</version>
|
||||||
|
|
||||||
<!-- Upload patches to https://repo.ronanplugins.com/#/ -->
|
<!-- Upload patches to https://repo.ronanplugins.com/#/ -->
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<bettersync.version>2.0.1</bettersync.version>
|
<bettersync.version>2.0.0</bettersync.version>
|
||||||
<maven.compiler.release>8</maven.compiler.release>
|
<maven.compiler.release>8</maven.compiler.release>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<editor.website>https://www.minecentral.net</editor.website>
|
<editor.website>https://www.minecentral.net</editor.website>
|
||||||
|
|||||||
+32
-32
@@ -11,6 +11,7 @@ import org.jetbrains.annotations.Nullable;
|
|||||||
|
|
||||||
import com.tcoded.folialib.wrapper.task.WrappedTask;
|
import com.tcoded.folialib.wrapper.task.WrappedTask;
|
||||||
|
|
||||||
|
import io.papermc.lib.PaperLib;
|
||||||
import me.SuperRonanCraft.BetterRTP.BetterRTP;
|
import me.SuperRonanCraft.BetterRTP.BetterRTP;
|
||||||
import me.SuperRonanCraft.BetterRTP.player.commands.RTP_SETUP_TYPE;
|
import me.SuperRonanCraft.BetterRTP.player.commands.RTP_SETUP_TYPE;
|
||||||
import me.SuperRonanCraft.BetterRTP.player.rtp.RTP;
|
import me.SuperRonanCraft.BetterRTP.player.rtp.RTP;
|
||||||
@@ -155,38 +156,37 @@ public class QueueGenerator {
|
|||||||
private void addQueue(RTPWorld rtpWorld, String id, ReQueueData reQueueData) {
|
private void addQueue(RTPWorld rtpWorld, String id, ReQueueData reQueueData) {
|
||||||
Location loc = RandomLocation.generateLocation(rtpWorld);
|
Location loc = RandomLocation.generateLocation(rtpWorld);
|
||||||
if (loc != null) {
|
if (loc != null) {
|
||||||
AsyncHandler.atLoadedChunk(loc, () -> {
|
AsyncHandler.sync(() -> {
|
||||||
Location safeLoc = RandomLocation.getSafeLocation(
|
//BetterRTP.debug("Queued up a new position, attempts " + reQueueData.attempts);
|
||||||
HelperRTP.getWorldType(rtpWorld.getWorld()),
|
PaperLib.getChunkAtAsync(loc)
|
||||||
loc.getWorld(),
|
.thenAccept(v -> {
|
||||||
loc,
|
Location safeLoc = RandomLocation.getSafeLocation(
|
||||||
rtpWorld.getMinY(),
|
HelperRTP.getWorldType(rtpWorld.getWorld()),
|
||||||
rtpWorld.getMaxY(),
|
loc.getWorld(),
|
||||||
rtpWorld.getBiomes());
|
loc,
|
||||||
//data.setLocation(safeLoc);
|
rtpWorld.getMinY(),
|
||||||
if (safeLoc != null) {
|
rtpWorld.getMaxY(),
|
||||||
AsyncHandler.async(() -> {
|
rtpWorld.getBiomes());
|
||||||
QueueData data = DatabaseHandler.getQueue().addQueue(safeLoc);
|
//data.setLocation(safeLoc);
|
||||||
if (data != null) {
|
if (safeLoc != null) {
|
||||||
//queueList.add(data);
|
AsyncHandler.async(() -> {
|
||||||
String _x = String.valueOf(data.getLocation().getBlockX());
|
QueueData data = DatabaseHandler.getQueue().addQueue(safeLoc);
|
||||||
String _y = String.valueOf(data.getLocation().getBlockY());
|
if (data != null) {
|
||||||
String _z = String.valueOf(data.getLocation().getBlockZ());
|
//queueList.add(data);
|
||||||
String _world = data.getLocation().getWorld().getName();
|
String _x = String.valueOf(data.getLocation().getBlockX());
|
||||||
BetterRTP.debug("Queue position generated"
|
String _y = String.valueOf(data.getLocation().getBlockY());
|
||||||
+ ": id= " + id + ", database_ID= " + data.database_id
|
String _z = String.valueOf(data.getLocation().getBlockZ());
|
||||||
+ ", location= x: " + _x + ", y: " + _y + ", z: " + _z + ", world: " + _world);
|
String _world = data.getLocation().getWorld().getName();
|
||||||
} else
|
BetterRTP.debug("Queue position generated"
|
||||||
BetterRTP.debug("Database error occurred for a queue when trying to save: " + safeLoc);
|
+ ": id= " + id + ", database_ID= " + data.database_id
|
||||||
queueGenerator(reQueueData);
|
+ ", location= x: " + _x + ", y: " + _y + ", z: " + _z + ", world: " + _world);
|
||||||
});
|
} else
|
||||||
} else
|
BetterRTP.debug("Database error occurred for a queue when trying to save: " + safeLoc);
|
||||||
queueGenerator(reQueueData);
|
queueGenerator(reQueueData);
|
||||||
}).exceptionally(error -> {
|
});
|
||||||
BetterRTP.getInstance().getLogger().log(java.util.logging.Level.WARNING,
|
} else
|
||||||
"Failed to generate queue position for " + id + " at " + loc, error);
|
queueGenerator(reQueueData);
|
||||||
queueGenerator(reQueueData);
|
});
|
||||||
return null;
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
BetterRTP.debug("Queue position wasn't able to generate a location!");
|
BetterRTP.debug("Queue position wasn't able to generate a location!");
|
||||||
|
|||||||
@@ -4,12 +4,6 @@ import com.tcoded.folialib.impl.ServerImplementation;
|
|||||||
import com.tcoded.folialib.wrapper.task.WrappedTask;
|
import com.tcoded.folialib.wrapper.task.WrappedTask;
|
||||||
import me.SuperRonanCraft.BetterRTP.BetterRTP;
|
import me.SuperRonanCraft.BetterRTP.BetterRTP;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.Chunk;
|
|
||||||
import io.papermc.lib.PaperLib;
|
|
||||||
import java.util.concurrent.CompletableFuture;
|
|
||||||
import java.util.function.Consumer;
|
|
||||||
import java.util.function.Supplier;
|
|
||||||
|
|
||||||
public class AsyncHandler {
|
public class AsyncHandler {
|
||||||
|
|
||||||
@@ -21,47 +15,6 @@ public class AsyncHandler {
|
|||||||
getFolia().runNextTick(task -> runnable.run());
|
getFolia().runNextTick(task -> runnable.run());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void syncAtLocation(Location location, Runnable runnable) {
|
|
||||||
getFolia().runAtLocation(location, task -> runnable.run());
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Load and inspect a chunk on its owning region, including PaperLib's sync fallback. */
|
|
||||||
public static CompletableFuture<Void> atLoadedChunk(Location location, Runnable action) {
|
|
||||||
return atLoadedChunk(task -> syncAtLocation(location, task),
|
|
||||||
() -> PaperLib.getChunkAtAsync(location), action);
|
|
||||||
}
|
|
||||||
|
|
||||||
static CompletableFuture<Void> atLoadedChunk(Consumer<Runnable> scheduler,
|
|
||||||
Supplier<CompletableFuture<Chunk>> loader, Runnable action) {
|
|
||||||
CompletableFuture<Void> result = new CompletableFuture<>();
|
|
||||||
schedule(scheduler, () -> loader.get().whenComplete((chunk, error) -> {
|
|
||||||
if (error != null) {
|
|
||||||
result.completeExceptionally(error);
|
|
||||||
} else {
|
|
||||||
// Future completion alone does not guarantee ownership of the destination region.
|
|
||||||
schedule(scheduler, () -> {
|
|
||||||
action.run();
|
|
||||||
result.complete(null);
|
|
||||||
}, result);
|
|
||||||
}
|
|
||||||
}), result);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void schedule(Consumer<Runnable> scheduler, Runnable action, CompletableFuture<Void> result) {
|
|
||||||
try {
|
|
||||||
scheduler.accept(() -> {
|
|
||||||
try {
|
|
||||||
action.run();
|
|
||||||
} catch (Throwable error) {
|
|
||||||
result.completeExceptionally(error);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} catch (Throwable error) {
|
|
||||||
result.completeExceptionally(error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void syncAtEntity(Entity entity, Runnable runnable) {
|
public static void syncAtEntity(Entity entity, Runnable runnable) {
|
||||||
getFolia().runAtEntity(entity, task -> runnable.run());
|
getFolia().runAtEntity(entity, task -> runnable.run());
|
||||||
}
|
}
|
||||||
|
|||||||
-81
@@ -1,81 +0,0 @@
|
|||||||
package me.SuperRonanCraft.BetterRTP.versions;
|
|
||||||
|
|
||||||
import org.bukkit.Chunk;
|
|
||||||
import org.junit.Test;
|
|
||||||
import java.util.ArrayDeque;
|
|
||||||
import java.util.Queue;
|
|
||||||
import java.util.concurrent.CompletableFuture;
|
|
||||||
import java.util.concurrent.CompletionException;
|
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
public class AsyncHandlerTest {
|
|
||||||
@Test public void synchronousFallbackLoadsOnlyOnRegionAndReschedulesInspection() {
|
|
||||||
Queue<Runnable> region = new ArrayDeque<>();
|
|
||||||
AtomicBoolean loaded = new AtomicBoolean();
|
|
||||||
AtomicBoolean checked = new AtomicBoolean();
|
|
||||||
CompletableFuture<Void> result = AsyncHandler.atLoadedChunk(region::add, () -> {
|
|
||||||
loaded.set(true);
|
|
||||||
return CompletableFuture.completedFuture(null);
|
|
||||||
}, () -> checked.set(true));
|
|
||||||
assertFalse(loaded.get());
|
|
||||||
region.remove().run();
|
|
||||||
assertTrue(loaded.get());
|
|
||||||
assertFalse(checked.get());
|
|
||||||
assertFalse(result.isDone());
|
|
||||||
region.remove().run();
|
|
||||||
assertTrue(checked.get());
|
|
||||||
result.join();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test public void asynchronousCompletionDoesNotInspectBlocksOnCompletingThread() {
|
|
||||||
Queue<Runnable> region = new ArrayDeque<>();
|
|
||||||
CompletableFuture<Chunk> chunk = new CompletableFuture<>();
|
|
||||||
AtomicBoolean checked = new AtomicBoolean();
|
|
||||||
CompletableFuture<Void> result = AsyncHandler.atLoadedChunk(region::add, () -> chunk,
|
|
||||||
() -> checked.set(true));
|
|
||||||
region.remove().run();
|
|
||||||
assertTrue(region.isEmpty());
|
|
||||||
chunk.complete(null);
|
|
||||||
assertFalse(checked.get());
|
|
||||||
region.remove().run();
|
|
||||||
assertTrue(checked.get());
|
|
||||||
result.join();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test public void synchronousLoadFailureIsReported() {
|
|
||||||
RuntimeException failure = new RuntimeException("load failed");
|
|
||||||
assertFailure(failure, AsyncHandler.atLoadedChunk(Runnable::run, () -> { throw failure; },
|
|
||||||
() -> fail("Must not inspect failed chunk")));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test public void asynchronousLoadFailureIsReported() {
|
|
||||||
RuntimeException failure = new RuntimeException("load failed");
|
|
||||||
CompletableFuture<Chunk> chunk = new CompletableFuture<>();
|
|
||||||
CompletableFuture<Void> result = AsyncHandler.atLoadedChunk(Runnable::run, () -> chunk,
|
|
||||||
() -> fail("Must not inspect failed chunk"));
|
|
||||||
chunk.completeExceptionally(failure);
|
|
||||||
assertFailure(failure, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test public void inspectionFailureIsReported() {
|
|
||||||
RuntimeException failure = new RuntimeException("inspection failed");
|
|
||||||
assertFailure(failure, AsyncHandler.atLoadedChunk(Runnable::run,
|
|
||||||
() -> CompletableFuture.completedFuture(null), () -> { throw failure; }));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test public void schedulingFailureIsReported() {
|
|
||||||
RuntimeException failure = new RuntimeException("scheduling failed");
|
|
||||||
assertFailure(failure, AsyncHandler.atLoadedChunk(task -> { throw failure; },
|
|
||||||
() -> { fail("Must not load without region ownership"); return null; }, () -> {}));
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void assertFailure(Throwable expected, CompletableFuture<Void> result) {
|
|
||||||
try {
|
|
||||||
result.join();
|
|
||||||
fail("Expected failure");
|
|
||||||
} catch (CompletionException failure) {
|
|
||||||
assertSame(expected, failure.getCause());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -7,7 +7,7 @@ But this can be compiled free of charge if you know how to compile maven resourc
|
|||||||
|
|
||||||
## Web configuration editor
|
## Web configuration editor
|
||||||
|
|
||||||
[Open the BetterRTP Addons editor](https://www.minecentral.net/plugins/betterrtp-addons/editor) to start with defaults or upload config.yml. Edit addon toggles, menus, command lists, and flashback warnings. Install the matching updated BetterRTP JAR too: Addons shares its editor bridge.
|
[Open the BetterRTP Addons editor](https://www.minecentral.net/editor/betterrtp-addons) to start with defaults or upload config.yml. Edit addon toggles, menus, command lists, and flashback warnings. Install the matching updated BetterRTP JAR too: Addons shares its editor bridge.
|
||||||
|
|
||||||
1. Run `/rtp addons editor` on your server and open the private link it returns.
|
1. Run `/rtp addons editor` on your server and open the private link it returns.
|
||||||
2. Edit the form or YAML and choose **Save and get sync command**.
|
2. Edit the form or YAML and choose **Save and get sync command**.
|
||||||
|
|||||||
@@ -7,11 +7,11 @@
|
|||||||
<groupId>me.SuperRonanCraft</groupId>
|
<groupId>me.SuperRonanCraft</groupId>
|
||||||
<artifactId>BetterRTPAddons</artifactId>
|
<artifactId>BetterRTPAddons</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<version>1.8.12</version>
|
<version>1.8.10</version>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<editor.website>https://www.minecentral.net</editor.website>
|
<editor.website>https://www.minecentral.net</editor.website>
|
||||||
<bettersync.version>2.0.1</bettersync.version>
|
<bettersync.version>2.0.0</bettersync.version>
|
||||||
<maven.compiler.source>1.8</maven.compiler.source>
|
<maven.compiler.source>1.8</maven.compiler.source>
|
||||||
<maven.compiler.target>1.8</maven.compiler.target>
|
<maven.compiler.target>1.8</maven.compiler.target>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
@@ -169,7 +169,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>me.SuperRonanCraft</groupId>
|
<groupId>me.SuperRonanCraft</groupId>
|
||||||
<artifactId>BetterRTP</artifactId>
|
<artifactId>BetterRTP</artifactId>
|
||||||
<version>3.6.16</version>
|
<version>3.6.15</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- ProtocolLib -->
|
<!-- ProtocolLib -->
|
||||||
|
|||||||
+3
-11
@@ -35,17 +35,9 @@ public class AddonsHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void unload() {
|
public void unload() {
|
||||||
try {
|
for (Addons addon : addons)
|
||||||
for (Addons addon : addons)
|
addon.disable();
|
||||||
addon.disable();
|
addons.clear();
|
||||||
} finally {
|
|
||||||
addons.clear();
|
|
||||||
// Core retains these command objects after this plugin's classloader closes.
|
|
||||||
BetterRTP core = BetterRTP.getInstance();
|
|
||||||
if (core != null && core.getCmd() != null)
|
|
||||||
core.getCmd().commands.removeIf(command ->
|
|
||||||
command.getClass().getClassLoader() == getClass().getClassLoader());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum Addons {
|
public enum Addons {
|
||||||
|
|||||||
@@ -41,11 +41,8 @@ public class Main extends JavaPlugin {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
try {
|
if (editorBridge != null) editorBridge.close();
|
||||||
if (editorBridge != null) editorBridge.close();
|
addonsHandler.unload();
|
||||||
} finally {
|
|
||||||
addonsHandler.unload();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void load() {
|
public void load() {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
## Web configuration editor
|
## Web configuration editor
|
||||||
|
|
||||||
[Open the BetterRTP editor](https://www.minecentral.net/plugins/betterrtp/editor) to start with defaults or upload config.yml. Edit world settings, teleport ranges, cooldowns, and supported lists.
|
[Open the BetterRTP editor](https://www.minecentral.net/editor/betterrtp) to start with defaults or upload config.yml. Edit world settings, teleport ranges, cooldowns, and supported lists.
|
||||||
|
|
||||||
1. Run `/rtp editor` on your server and open the private link it returns.
|
1. Run `/rtp editor` on your server and open the private link it returns.
|
||||||
2. Edit the form or YAML and choose **Save and get sync command**.
|
2. Edit the form or YAML and choose **Save and get sync command**.
|
||||||
@@ -37,8 +37,8 @@ BetterRTP uses and is compiled with the following libraries:
|
|||||||
|
|
||||||
From this directory, run `mvn clean package` to build BetterRTP followed by BetterRTP Addons. Maven resolves Addons against the BetterRTP built in the same run; a separate `install` step is unnecessary.
|
From this directory, run `mvn clean package` to build BetterRTP followed by BetterRTP Addons. Maven resolves Addons against the BetterRTP built in the same run; a separate `install` step is unnecessary.
|
||||||
|
|
||||||
- BetterRTP JAR: `dist/BetterRTP-3.6.16.jar`
|
- BetterRTP JAR: `dist/BetterRTP-3.6.15.jar`
|
||||||
- Addons JAR: `dist/BetterRTPAddons-1.8.12.jar`
|
- Addons JAR: `dist/BetterRTPAddons-1.8.10.jar`
|
||||||
|
|
||||||
Both server-ready JARs are collected in `dist/`. `mvn clean` removes each selected plugin’s previous JARs from this folder; intermediate build files stay in `target/`. The `dev` profile still outputs directly to its configured server plugins folder.
|
Both server-ready JARs are collected in `dist/`. `mvn clean` removes each selected plugin’s previous JARs from this folder; intermediate build files stay in `target/`. The `dev` profile still outputs directly to its configured server plugins folder.
|
||||||
|
|
||||||
@@ -62,8 +62,8 @@ The wiki is available [here](../../wiki)!
|
|||||||
## Shared editor library
|
## Shared editor library
|
||||||
|
|
||||||
The web editor uses [BetterSync](https://github.com/RonanPlugins/BetterSync),
|
The web editor uses [BetterSync](https://github.com/RonanPlugins/BetterSync),
|
||||||
downloaded by Maven from JitPack as `com.github.RonanPlugins:BetterSync:2.0.1`.
|
downloaded by Maven from JitPack as `com.github.RonanPlugins:BetterSync:2.0.0`.
|
||||||
No local BetterSync project or manual Maven install is required. Release `2.0.1` is published on JitPack. Update `bettersync.version` in the plugin and editor-test
|
No local BetterSync project or manual Maven install is required. Release `2.0.0` is published on JitPack. Update `bettersync.version` in the plugin and editor-test
|
||||||
POMs together when upgrading. Shade bundles and relocates the library into the
|
POMs together when upgrading. Shade bundles and relocates the library into the
|
||||||
plugin JAR; server owners do not install a separate BetterSync plugin.
|
plugin JAR; server owners do not install a separate BetterSync plugin.
|
||||||
|
|
||||||
@@ -98,7 +98,7 @@ Use the website's schema-version database migrations before deploying these clie
|
|||||||
`.github/workflows/release.yml` runs on pushes to `master` (or manually from
|
`.github/workflows/release.yml` runs on pushes to `master` (or manually from
|
||||||
that branch). It reads only the Core POM version, builds and verifies BetterRTP Core,
|
that branch). It reads only the Core POM version, builds and verifies BetterRTP Core,
|
||||||
runs the editor tests, and publishes a stable GitHub release with exactly one plugin
|
runs the editor tests, and publishes a stable GitHub release with exactly one plugin
|
||||||
JAR. For the current Core POM the title is `BetterRTP 3.6.16` and the tag is `v3.6.16`.
|
JAR. For the current Core POM the title is `BetterRTP 3.6.15` and the tag is `v3.6.15`.
|
||||||
This single-JAR release is compatible with the website's GitHub release importer.
|
This single-JAR release is compatible with the website's GitHub release importer.
|
||||||
|
|
||||||
Both Core and Addons editor-schema JSON files remain attached for the website editor.
|
Both Core and Addons editor-schema JSON files remain attached for the website editor.
|
||||||
|
|||||||
@@ -1,266 +0,0 @@
|
|||||||
# BetterRTP multi-version compatibility execution plan
|
|
||||||
|
|
||||||
Status: proposed implementation plan; no platform migration has been performed.
|
|
||||||
Research date: 2026-11-19.
|
|
||||||
|
|
||||||
## Objective and constraints
|
|
||||||
|
|
||||||
Maintain one codebase with explicitly tested Bukkit/CraftBukkit, Spigot, Paper, and
|
|
||||||
Folia distributions. Target Minecraft 1.8.8 through the latest verified stable
|
|
||||||
release, limited to versions on which each platform actually exists. Future
|
|
||||||
releases become supported only after validation. A successful compile is not a
|
|
||||||
runtime compatibility guarantee.
|
|
||||||
|
|
||||||
Prefer public APIs and maintained upstream libraries. Shading and relocation are
|
|
||||||
allowed; maintaining our own forks is not the default. Keep BetterRTP free of
|
|
||||||
NMS/CraftBukkit internals and bytecode rewriting. Avoid scattered reflection and
|
|
||||||
version-string routing: any necessary capability detection belongs in a small,
|
|
||||||
tested compatibility boundary or an audited upstream library.
|
|
||||||
Retain Maven and existing configuration, database, commands, permissions, and
|
|
||||||
public events unless a separately documented migration is necessary.
|
|
||||||
|
|
||||||
Prefer a single user-facing JAR when isolated adapters and upstream libraries
|
|
||||||
can safely cover the supported runtimes. Use separate builds only when verified
|
|
||||||
API, bytecode, or dependency constraints justify them. Do not create a fork or permanent branch per Minecraft version.
|
|
||||||
Do not automatically create a module for every patch release.
|
|
||||||
|
|
||||||
## Patterns adopted from existing projects
|
|
||||||
|
|
||||||
| Reference | Observed structure | Pattern to adopt |
|
|
||||||
| --- | --- | --- |
|
|
||||||
| EssentialsX | BaseProviders, PaperProvider, legacy providers, and an NMSReflectionProvider | Small capability interfaces with isolated implementations; do not copy its NMS approach |
|
|
||||||
| LuckPerms | common, api, bukkit, bukkit-legacy, and platform loaders | Shared behavior and thin platform entry points; one repository and coordinated releases |
|
|
||||||
| TAB | shared, platform modules, API-specific submodules, jar assembly, and a compatibility/backport policy | Add build boundaries at demonstrated API changes and publish explicit compatibility ranges |
|
|
||||||
| SkinsRestorer | shared, multiver, platform modules, test, and universal assembly | Isolate version-sensitive implementation and integration code; centralize packaging and testing |
|
|
||||||
|
|
||||||
Borrow verified patterns, not entire implementations or their complexity. Their
|
|
||||||
use of internal APIs does not establish that BetterRTP needs internal APIs. Their development branches can differ from released artifacts.
|
|
||||||
Pin reviewed commits when using their implementation details during execution.
|
|
||||||
Do not copy their code without reviewing applicable licenses.
|
|
||||||
|
|
||||||
Sources reviewed:
|
|
||||||
- https://github.com/EssentialsX/Essentials/blob/2.x/settings.gradle.kts
|
|
||||||
- https://github.com/LuckPerms/LuckPerms/blob/master/settings.gradle
|
|
||||||
- https://github.com/NEZNAMY/TAB/blob/master/settings.gradle.kts
|
|
||||||
- https://github.com/NEZNAMY/TAB/wiki/Compatibility
|
|
||||||
- https://github.com/SkinsRestorer/SkinsRestorer/blob/dev/settings.gradle.kts
|
|
||||||
|
|
||||||
## Current baseline and known gaps
|
|
||||||
|
|
||||||
- Core compiles against Spigot 1.8.8 with a Java 8 release target.
|
|
||||||
- Core shades PaperLib, FoliaLib, BetterSync, and potentially other compile dependencies.
|
|
||||||
- QueueGenerator now schedules chunk loading and safety inspection at the destination.
|
|
||||||
This change is still uncommitted and must be preserved during implementation.
|
|
||||||
- RTPPlayer still routes chunk loading and player operations through global sync tasks.
|
|
||||||
- RTPTeleport still uses PaperLib teleportation. RandomLocation contains a PaperLib
|
|
||||||
chunk diagnostic. Commented-out calls must be distinguished from executable code.
|
|
||||||
- Effects, third-party hooks, database driver provisioning, and bundled dependencies
|
|
||||||
need inspection beyond the queue fix.
|
|
||||||
- Reflection exists in optional claim integrations, metrics, packet helpers, and
|
|
||||||
JDBC driver loading. Classify these uses; driver loading is not server API probing.
|
|
||||||
- Existing unit tests are useful, but no full real-server compatibility matrix is established.
|
|
||||||
|
|
||||||
## Proposed module boundaries
|
|
||||||
|
|
||||||
Keep BetterRTP-Core initially; extract modules incrementally instead of moving
|
|
||||||
all source files in one change.
|
|
||||||
|
|
||||||
- betterrtp-api: stable public events and integration contracts; preserve existing
|
|
||||||
package names and verify BetterRTPAddons consumers.
|
|
||||||
- betterrtp-core: request lifecycle, configuration, queue policy, location selection,
|
|
||||||
and orchestration. Initially allow the oldest supported Bukkit API as a baseline;
|
|
||||||
do not require a costly rewrite into a completely server-independent model.
|
|
||||||
- betterrtp-platform-api: scheduling, chunk readiness, teleportation, world-height,
|
|
||||||
and effect capabilities expressed without modern platform types.
|
|
||||||
- betterrtp-platform-bukkit: legacy public Bukkit implementation, Java 8 compatible.
|
|
||||||
- betterrtp-platform-paper-<baseline>: native asynchronous APIs compiled against
|
|
||||||
the earliest verified API in that compatible range.
|
|
||||||
- betterrtp-platform-folia-<baseline>: public region/entity scheduler implementation.
|
|
||||||
- betterrtp-integrations: separate optional hook modules where dependency versions
|
|
||||||
require isolation; classes must not load before their dependency is available.
|
|
||||||
- betterrtp-distributions: explicit bootstrap and plugin descriptors per build family.
|
|
||||||
- tests/compatibility: server harness, fixtures, test companion, and result collection.
|
|
||||||
|
|
||||||
Modern adapters can use newer toolchains while the shared/legacy modules retain
|
|
||||||
Java 8 bytecode and API compatibility. A legacy runtime must never load incompatible
|
|
||||||
classes or resolve unavailable APIs. If a universal artifact includes isolated modern
|
|
||||||
classes, prove safe class loading on the oldest runtime and verify server tooling
|
|
||||||
does not eagerly scan them. Otherwise split artifacts. Confirm real API boundaries
|
|
||||||
before assigning exact adapter ranges. The module list is conceptual: create only
|
|
||||||
the boundaries the implementation actually needs.
|
|
||||||
|
|
||||||
Keep implementation selection centralized and tested. Package first-party modules
|
|
||||||
and approved dependencies with Maven Shade as appropriate. Relocate private library
|
|
||||||
packages to avoid plugin conflicts; do not relocate public integration APIs or bundle
|
|
||||||
server APIs. Preserve licenses and required service descriptors. Avoid aggressive
|
|
||||||
JAR minimization unless runtime-loaded classes are covered by tests. Publish one JAR
|
|
||||||
if validated; otherwise use build-specific metadata and descriptive filenames such
|
|
||||||
as BetterRTP-<release>-<platform>-<verified-range>.jar.
|
|
||||||
|
|
||||||
## Execution work packages
|
|
||||||
|
|
||||||
### 1. Inventory and support manifest
|
|
||||||
|
|
||||||
Deliver a dependency inventory and a machine-readable support manifest containing:
|
|
||||||
platform, exact Minecraft version, server build identity/checksum, Java runtime,
|
|
||||||
adapter, artifact, integration set, and validation status.
|
|
||||||
|
|
||||||
Audit all scheduled tasks, future callbacks, world/player access, public events,
|
|
||||||
plugin lifecycle callbacks, effects, and addon API dependencies. Determine API
|
|
||||||
and runtime boundaries from actual dependency signatures and executable probes.
|
|
||||||
|
|
||||||
Inventory PaperLib, FoliaLib, BetterSync, particle libraries, ProtocolLib usage,
|
|
||||||
JDBC, metrics, and every optional hook. For each record whether it is provided,
|
|
||||||
bundled, replaceable with a public API, or requires a declared external plugin.
|
|
||||||
Keeping BetterSync shaded is allowed; verify its API and runtime compatibility.
|
|
||||||
Do not introduce an external plugin dependency merely to avoid shading.
|
|
||||||
For each retained library record upstream activity, supported runtimes, transitive
|
|
||||||
dependencies, required relocations, and upgrade tests. Prefer an upstream fix or a
|
|
||||||
maintained replacement over a private fork. Any unavoidable temporary fork needs
|
|
||||||
a pinned patch, owner, upstream issue, and explicit removal criteria.
|
|
||||||
If a feature needs an external dependency or a capability downgrade, document the
|
|
||||||
specific user-visible consequence before implementing that change.
|
|
||||||
|
|
||||||
Acceptance: every runtime dependency and compatibility-sensitive operation has
|
|
||||||
an owner; the initial matrix distinguishes planned, tested, and unsupported rows.
|
|
||||||
|
|
||||||
### 2. Establish reproducible real-server tests before refactoring
|
|
||||||
|
|
||||||
Create an isolated harness with temporary server directories, localhost-only
|
|
||||||
ports, pinned Java executables, pinned server builds, timeouts, graceful stop,
|
|
||||||
and archived logs/results. Obtain binaries through official downloads or official
|
|
||||||
build tooling as applicable. Handle required EULA acceptance explicitly; do not
|
|
||||||
silently accept terms or redistribute restricted server binaries.
|
|
||||||
|
|
||||||
Initial targets: Spigot 1.8.8, current stable Paper, and current stable Folia.
|
|
||||||
Add CraftBukkit and historical boundaries as the harness becomes reliable.
|
|
||||||
Use a small test companion plugin for server-side assertions and compatible test
|
|
||||||
clients for player flows. Do not assume one bot library supports the whole range.
|
|
||||||
Keep test-client tooling isolated from the production plugin.
|
|
||||||
|
|
||||||
Acceptance: startup and empty-queue scenarios run unattended; tests detect failed
|
|
||||||
queue generation and plugin enablement errors. A known broken build demonstrates
|
|
||||||
that the harness fails correctly. Player test tooling can execute and observe /rtp.
|
|
||||||
Record existing failures rather than declaring the baseline supported.
|
|
||||||
|
|
||||||
### 3. Introduce contracts around validated upstream implementations
|
|
||||||
|
|
||||||
Define explicit operations for global work, location-owned work, player-owned
|
|
||||||
work, background I/O, delayed tasks, cancellation, chunk readiness, and teleportation.
|
|
||||||
Specify callback ownership and completion semantics. A completed future alone
|
|
||||||
must never imply ownership of a region or player.
|
|
||||||
|
|
||||||
First evaluate the supported FoliaLib release against our real-server matrix.
|
|
||||||
Retain it behind our contracts if it correctly supplies scheduling and teleportation;
|
|
||||||
do not rewrite it solely to own the implementation. Provide native public API
|
|
||||||
adapters only for demonstrated gaps. Bukkit fallback operations use main-thread
|
|
||||||
scheduling and public synchronous chunk/teleport APIs. Define retired-player behavior and rejected scheduling so
|
|
||||||
requests complete or cancel instead of hanging. Use injectable interfaces in unit
|
|
||||||
tests; avoid static singleton dependencies in new orchestration code.
|
|
||||||
|
|
||||||
Acceptance: existing tests pass and Spigot 1.8.8 scenarios pass using the adapter.
|
|
||||||
|
|
||||||
### 4. Close adapter gaps and migrate the RTP flow
|
|
||||||
|
|
||||||
Use public async APIs for Paper, directly or through validated libraries.
|
|
||||||
Use location schedulers for Folia world
|
|
||||||
inspection, entity schedulers for player operations, and native async teleportation.
|
|
||||||
Never block a tick thread waiting for a future. Ensure a chunk remains usable
|
|
||||||
through the region-owned inspection; define ticket/lifetime behavior where needed.
|
|
||||||
|
|
||||||
Migrate in this order: QueueGenerator, RTPPlayer search and safety checks,
|
|
||||||
RTPTeleport, countdowns and post-teleport effects, diagnostics, then remaining tasks.
|
|
||||||
Capture required player state on its owner, inspect destinations on their owner,
|
|
||||||
then return to the player owner and revalidate the operation before charging and
|
|
||||||
teleporting. Define failure/refund and cooldown semantics explicitly.
|
|
||||||
|
|
||||||
Audit protection hooks for the thread required by their public APIs. Do not assume
|
|
||||||
that a destination-region callback makes every third-party integration safe.
|
|
||||||
Preserve event cancellation and event order while documenting execution context.
|
|
||||||
Use lifecycle generation tokens/cancellation tracking so reload, quit, disable,
|
|
||||||
and late completions cannot revive an old request or queue generator.
|
|
||||||
|
|
||||||
Acceptance: real RTP, cancellation, cross-region, and cross-world tests pass;
|
|
||||||
all scheduling/loading/teleport calls pass through tested compatibility contracts.
|
|
||||||
Replace PaperLib's broken version-dependent paths without creating a private PaperLib
|
|
||||||
fork by default. FoliaLib may remain as a shaded, pinned upstream dependency.
|
|
||||||
|
|
||||||
### 5. Complete dependency and integration separation
|
|
||||||
|
|
||||||
Remove superseded libraries only after their callers migrate; retain validated
|
|
||||||
upstream libraries and their required relocations. Replace version-sensitive
|
|
||||||
particles/sounds/titles with public API implementations where possible; explicitly
|
|
||||||
report unavailable optional capabilities instead of attempting internal access.
|
|
||||||
Resolve BetterSync delivery and JDBC provisioning from the inventory. Keep external
|
|
||||||
plugin dependencies declared and optional hooks isolated by supported API version.
|
|
||||||
Compile against API artifacts, removing the full Spigot server dependency if unused.
|
|
||||||
|
|
||||||
Acceptance: inspect final JAR contents and dependency trees to verify approved
|
|
||||||
bundling, relocations, service resources, licenses, and runtime compatibility; startup works with optional plugins absent, present, and unsupported.
|
|
||||||
No silent loss of protection/economy behavior is acceptable.
|
|
||||||
|
|
||||||
### 6. Expand the matrix and enforce architectural rules
|
|
||||||
|
|
||||||
Candidate boundary tests: 1.8.8, 1.12.2, 1.13.2, 1.16.5, 1.18.2, 1.19.4,
|
|
||||||
1.20.4, 1.20.6, and supported 1.21.x/26.x releases. These are starting probes,
|
|
||||||
not a claim that all intervening versions work. Folia rows exist only for released
|
|
||||||
Folia versions. Current endpoints and Java requirements must be verified during setup.
|
|
||||||
|
|
||||||
Every change: unit tests, all artifact builds, API/bytecode checks, and a small
|
|
||||||
real-server smoke matrix. Nightly/release: expanded exact-version manifest and
|
|
||||||
integration scenarios. Test each claimed release, or explicitly narrow the claim.
|
|
||||||
|
|
||||||
Enforce forbidden internal API references in BetterRTP, compatibility logic outside
|
|
||||||
its designated boundary, unapproved dependency bundling, missing required
|
|
||||||
relocations, modern API leakage into legacy modules, and unsupported bytecode/API
|
|
||||||
usage. Audit retained libraries for internal access and reflective behavior; document
|
|
||||||
necessary internals rather than assuming a library automatically meets our policy. Existing violations get explicit migration entries;
|
|
||||||
new violations fail immediately. Audit dependencies as well as our own source.
|
|
||||||
|
|
||||||
Acceptance: deliberately introducing a forbidden reference or wrong bytecode target
|
|
||||||
fails CI; each distribution has machine-readable test results.
|
|
||||||
|
|
||||||
### 7. Release and support policy
|
|
||||||
|
|
||||||
One coordinated version and changelog across distributions. Generate a download
|
|
||||||
compatibility table from the manifest, with exact tested versions and required Java.
|
|
||||||
Only tested combinations are supported. Add new stable Minecraft releases through
|
|
||||||
an API audit and matrix run; avoid automatically claiming future compatibility.
|
|
||||||
|
|
||||||
Keep a previous known-good artifact available for each supported family. Preserve
|
|
||||||
config/database compatibility where possible and test upgrade paths with copied
|
|
||||||
fixtures. Publish explicit migration notes if formats or external dependencies change.
|
|
||||||
|
|
||||||
Acceptance: a clean checkout produces all artifacts and reports, and a maintainer
|
|
||||||
can select the correct download without reading code.
|
|
||||||
|
|
||||||
## Required behavioral assertions
|
|
||||||
|
|
||||||
- Fresh startup: plugin enables and queue reaches its configured target in a bounded time.
|
|
||||||
- RTP: real player arrives within configured bounds with safe ground/headroom,
|
|
||||||
matching biome/world constraints; test queued and uncached destinations.
|
|
||||||
- World access: normal/Nether/End, negative coordinates, world-height boundaries,
|
|
||||||
loaded/unloaded/generated/ungenerated chunks, and cross-world teleportation.
|
|
||||||
- Failure: no safe location, cancelled events, chunk/teleport/database failure,
|
|
||||||
denied permission, insufficient funds, and unavailable optional dependencies.
|
|
||||||
- Lifecycle: movement cancellation, quit/rejoin, duplicate commands, config reload,
|
|
||||||
shutdown, and late future completion; no retained request or resurrected work.
|
|
||||||
- Folia: independent distant regions, simultaneous players, and player movement
|
|
||||||
between capture and completion; no wrong-thread access or cross-region deadlock.
|
|
||||||
- Integrations: protected destinations rejected, charges/refunds and cooldowns applied
|
|
||||||
exactly as documented, public events remain usable by BetterRTPAddons.
|
|
||||||
|
|
||||||
Logs are supporting evidence. Assert outcomes and resource cleanup, not merely the
|
|
||||||
absence of exceptions. Deterministic worlds/seeds and bounded retries reduce flakes.
|
|
||||||
Track stress-test performance separately from functional correctness.
|
|
||||||
|
|
||||||
## First implementation slice
|
|
||||||
|
|
||||||
Execute packages 1 and 2 first: inventory + pinned three-server baseline harness.
|
|
||||||
Resolve whether validated upstream libraries enable one artifact before committing
|
|
||||||
to multiple distributions. Then implement the minimal contracts needed for fresh-start queue generation and
|
|
||||||
one /rtp request. Complete that vertical slice on all three initial platforms before
|
|
||||||
moving optional effects and integrations. No broad source reorganization first.
|
|
||||||
|
|
||||||
The exact number of distributions, API boundaries, external dependency delivery,
|
|
||||||
and feasible client tooling remain research outcomes, not assumptions hidden in code.
|
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>me.SuperRonanCraft</groupId>
|
<groupId>me.SuperRonanCraft</groupId>
|
||||||
<artifactId>BetterRTP-build</artifactId>
|
<artifactId>BetterRTP-build</artifactId>
|
||||||
<version>3.6.16</version>
|
<version>3.6.15</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<modules>
|
<modules>
|
||||||
<module>BetterRTP-Core</module>
|
<module>BetterRTP-Core</module>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>me.SuperRonanCraft</groupId><artifactId>betterrtp-editor-tests</artifactId><version>1.0</version>
|
<groupId>me.SuperRonanCraft</groupId><artifactId>betterrtp-editor-tests</artifactId><version>1.0</version>
|
||||||
<properties><bettersync.version>2.0.1</bettersync.version><maven.compiler.release>8</maven.compiler.release><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding></properties>
|
<properties><bettersync.version>2.0.0</bettersync.version><maven.compiler.release>8</maven.compiler.release><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding></properties>
|
||||||
<repositories><repository><id>spigot</id><url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url></repository><repository><id>jitpack.io</id><url>https://jitpack.io</url></repository></repositories>
|
<repositories><repository><id>spigot</id><url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url></repository><repository><id>jitpack.io</id><url>https://jitpack.io</url></repository></repositories>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency><groupId>org.jetbrains</groupId><artifactId>annotations</artifactId><version>24.0.1</version><scope>provided</scope></dependency>
|
<dependency><groupId>org.jetbrains</groupId><artifactId>annotations</artifactId><version>24.0.1</version><scope>provided</scope></dependency>
|
||||||
|
|||||||
Reference in new issue
Block a user