Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0724ba3fa9 | |||
| e6d6562f4f | |||
| 580201740e | |||
| d54b248f27 | |||
| 11b0b05a93 | |||
| 7db058ef56 | |||
| 019adaf46f | |||
| 6f55ed7e8e | |||
| 12c58f69b3 | |||
| 0fd3b32108 | |||
| b8f43b47e6 | |||
| 5f718d45a1 |
@@ -29,6 +29,12 @@
|
||||
- 🔬 **生电功能增强** - 在 Folia 上实现更多生电内容(完整生电请使用 Fabric)
|
||||
- 🛠️ **更多实用功能** - 持续添加有用的服务器功能
|
||||
|
||||
### 额外启动参数
|
||||
|
||||
- morninggloryclip.useMojangSource 强制服务端使用mojang源下载文件
|
||||
- morninggloryclip.enable.mixin 启用服务器插件的mixin支持
|
||||
|
||||
|
||||
## 📥 下载
|
||||
|
||||
### 稳定版本
|
||||
@@ -79,7 +85,7 @@ dependencies {
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fun.bm.lophine</groupId>
|
||||
<artifactId>luminol-api</artifactId>
|
||||
<artifactId>lophine-api</artifactId>
|
||||
<version>$VERSION</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
+6
-1
@@ -29,6 +29,11 @@
|
||||
- 🔬 **Redstone Enhancement** - More redstone functionality on Folia (use Fabric for complete redstone features)
|
||||
- 🛠️ **More Useful Functions** - Continuously adding useful server features
|
||||
|
||||
### Additional Launch Parameters
|
||||
|
||||
- morninggloryclip.useMojangSource - Use Mojang's source for Minecraft Server
|
||||
- morninggloryclip.enable.mixin - Enable mixin support for Leaves Plugin
|
||||
|
||||
## 📥 Download
|
||||
|
||||
### Stable Releases
|
||||
@@ -79,7 +84,7 @@ dependencies {
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>fun.bm.lophine</groupId>
|
||||
<artifactId>luminol-api</artifactId>
|
||||
<artifactId>lophine-api</artifactId>
|
||||
<version>$VERSION</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import groovy.json.JsonSlurper
|
||||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
||||
import org.gradle.api.tasks.testing.logging.TestLogEvent
|
||||
|
||||
@@ -105,3 +106,98 @@ subprojects {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Sort all JSON language files under the lang directory by key in ASCII order
|
||||
val langDir = layout.projectDirectory.dir("lophine-server/src/main/resources/assets/lophine/lang")
|
||||
tasks.register("sortLangKeys") {
|
||||
group = "lophine"
|
||||
description = "Sort all JSON language files by key in ASCII (ordinal) order"
|
||||
notCompatibleWithConfigurationCache("Inline task action references build script class")
|
||||
inputs.dir(langDir).optional()
|
||||
outputs.dir(langDir)
|
||||
doLast {
|
||||
val dir = langDir.asFile
|
||||
if (!dir.isDirectory) {
|
||||
logger.warn("Lang directory not found: $dir")
|
||||
return@doLast
|
||||
}
|
||||
val jsonFiles = dir.listFiles { f -> f.extension == "json" }?.sortedBy { it.name } ?: emptyList()
|
||||
if (jsonFiles.isEmpty()) {
|
||||
logger.lifecycle("No .json files found in: $dir")
|
||||
return@doLast
|
||||
}
|
||||
val slurper = JsonSlurper()
|
||||
for (file in jsonFiles) {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
val data = slurper.parse(file) as Map<String, Any?>
|
||||
val sorted = data.toSortedMap()
|
||||
val pretty = formatJson(sorted)
|
||||
file.writeText(pretty + "\n", charset = Charsets.UTF_8)
|
||||
logger.lifecycle("Processed: ${file.name} (${sorted.size} keys)")
|
||||
}
|
||||
logger.lifecycle("Done.")
|
||||
}
|
||||
}
|
||||
|
||||
// --- Pure-Kotlin JSON serializer that preserves non-ASCII characters (e.g. CJK) ---
|
||||
fun formatJson(value: Any?, indent: Int = 2): String {
|
||||
val sb = StringBuilder()
|
||||
appendJson(sb, value, indent, 0)
|
||||
return sb.toString()
|
||||
}
|
||||
|
||||
private fun appendJson(sb: StringBuilder, value: Any?, indent: Int, level: Int) {
|
||||
when (value) {
|
||||
null -> sb.append("null")
|
||||
is Boolean -> sb.append(value)
|
||||
is Number -> sb.append(value)
|
||||
is String -> sb.append('"').append(escapeJsonString(value)).append('"')
|
||||
is List<*> -> {
|
||||
if (value.isEmpty()) { sb.append("[]"); return }
|
||||
sb.append("[\n")
|
||||
value.forEachIndexed { i, v ->
|
||||
sb.append(" ".repeat(indent * (level + 1)))
|
||||
appendJson(sb, v, indent, level + 1)
|
||||
if (i < value.size - 1) sb.append(',')
|
||||
sb.append('\n')
|
||||
}
|
||||
sb.append(" ".repeat(indent * level)).append(']')
|
||||
}
|
||||
is Map<*, *> -> {
|
||||
if (value.isEmpty()) { sb.append("{}"); return }
|
||||
sb.append("{\n")
|
||||
val entries = value.entries.toList()
|
||||
entries.forEachIndexed { i, (k, v) ->
|
||||
sb.append(" ".repeat(indent * (level + 1)))
|
||||
sb.append('"').append(escapeJsonString(k.toString())).append('"')
|
||||
sb.append(": ")
|
||||
appendJson(sb, v, indent, level + 1)
|
||||
if (i < entries.size - 1) sb.append(',')
|
||||
sb.append('\n')
|
||||
}
|
||||
sb.append(" ".repeat(indent * level)).append('}')
|
||||
}
|
||||
else -> sb.append('"').append(escapeJsonString(value.toString())).append('"')
|
||||
}
|
||||
}
|
||||
|
||||
private fun escapeJsonString(s: String): String {
|
||||
val sb = StringBuilder(s.length)
|
||||
for (c in s) {
|
||||
when (c) {
|
||||
'"' -> sb.append("\\\"")
|
||||
'\\' -> sb.append("\\\\")
|
||||
'\b' -> sb.append("\\b")
|
||||
'\u000C' -> sb.append("\\f")
|
||||
'\n' -> sb.append("\\n")
|
||||
'\r' -> sb.append("\\r")
|
||||
'\t' -> sb.append("\\t")
|
||||
else -> if (c.code < 0x20) {
|
||||
sb.append("\\u").append(String.format("%04x", c.code))
|
||||
} else {
|
||||
sb.append(c) // preserve CJK and all other printable chars as-is
|
||||
}
|
||||
}
|
||||
}
|
||||
return sb.toString()
|
||||
}
|
||||
|
||||
@@ -88,3 +88,13 @@ Lophine 使用和 Folia 一样的补丁系统,并为了针对不同部分的
|
||||
4. 运行 Gradle 任务 `fixupPaperApiFilePatches` 来修改已被修改的在lophine新建文件的补丁(注意不要提交);
|
||||
5. 运行 Gradle 任务 `rebuildAllServerPatches` 来修改已被修改的补丁;
|
||||
6. 将修改后的补丁 PR 发回储存库。
|
||||
|
||||
## 为配置项提供本地化的注释支持
|
||||
|
||||
1. 在 `lophine-server/src/main/resources/assets/lophine/lang` 目录下创建或修改相应的语言文件,添加本地化的注释;
|
||||
- 文件的名字应当符合 `https://minecraft.wiki/w/Language` 页面下的格式,如 `en_us` `zh_cn` `zh_hk` `zh_tw`,文件以 `json` 为格式类型;
|
||||
2. 运行 Gradle 任务 `sortLangKeys` 来对你的语言文件内容进行重排序;
|
||||
3. 使用 `git commit -m <提交信息>` 进行提交;
|
||||
4. 将你修改的文件进行推送。
|
||||
|
||||
这样做以后,你就可以将你的修改进行 PR 提交。
|
||||
|
||||
@@ -91,3 +91,13 @@ You can modify an existing patch by following the steps below:
|
||||
4. Run Gradle's task `fixupPaperApiFilePatches` to regenerate lophine-created files to patches (PS: do not commit again before you run this task)
|
||||
5. Run Gradle's task `rebuildAllServerPatches` to modify existing patches
|
||||
6. Push and PR again
|
||||
|
||||
## Providing localized comment support for configuration entries
|
||||
|
||||
1. Create or modify the corresponding language file under the `lophine-server/src/main/resources/assets/lophine/lang` directory to add localized comments;
|
||||
- The file name should follow the format listed on the `https://minecraft.wiki/w/Language` page, such as `en_us`, `zh_cn`, `zh_hk`, `zh_tw`. The file format is `json`;
|
||||
2. Run the Gradle task `sortLangKeys` to re-sort the keys in your language file;
|
||||
3. Commit your changes using `git commit -m <Commit Message>`;
|
||||
4. Push your modified files to your repository.
|
||||
|
||||
After pushing, you can open a PR to submit your changes.
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ group=fun.bm.lophine
|
||||
mcVersion=26.2
|
||||
apiVersion=26.2
|
||||
channel=STABLE
|
||||
clipVersion=3.0.18
|
||||
clipVersion=1.0.0
|
||||
weightVersion=2.0.15
|
||||
# true for release, false for skip release, pre for pre-release
|
||||
release=pre
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
dependencies {
|
||||
mache("io.papermc:mache:26.2+build.1")
|
||||
- paperclip("io.papermc:paperclip:3.0.4")
|
||||
+ hyacinthusclip("moe.luminolmc:hyacinthusclip:${providers.gradleProperty("clipVersion").get()}") // TODO Later - rebrand
|
||||
+ hyacinthusclip("fun.bm:morninggloryclip:${providers.gradleProperty("clipVersion").get()}") // TODO Later - rebrand
|
||||
}
|
||||
|
||||
paperweight {
|
||||
|
||||
+96
-16
@@ -3,10 +3,10 @@ From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Fri, 5 Jun 2026 15:09:29 +0800
|
||||
Subject: [PATCH] Add config to enable tick command
|
||||
|
||||
only freeze/unfreeze/step/query can run when enabled
|
||||
only freeze/unfreeze/step/query/rate can run when enabled
|
||||
|
||||
diff --git a/io/papermc/paper/threadedregions/RegionizedServer.java b/io/papermc/paper/threadedregions/RegionizedServer.java
|
||||
index ff90abb47203c03636d3175f2b3efcf43517b3b0..276349d778c2e6f0b1081eec4851bad5d25db237 100644
|
||||
index ff90abb47203c03636d3175f2b3efcf43517b3b0..a2db29aa47a4b7213d4956f02f6e83122ccfdbd1 100644
|
||||
--- a/io/papermc/paper/threadedregions/RegionizedServer.java
|
||||
+++ b/io/papermc/paper/threadedregions/RegionizedServer.java
|
||||
@@ -239,6 +239,11 @@ public final class RegionizedServer {
|
||||
@@ -21,7 +21,22 @@ index ff90abb47203c03636d3175f2b3efcf43517b3b0..276349d778c2e6f0b1081eec4851bad5
|
||||
// expire invalid click command callbacks
|
||||
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.ADVENTURE_CLICK_MANAGER.handleQueue((int)this.tickCount); // Paper // Folia - region threading - moved to global tick
|
||||
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.DIALOG_CLICK_MANAGER.handleQueue((int)this.tickCount); // Paper // Folia - region threading - moved to global tick
|
||||
@@ -415,7 +420,7 @@ public final class RegionizedServer {
|
||||
@@ -265,6 +270,14 @@ public final class RegionizedServer {
|
||||
this.globalTick(world, tickCount);
|
||||
}
|
||||
|
||||
+ // Lophine start - Add a config to enable tick command
|
||||
+ if (fun.bm.lophine.carpet.config.modules.GeneralCompatConfig.commandTick) {
|
||||
+ net.minecraft.server.ServerTickRateManager rateManager = MinecraftServer.getServer().tickRateManager();
|
||||
+ rateManager.reduceSprintTicks();
|
||||
+ rateManager.endTickWork();
|
||||
+ }
|
||||
+ // Lophine end - Add a config to enable tick command
|
||||
+
|
||||
// tick connections
|
||||
this.tickConnections();
|
||||
|
||||
@@ -415,7 +428,7 @@ public final class RegionizedServer {
|
||||
}
|
||||
|
||||
private void tickTime(final ServerLevel world, final long tickCount) {
|
||||
@@ -31,10 +46,48 @@ index ff90abb47203c03636d3175f2b3efcf43517b3b0..276349d778c2e6f0b1081eec4851bad5
|
||||
}
|
||||
}
|
||||
diff --git a/io/papermc/paper/threadedregions/TickRegionScheduler.java b/io/papermc/paper/threadedregions/TickRegionScheduler.java
|
||||
index 58e557923dfe6cee39ec45e7f5aa43a5ded9f107..5f4f80c1d4003254fd840f71d86908603b57bfa2 100644
|
||||
index 58e557923dfe6cee39ec45e7f5aa43a5ded9f107..57a35d7a801621fc461e896eb2bba533d9d5bc1b 100644
|
||||
--- a/io/papermc/paper/threadedregions/TickRegionScheduler.java
|
||||
+++ b/io/papermc/paper/threadedregions/TickRegionScheduler.java
|
||||
@@ -559,6 +559,11 @@ public final class TickRegionScheduler {
|
||||
@@ -40,8 +40,8 @@ public final class TickRegionScheduler {
|
||||
}
|
||||
}
|
||||
|
||||
- public static final int TICK_RATE = 20;
|
||||
- public static final long TIME_BETWEEN_TICKS = 1_000_000_000L / TICK_RATE; // ns
|
||||
+ public static float TICK_RATE = 20; // Lophine - Add tick command support
|
||||
+ public static long TIME_BETWEEN_TICKS = (long) (1_000_000_000L / TICK_RATE); // ns // Lophine - Add tick command support
|
||||
// Folia start - watchdog
|
||||
public static final FoliaWatchdogThread WATCHDOG_THREAD = new FoliaWatchdogThread();
|
||||
static {
|
||||
@@ -509,8 +509,24 @@ public final class TickRegionScheduler {
|
||||
final long cpuStart = MEASURE_CPU_TIME ? THREAD_MX_BEAN.getCurrentThreadCpuTime() : 0L;
|
||||
final long tickStart = System.nanoTime();
|
||||
|
||||
- // use max(), don't assume that tickStart >= scheduledStart
|
||||
- final long tickCount = Math.max(1L, this.tickSchedule.getPeriodsAhead(TIME_BETWEEN_TICKS, tickStart));
|
||||
+ // Lophine start - Add a config to enable tick command
|
||||
+ final long tickCount;
|
||||
+ if (fun.bm.lophine.carpet.config.modules.GeneralCompatConfig.commandTick) {
|
||||
+ net.minecraft.server.ServerTickRateManager rateManager = MinecraftServer.getServer().tickRateManager();
|
||||
+ if (rateManager.isSprinting() && rateManager.checkShouldSprintThisTick()) {
|
||||
+ TICK_RATE = net.minecraft.server.commands.TickCommand.MAX_TICKRATE;
|
||||
+ TIME_BETWEEN_TICKS = (long) (1_000_000_000L / TICK_RATE);
|
||||
+ tickCount = 1;
|
||||
+ } else {
|
||||
+ TICK_RATE = rateManager.tickrate();
|
||||
+ TIME_BETWEEN_TICKS = (long) (1_000_000_000L / TICK_RATE);
|
||||
+ tickCount = Math.max(1L, this.tickSchedule.getPeriodsAhead(TIME_BETWEEN_TICKS, tickStart));
|
||||
+ }
|
||||
+ } else {
|
||||
+ // use max(), don't assume that tickStart >= scheduledStart
|
||||
+ tickCount = Math.max(1L, this.tickSchedule.getPeriodsAhead(TIME_BETWEEN_TICKS, tickStart));
|
||||
+ }
|
||||
+ // Lophine end - Add a config to enable tick command
|
||||
|
||||
if (!this.tryMarkTicking()) {
|
||||
if (!this.cancelled.get()) {
|
||||
@@ -559,6 +575,11 @@ public final class TickRegionScheduler {
|
||||
try {
|
||||
// next start isn't updated until the end of this tick
|
||||
this.tickRegion(tickCount, tickStart, scheduledEnd);
|
||||
@@ -63,27 +116,54 @@ index 6823c41c08ca1a1baf9257fc861ae97bbcbe3a50..0fa14f60310b063f419620539fd40898
|
||||
TimeCommand.register(this.dispatcher, context);
|
||||
TitleCommand.register(this.dispatcher, context);
|
||||
//TriggerCommand.register(this.dispatcher); // Folia - region threading - TODO later
|
||||
diff --git a/net/minecraft/server/ServerTickRateManager.java b/net/minecraft/server/ServerTickRateManager.java
|
||||
index eeb2f88723b37bb3cada04bf3098dd46f0ed7316..8432d0ce22ddc9c9bfa98901e403697f40e53c99 100644
|
||||
--- a/net/minecraft/server/ServerTickRateManager.java
|
||||
+++ b/net/minecraft/server/ServerTickRateManager.java
|
||||
@@ -110,7 +110,7 @@ public class ServerTickRateManager extends TickRateManager {
|
||||
return false;
|
||||
} else if (this.remainingSprintTicks > 0L) {
|
||||
this.sprintTickStartTime = System.nanoTime();
|
||||
- this.remainingSprintTicks--;
|
||||
+ // this.remainingSprintTicks--; // Luminol - Add tick command support
|
||||
return true;
|
||||
} else {
|
||||
this.finishTickSprint();
|
||||
@@ -118,6 +118,12 @@ public class ServerTickRateManager extends TickRateManager {
|
||||
}
|
||||
}
|
||||
|
||||
+ // Lophine start - Add tick command support
|
||||
+ public void reduceSprintTicks() {
|
||||
+ this.remainingSprintTicks--;
|
||||
+ }
|
||||
+ // Lophine end - Add tick command support
|
||||
+
|
||||
public void endTickWork() {
|
||||
this.sprintTimeSpend = this.sprintTimeSpend + (System.nanoTime() - this.sprintTickStartTime);
|
||||
}
|
||||
diff --git a/net/minecraft/server/commands/TickCommand.java b/net/minecraft/server/commands/TickCommand.java
|
||||
index e8d6a67143f3f0b4813e51bb273498bc404899b9..64b685b219b930a1bb7f85db9947f4d1ca9df093 100644
|
||||
index e8d6a67143f3f0b4813e51bb273498bc404899b9..4421658e4061299dea2ff72a77506214cc9045d8 100644
|
||||
--- a/net/minecraft/server/commands/TickCommand.java
|
||||
+++ b/net/minecraft/server/commands/TickCommand.java
|
||||
@@ -23,14 +23,14 @@ public class TickCommand {
|
||||
@@ -15,7 +15,7 @@ import net.minecraft.server.ServerTickRateManager;
|
||||
import net.minecraft.util.TimeUtil;
|
||||
|
||||
public class TickCommand {
|
||||
- private static final float MAX_TICKRATE = 10000.0F;
|
||||
+ public static final float MAX_TICKRATE = 10000.0F; // Lophine - Add tick command support
|
||||
private static final String DEFAULT_TICKRATE = String.valueOf(20);
|
||||
|
||||
public static void register(final CommandDispatcher<CommandSourceStack> dispatcher) {
|
||||
@@ -23,7 +23,7 @@ public class TickCommand {
|
||||
Commands.literal("tick")
|
||||
.requires(Commands.hasPermission(Commands.LEVEL_ADMINS))
|
||||
.then(Commands.literal("query").executes(c -> tickQuery(c.getSource())))
|
||||
- .then(
|
||||
+/* .then(
|
||||
+ .then( // Lophine - Add tick rate support
|
||||
Commands.literal("rate")
|
||||
.then(
|
||||
Commands.argument("rate", FloatArgumentType.floatArg(1.0F, 10000.0F))
|
||||
.suggests((c, b) -> SharedSuggestionProvider.suggest(new String[]{DEFAULT_TICKRATE}, b))
|
||||
.executes(c -> setTickingRate(c.getSource(), FloatArgumentType.getFloat(c, "rate")))
|
||||
)
|
||||
- )
|
||||
+ )*/
|
||||
.then(
|
||||
Commands.literal("step")
|
||||
.executes(c -> step(c.getSource(), 1))
|
||||
@@ -41,7 +41,7 @@ public class TickCommand {
|
||||
.executes(c -> step(c.getSource(), IntegerArgumentType.getInteger(c, "time")))
|
||||
)
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ Subject: [PATCH] Add config to enable save-all command
|
||||
|
||||
|
||||
diff --git a/io/papermc/paper/threadedregions/RegionizedServer.java b/io/papermc/paper/threadedregions/RegionizedServer.java
|
||||
index 276349d778c2e6f0b1081eec4851bad5d25db237..79ef1e69ec364beec69b37c6850c038cdba73b4c 100644
|
||||
index a2db29aa47a4b7213d4956f02f6e83122ccfdbd1..6fb3c88463ff69bddb7d8dcde0e5339567d3e1c6 100644
|
||||
--- a/io/papermc/paper/threadedregions/RegionizedServer.java
|
||||
+++ b/io/papermc/paper/threadedregions/RegionizedServer.java
|
||||
@@ -265,6 +265,8 @@ public final class RegionizedServer {
|
||||
|
||||
@@ -1,123 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Helvetica Volubi <suisuroru@blue-millennium.fun>
|
||||
Date: Wed, 21 Jan 2026 21:28:21 +0800
|
||||
Subject: [PATCH] Add tick rate support
|
||||
|
||||
|
||||
diff --git a/io/papermc/paper/threadedregions/RegionizedServer.java b/io/papermc/paper/threadedregions/RegionizedServer.java
|
||||
index 79ef1e69ec364beec69b37c6850c038cdba73b4c..6fb3c88463ff69bddb7d8dcde0e5339567d3e1c6 100644
|
||||
--- a/io/papermc/paper/threadedregions/RegionizedServer.java
|
||||
+++ b/io/papermc/paper/threadedregions/RegionizedServer.java
|
||||
@@ -272,6 +272,14 @@ public final class RegionizedServer {
|
||||
this.globalTick(world, tickCount);
|
||||
}
|
||||
|
||||
+ // Lophine start - Add a config to enable tick command
|
||||
+ if (fun.bm.lophine.carpet.config.modules.GeneralCompatConfig.commandTick) {
|
||||
+ net.minecraft.server.ServerTickRateManager rateManager = MinecraftServer.getServer().tickRateManager();
|
||||
+ rateManager.reduceSprintTicks();
|
||||
+ rateManager.endTickWork();
|
||||
+ }
|
||||
+ // Lophine end - Add a config to enable tick command
|
||||
+
|
||||
// tick connections
|
||||
this.tickConnections();
|
||||
|
||||
diff --git a/io/papermc/paper/threadedregions/TickRegionScheduler.java b/io/papermc/paper/threadedregions/TickRegionScheduler.java
|
||||
index 5f4f80c1d4003254fd840f71d86908603b57bfa2..57a35d7a801621fc461e896eb2bba533d9d5bc1b 100644
|
||||
--- a/io/papermc/paper/threadedregions/TickRegionScheduler.java
|
||||
+++ b/io/papermc/paper/threadedregions/TickRegionScheduler.java
|
||||
@@ -40,8 +40,8 @@ public final class TickRegionScheduler {
|
||||
}
|
||||
}
|
||||
|
||||
- public static final int TICK_RATE = 20;
|
||||
- public static final long TIME_BETWEEN_TICKS = 1_000_000_000L / TICK_RATE; // ns
|
||||
+ public static float TICK_RATE = 20; // Lophine - Add tick command support
|
||||
+ public static long TIME_BETWEEN_TICKS = (long) (1_000_000_000L / TICK_RATE); // ns // Lophine - Add tick command support
|
||||
// Folia start - watchdog
|
||||
public static final FoliaWatchdogThread WATCHDOG_THREAD = new FoliaWatchdogThread();
|
||||
static {
|
||||
@@ -509,8 +509,24 @@ public final class TickRegionScheduler {
|
||||
final long cpuStart = MEASURE_CPU_TIME ? THREAD_MX_BEAN.getCurrentThreadCpuTime() : 0L;
|
||||
final long tickStart = System.nanoTime();
|
||||
|
||||
- // use max(), don't assume that tickStart >= scheduledStart
|
||||
- final long tickCount = Math.max(1L, this.tickSchedule.getPeriodsAhead(TIME_BETWEEN_TICKS, tickStart));
|
||||
+ // Lophine start - Add a config to enable tick command
|
||||
+ final long tickCount;
|
||||
+ if (fun.bm.lophine.carpet.config.modules.GeneralCompatConfig.commandTick) {
|
||||
+ net.minecraft.server.ServerTickRateManager rateManager = MinecraftServer.getServer().tickRateManager();
|
||||
+ if (rateManager.isSprinting() && rateManager.checkShouldSprintThisTick()) {
|
||||
+ TICK_RATE = net.minecraft.server.commands.TickCommand.MAX_TICKRATE;
|
||||
+ TIME_BETWEEN_TICKS = (long) (1_000_000_000L / TICK_RATE);
|
||||
+ tickCount = 1;
|
||||
+ } else {
|
||||
+ TICK_RATE = rateManager.tickrate();
|
||||
+ TIME_BETWEEN_TICKS = (long) (1_000_000_000L / TICK_RATE);
|
||||
+ tickCount = Math.max(1L, this.tickSchedule.getPeriodsAhead(TIME_BETWEEN_TICKS, tickStart));
|
||||
+ }
|
||||
+ } else {
|
||||
+ // use max(), don't assume that tickStart >= scheduledStart
|
||||
+ tickCount = Math.max(1L, this.tickSchedule.getPeriodsAhead(TIME_BETWEEN_TICKS, tickStart));
|
||||
+ }
|
||||
+ // Lophine end - Add a config to enable tick command
|
||||
|
||||
if (!this.tryMarkTicking()) {
|
||||
if (!this.cancelled.get()) {
|
||||
diff --git a/net/minecraft/server/ServerTickRateManager.java b/net/minecraft/server/ServerTickRateManager.java
|
||||
index eeb2f88723b37bb3cada04bf3098dd46f0ed7316..8432d0ce22ddc9c9bfa98901e403697f40e53c99 100644
|
||||
--- a/net/minecraft/server/ServerTickRateManager.java
|
||||
+++ b/net/minecraft/server/ServerTickRateManager.java
|
||||
@@ -110,7 +110,7 @@ public class ServerTickRateManager extends TickRateManager {
|
||||
return false;
|
||||
} else if (this.remainingSprintTicks > 0L) {
|
||||
this.sprintTickStartTime = System.nanoTime();
|
||||
- this.remainingSprintTicks--;
|
||||
+ // this.remainingSprintTicks--; // Luminol - Add tick command support
|
||||
return true;
|
||||
} else {
|
||||
this.finishTickSprint();
|
||||
@@ -118,6 +118,12 @@ public class ServerTickRateManager extends TickRateManager {
|
||||
}
|
||||
}
|
||||
|
||||
+ // Lophine start - Add tick command support
|
||||
+ public void reduceSprintTicks() {
|
||||
+ this.remainingSprintTicks--;
|
||||
+ }
|
||||
+ // Lophine end - Add tick command support
|
||||
+
|
||||
public void endTickWork() {
|
||||
this.sprintTimeSpend = this.sprintTimeSpend + (System.nanoTime() - this.sprintTickStartTime);
|
||||
}
|
||||
diff --git a/net/minecraft/server/commands/TickCommand.java b/net/minecraft/server/commands/TickCommand.java
|
||||
index 64b685b219b930a1bb7f85db9947f4d1ca9df093..4421658e4061299dea2ff72a77506214cc9045d8 100644
|
||||
--- a/net/minecraft/server/commands/TickCommand.java
|
||||
+++ b/net/minecraft/server/commands/TickCommand.java
|
||||
@@ -15,7 +15,7 @@ import net.minecraft.server.ServerTickRateManager;
|
||||
import net.minecraft.util.TimeUtil;
|
||||
|
||||
public class TickCommand {
|
||||
- private static final float MAX_TICKRATE = 10000.0F;
|
||||
+ public static final float MAX_TICKRATE = 10000.0F; // Lophine - Add tick command support
|
||||
private static final String DEFAULT_TICKRATE = String.valueOf(20);
|
||||
|
||||
public static void register(final CommandDispatcher<CommandSourceStack> dispatcher) {
|
||||
@@ -23,14 +23,14 @@ public class TickCommand {
|
||||
Commands.literal("tick")
|
||||
.requires(Commands.hasPermission(Commands.LEVEL_ADMINS))
|
||||
.then(Commands.literal("query").executes(c -> tickQuery(c.getSource())))
|
||||
-/* .then(
|
||||
+ .then( // Lophine - Add tick rate support
|
||||
Commands.literal("rate")
|
||||
.then(
|
||||
Commands.argument("rate", FloatArgumentType.floatArg(1.0F, 10000.0F))
|
||||
.suggests((c, b) -> SharedSuggestionProvider.suggest(new String[]{DEFAULT_TICKRATE}, b))
|
||||
.executes(c -> setTickingRate(c.getSource(), FloatArgumentType.getFloat(c, "rate")))
|
||||
)
|
||||
- )*/
|
||||
+ )
|
||||
.then(
|
||||
Commands.literal("step")
|
||||
.executes(c -> step(c.getSource(), 1))
|
||||
+9
-8
@@ -311,7 +311,7 @@ index 1c4c67410849f844946e4883585910fc8fe97048..08a6fc0e58d61b1765e704c500b3aec6
|
||||
}
|
||||
// Leaves end - skip
|
||||
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
||||
index ed50484ca24ef24b1e5bef9f6369dfa4b30c359c..64a87785048e103c10f6453e97a37f8501255adc 100644
|
||||
index ed50484ca24ef24b1e5bef9f6369dfa4b30c359c..575b4eabcaac48ae87b69dd037493ebfe0a1212c 100644
|
||||
--- a/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/net/minecraft/server/players/PlayerList.java
|
||||
@@ -129,6 +129,7 @@ public abstract class PlayerList {
|
||||
@@ -330,12 +330,12 @@ index ed50484ca24ef24b1e5bef9f6369dfa4b30c359c..64a87785048e103c10f6453e97a37f85
|
||||
int count = this.usersCountedAgainstLimit.size();
|
||||
if (count >= limit) {
|
||||
return false;
|
||||
@@ -221,6 +223,123 @@ public abstract class PlayerList {
|
||||
@@ -221,6 +223,124 @@ public abstract class PlayerList {
|
||||
|
||||
abstract public void loadAndSaveFiles(); // Paper - fix converting txt to json file; moved from DedicatedPlayerList constructor
|
||||
|
||||
+ // Leaves start - replay mod api
|
||||
+ public void placeNewPhotographer(Connection connection, org.leavesmc.leaves.replay.ServerPhotographer player, ServerLevel worldserver) {
|
||||
+ public void placeNewPhotographer(org.leavesmc.leaves.replay.Recorder connection, org.leavesmc.leaves.replay.ServerPhotographer player, ServerLevel worldserver) {
|
||||
+ player.isRealPlayer = true; // Paper
|
||||
+ player.loginTime = System.currentTimeMillis(); // Paper
|
||||
+
|
||||
@@ -347,6 +347,7 @@ index ed50484ca24ef24b1e5bef9f6369dfa4b30c359c..64a87785048e103c10f6453e97a37f85
|
||||
+ LevelData worlddata = worldserver1.getLevelData();
|
||||
+
|
||||
+ ServerGamePacketListenerImpl playerconnection = new ServerGamePacketListenerImpl(this.server, connection, player, CommonListenerCookie.createInitial(player.gameProfile, false));
|
||||
+ connection.bind(playerconnection);
|
||||
+ GameRules gamerules = worldserver1.getGameRules();
|
||||
+ boolean flag = gamerules.get(GameRules.IMMEDIATE_RESPAWN);
|
||||
+ boolean flag1 = gamerules.get(GameRules.REDUCED_DEBUG_INFO);
|
||||
@@ -454,7 +455,7 @@ index ed50484ca24ef24b1e5bef9f6369dfa4b30c359c..64a87785048e103c10f6453e97a37f85
|
||||
public void placeNewPlayer(final Connection connection, final ServerPlayer player, final CommonListenerCookie cookie) {
|
||||
player.isRealPlayer = true; // Paper
|
||||
player.loginTime = System.currentTimeMillis(); // Paper - Replace OfflinePlayer#getLastPlayed
|
||||
@@ -295,6 +414,7 @@ public abstract class PlayerList {
|
||||
@@ -295,6 +415,7 @@ public abstract class PlayerList {
|
||||
|
||||
// player.connection.send(ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(this.players)); // CraftBukkit - replaced with loop below
|
||||
this.players.add(player);
|
||||
@@ -462,7 +463,7 @@ index ed50484ca24ef24b1e5bef9f6369dfa4b30c359c..64a87785048e103c10f6453e97a37f85
|
||||
this.playersByName.put(player.getScoreboardName().toLowerCase(java.util.Locale.ROOT), player); // Spigot
|
||||
this.playersByUUID.put(player.getUUID(), player);
|
||||
// this.broadcastAll(ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(List.of(player))); // CraftBukkit - replaced with loop below
|
||||
@@ -510,6 +630,7 @@ public abstract class PlayerList {
|
||||
@@ -510,6 +631,7 @@ public abstract class PlayerList {
|
||||
}
|
||||
|
||||
protected void save(final ServerPlayer player) {
|
||||
@@ -470,7 +471,7 @@ index ed50484ca24ef24b1e5bef9f6369dfa4b30c359c..64a87785048e103c10f6453e97a37f85
|
||||
if (!player.getBukkitEntity().isPersistent()) return; // CraftBukkit
|
||||
player.lastSave = System.nanoTime(); // Folia - region threading - changed to nanoTime tracking
|
||||
this.playerIo.save(player);
|
||||
@@ -524,6 +645,48 @@ public abstract class PlayerList {
|
||||
@@ -524,6 +646,48 @@ public abstract class PlayerList {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -519,7 +520,7 @@ index ed50484ca24ef24b1e5bef9f6369dfa4b30c359c..64a87785048e103c10f6453e97a37f85
|
||||
public net.kyori.adventure.text.@Nullable Component remove(final ServerPlayer player) { // CraftBukkit - return string // Paper - return Component
|
||||
// Paper start - Fix kick event leave message not being sent
|
||||
return this.remove(player, net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? player.getBukkitEntity().displayName() : io.papermc.paper.adventure.PaperAdventure.asAdventure(player.getDisplayName())));
|
||||
@@ -597,6 +760,7 @@ public abstract class PlayerList {
|
||||
@@ -597,6 +761,7 @@ public abstract class PlayerList {
|
||||
player.getBukkitEntity().packetProcessor.close(); // Folia - region threading
|
||||
player.getAdvancements().clearTriggers();
|
||||
this.players.remove(player);
|
||||
@@ -527,7 +528,7 @@ index ed50484ca24ef24b1e5bef9f6369dfa4b30c359c..64a87785048e103c10f6453e97a37f85
|
||||
this.playersByName.remove(player.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot
|
||||
if (me.earthme.luminol.config.modules.misc.UsernameCheckConfig.allowOldPlayersJoin) this.playedPlayers.remove(player.getGameProfile().name()); // Leaf - Configurable vanilla username check
|
||||
this.server.getCustomBossEvents().onPlayerDisconnect(player);
|
||||
@@ -910,15 +1074,15 @@ public abstract class PlayerList {
|
||||
@@ -910,15 +1075,15 @@ public abstract class PlayerList {
|
||||
}
|
||||
|
||||
public String[] getPlayerNamesArray() {
|
||||
+4
-4
@@ -268,10 +268,10 @@ index 77b9cd3d14eddc735d9131597916405fde4230ec..b23a47380fb1178696dc49e35d2c3d7d
|
||||
} else {
|
||||
LOGGER.warn("Player {} was dropping items too fast in creative mode, ignoring.", this.player.getPlainTextName());
|
||||
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
||||
index 64a87785048e103c10f6453e97a37f8501255adc..432a6dfff8e45eccea653b0d4cf04956edec6d98 100644
|
||||
index 575b4eabcaac48ae87b69dd037493ebfe0a1212c..516561a25d28f2c7bcc3e71c5f2f9da99c2899c3 100644
|
||||
--- a/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/net/minecraft/server/players/PlayerList.java
|
||||
@@ -279,7 +279,7 @@ public abstract class PlayerList {
|
||||
@@ -280,7 +280,7 @@ public abstract class PlayerList {
|
||||
// org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handlePlayerJoin(player); // Leaves - protocol
|
||||
|
||||
// Leaves start - bot support
|
||||
@@ -280,7 +280,7 @@ index 64a87785048e103c10f6453e97a37f8501255adc..432a6dfff8e45eccea653b0d4cf04956
|
||||
org.leavesmc.leaves.bot.ServerBot bot = this.server.getBotList().getBotByName(player.getScoreboardName());
|
||||
if (bot != null) {
|
||||
this.server.getBotList().removeBot(bot, org.leavesmc.leaves.event.bot.BotRemoveEvent.RemoveReason.INTERNAL, player.getBukkitEntity(), false, false);
|
||||
@@ -441,7 +441,7 @@ public abstract class PlayerList {
|
||||
@@ -442,7 +442,7 @@ public abstract class PlayerList {
|
||||
org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handlePlayerJoin(player); // Leaves - protocol
|
||||
|
||||
// Leaves start - bot support
|
||||
@@ -289,7 +289,7 @@ index 64a87785048e103c10f6453e97a37f8501255adc..432a6dfff8e45eccea653b0d4cf04956
|
||||
org.leavesmc.leaves.bot.ServerBot bot = this.server.getBotList().getBotByName(player.getScoreboardName());
|
||||
if (bot != null) {
|
||||
this.server.getBotList().removeBot(bot, org.leavesmc.leaves.event.bot.BotRemoveEvent.RemoveReason.INTERNAL, player.getBukkitEntity(), false, false);
|
||||
@@ -969,7 +969,7 @@ public abstract class PlayerList {
|
||||
@@ -970,7 +970,7 @@ public abstract class PlayerList {
|
||||
).callEvent();
|
||||
// Paper end
|
||||
// Leaves start - bot support
|
||||
+2
-2
@@ -66,10 +66,10 @@ index cef9c7887332b91e2466a97a5250db81f7af0dcf..a17212c1910ce9490fe8df8c4ef507e2
|
||||
|
||||
public Set<ThrownEnderpearl> getEnderPearls() {
|
||||
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
||||
index 432a6dfff8e45eccea653b0d4cf04956edec6d98..835c13ff69592951261f917ad999d9a7689e802c 100644
|
||||
index 516561a25d28f2c7bcc3e71c5f2f9da99c2899c3..eb652157ef25e83b897f52aff3c49c09c6f656c8 100644
|
||||
--- a/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/net/minecraft/server/players/PlayerList.java
|
||||
@@ -748,11 +748,13 @@ public abstract class PlayerList {
|
||||
@@ -749,11 +749,13 @@ public abstract class PlayerList {
|
||||
player.unRide();
|
||||
|
||||
for (ThrownEnderpearl enderpearl : player.getEnderPearls()) {
|
||||
+12
-31
@@ -11,58 +11,39 @@ import org.leavesmc.leaves.command.bot.BotCommand;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@ConfigClassInfo(
|
||||
category = EnumConfigCategory.ROOT,
|
||||
name = "fakeplayer",
|
||||
directory = {"carpet"},
|
||||
comments = """
|
||||
Carpet fakeplayer compatibility mapped onto Lophine fakeplayers.
|
||||
commandPlayer is currently backed by Lophine's /bot command surface."""
|
||||
)
|
||||
@ConfigClassInfo(category = EnumConfigCategory.ROOT, name = "fakeplayer", directory = {"carpet"})
|
||||
public class FakePlayerCompatConfig implements IConfigModule {
|
||||
@ConfigInfo(name = "commandPlayer", comments = """
|
||||
Enable /player command.(not remapped)
|
||||
If you want to enable bot command, please see lophine global config.""")
|
||||
@ConfigInfo(name = "commandPlayer")
|
||||
public static boolean commandPlayer = false;
|
||||
|
||||
@ConfigInfo(name = "fakePlayerResident", comments = """
|
||||
Keep fakeplayers resident across unload and restart.""")
|
||||
@ConfigInfo(name = "fakePlayerResident")
|
||||
public static boolean fakePlayerResident = false;
|
||||
|
||||
@ConfigInfo(name = "openFakePlayerInventory", comments = """
|
||||
Allow opening fakeplayer inventories.""")
|
||||
@ConfigInfo(name = "openFakePlayerInventory")
|
||||
public static boolean openFakePlayerInventory = false;
|
||||
|
||||
@ConfigInfo(name = "fakePlayerTicksLikeRealPlayer", comments = """
|
||||
Tick fakeplayers in the network phase to better match real player timing.""")
|
||||
@ConfigInfo(name = "fakePlayerTicksLikeRealPlayer")
|
||||
public static boolean fakePlayerTicksLikeRealPlayer = false;
|
||||
|
||||
@ConfigInfo(name = "fakePlayerDefaultSurvivalMode", comments = """
|
||||
Force newly created fakeplayers to start in survival instead of the server default gamemode.""")
|
||||
@ConfigInfo(name = "fakePlayerDefaultSurvivalMode")
|
||||
public static boolean fakePlayerDefaultSurvivalMode = false;
|
||||
|
||||
@ConfigInfo(name = "fakePlayerInteractLikeClient", comments = """
|
||||
Make fakeplayer entity interaction follow client-side fallback behavior more closely.""")
|
||||
@ConfigInfo(name = "fakePlayerInteractLikeClient")
|
||||
public static boolean fakePlayerInteractLikeClient = false;
|
||||
|
||||
@ConfigInfo(name = "fakePlayerAutoReplaceTool", comments = """
|
||||
Toggle automatic tool replacement for fakeplayers.""")
|
||||
@ConfigInfo(name = "fakePlayerAutoReplaceTool")
|
||||
public static boolean fakePlayerAutoReplaceTool = false;
|
||||
|
||||
@ConfigInfo(name = "fakePlayerAutoReplenishment", comments = """
|
||||
Toggle automatic stack replenishment for fakeplayers.""")
|
||||
@ConfigInfo(name = "fakePlayerAutoReplenishment")
|
||||
public static boolean fakePlayerAutoReplenishment = false;
|
||||
|
||||
@ConfigInfo(name = "fakePlayerAutoReplenishmentFormShulkerBox", comments = """
|
||||
Let fakeplayer replenishment pull matching items out of shulker boxes in the inventory.""")
|
||||
@ConfigInfo(name = "fakePlayerAutoReplenishmentFormShulkerBox")
|
||||
public static boolean fakePlayerAutoReplenishmentFormShulkerBox = false;
|
||||
|
||||
@ConfigInfo(name = "fakePlayerAutoFish", comments = """
|
||||
Let fakeplayers holding a fishing rod automatically cast and reel it in.""")
|
||||
@ConfigInfo(name = "fakePlayerAutoFish")
|
||||
public static boolean fakePlayerAutoFish = false;
|
||||
|
||||
@ConfigInfo(name = "fakePlayerReloadAction", comments = """
|
||||
Persist queued fakeplayer actions across save and reload.""")
|
||||
@ConfigInfo(name = "fakePlayerReloadAction")
|
||||
public static boolean fakePlayerReloadAction = false;
|
||||
|
||||
@DoNotLoad
|
||||
|
||||
+57
-131
@@ -8,248 +8,174 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ConfigClassInfo(
|
||||
category = EnumConfigCategory.ROOT,
|
||||
name = "general",
|
||||
directory = {"carpet"},
|
||||
comments = """
|
||||
Carpet/AMS/TIS/Org compatibility rules backed by existing Lophine features.
|
||||
Only rules that already have a working server-side implementation are exposed here."""
|
||||
)
|
||||
@ConfigClassInfo(category = EnumConfigCategory.ROOT, name = "general", directory = {"carpet"})
|
||||
public class GeneralCompatConfig implements IConfigModule {
|
||||
@ConfigInfo(name = "language", comments = """
|
||||
Carpet language value.
|
||||
ATTENTION: This config will not update in Lophine global now!""")
|
||||
@ConfigInfo(name = "language")
|
||||
public static String language = "en_us";
|
||||
|
||||
@ConfigInfo(name = "amsUpdateSuppressionCrashFix", comments = """
|
||||
Update suppression crash protection.""")
|
||||
@ConfigInfo(name = "amsUpdateSuppressionCrashFix")
|
||||
public static boolean amsUpdateSuppressionCrashFix = false;
|
||||
|
||||
@ConfigInfo(name = "yeetUpdateSuppressionCrash", comments = """
|
||||
Update suppression crash yeeting.""")
|
||||
@ConfigInfo(name = "yeetUpdateSuppressionCrash")
|
||||
public static boolean yeetUpdateSuppressionCrash = false;
|
||||
|
||||
@ConfigInfo(name = "dustTrapdoorReintroduced", comments = """
|
||||
Should the pre-1.20 mechanism be reintroduced:
|
||||
Redstone dust does not connect to adjacent redstone dust on trapdoors that are open
|
||||
Pre-1.20.2 mechanism: Redstone dust, redstone repeaters,
|
||||
and redstone comparators do not check for attachment when receiving status updates from below.""")
|
||||
@ConfigInfo(name = "dustTrapdoorReintroduced")
|
||||
public static boolean dustTrapdoorReintroduced = false;
|
||||
|
||||
@ConfigInfo(name = "shulkerBoxCCEReintroduced", comments = """
|
||||
Use ClassCastException for update suppression.""")
|
||||
@ConfigInfo(name = "shulkerBoxCCEReintroduced")
|
||||
public static boolean shulkerBoxCCEReintroduced = false;
|
||||
|
||||
@ConfigInfo(name = "instantBlockUpdaterReintroduced", comments = """
|
||||
Instant block updater.""")
|
||||
@ConfigInfo(name = "instantBlockUpdaterReintroduced")
|
||||
public static boolean instantBlockUpdaterReintroduced = false;
|
||||
|
||||
@ConfigInfo(name = "commandTick", comments = """
|
||||
Enable the tick command support.""")
|
||||
@ConfigInfo(name = "commandTick")
|
||||
public static boolean commandTick = false;
|
||||
|
||||
@ConfigInfo(name = "creativeNoClip", comments = """
|
||||
Whether to enable creative fly no clip.
|
||||
When enabled, players in creative mode will not collide with blocks while flying.
|
||||
This allows them to pass through blocks without obstruction.""")
|
||||
@ConfigInfo(name = "creativeNoClip")
|
||||
public static boolean creativeNoClip = false;
|
||||
|
||||
@ConfigInfo(name = "optimizedDragonRespawn", comments = """
|
||||
Enable optimized dragon respawn.""")
|
||||
@ConfigInfo(name = "optimizedDragonRespawn")
|
||||
public static boolean optimizedDragonRespawn = false;
|
||||
|
||||
@ConfigInfo(name = "antiSpamDisabled", comments = """
|
||||
Disable the server-side chat and creative-drop spam throttles used by vanilla/Spigot.""")
|
||||
@ConfigInfo(name = "antiSpamDisabled")
|
||||
public static boolean antiSpamDisabled = false;
|
||||
|
||||
@ConfigInfo(name = "blockPlacementIgnoreEntity", comments = """
|
||||
Allow creative players to place blocks without entity collision checks.""")
|
||||
@ConfigInfo(name = "blockPlacementIgnoreEntity")
|
||||
public static boolean blockPlacementIgnoreEntity = false;
|
||||
|
||||
@ConfigInfo(name = "creativeOpenContainerForcibly", comments = """
|
||||
Allow creative players to forcibly open blocked chests, ender chests and shulker boxes.""")
|
||||
@ConfigInfo(name = "creativeOpenContainerForcibly")
|
||||
public static boolean creativeOpenContainerForcibly = false;
|
||||
|
||||
@ConfigInfo(name = "creativeOneHitKill", comments = """
|
||||
Allow creative players to instantly kill attackable non-creative, non-spectator entities.
|
||||
Sneaking expands the effect into a small area attack.""")
|
||||
@ConfigInfo(name = "creativeOneHitKill")
|
||||
public static boolean creativeOneHitKill = false;
|
||||
|
||||
@ConfigInfo(name = "observerNoDetection", comments = """
|
||||
Disable observer detection pulses entirely.""")
|
||||
@ConfigInfo(name = "observerNoDetection")
|
||||
public static boolean observerNoDetection = false;
|
||||
|
||||
@ConfigInfo(name = "bambooModelNoOffset", comments = """
|
||||
Remove the random horizontal model offset from bamboo and bamboo saplings.""")
|
||||
@ConfigInfo(name = "bambooModelNoOffset")
|
||||
public static boolean bambooModelNoOffset = false;
|
||||
|
||||
@ConfigInfo(name = "creativeNoItemCooldown", comments = """
|
||||
Skip item cooldown application for creative players.""")
|
||||
@ConfigInfo(name = "creativeNoItemCooldown")
|
||||
public static boolean creativeNoItemCooldown = false;
|
||||
|
||||
@ConfigInfo(name = "ctrlQCraftingFix", comments = """
|
||||
Compatibility flag for the upstream result-slot Ctrl+Q crafting fix already present in the current menu code.""")
|
||||
@ConfigInfo(name = "ctrlQCraftingFix")
|
||||
public static boolean ctrlQCraftingFix = false;
|
||||
|
||||
@ConfigInfo(name = "carpetAlwaysSetDefault", comments = """
|
||||
Compatibility flag for Lophine's config loader, which already writes default values into the compat config during preload.""")
|
||||
@ConfigInfo(name = "carpetAlwaysSetDefault")
|
||||
public static boolean carpetAlwaysSetDefault = false;
|
||||
|
||||
@ConfigInfo(name = "placementRotationFix", comments = """
|
||||
Use the player's main body rotation for placement direction checks instead of interpolated head yaw.""")
|
||||
@ConfigInfo(name = "placementRotationFix")
|
||||
public static boolean placementRotationFix = false;
|
||||
|
||||
@ConfigInfo(name = "tntDoNotUpdate", comments = """
|
||||
Prevent TNT from checking redstone power when first placed.""")
|
||||
@ConfigInfo(name = "tntDoNotUpdate")
|
||||
public static boolean tntDoNotUpdate = false;
|
||||
|
||||
@ConfigInfo(name = "totallyNoBlockUpdate", comments = """
|
||||
Suppress neighbor and shape updates globally for block changes.""")
|
||||
@ConfigInfo(name = "totallyNoBlockUpdate")
|
||||
public static boolean totallyNoBlockUpdate = false;
|
||||
|
||||
@ConfigInfo(name = "tiscmNetworkProtocol", comments = """
|
||||
Enable the native Carpet TIS Addition network channel on `tiscm:network/v1`.""")
|
||||
@ConfigInfo(name = "tiscmNetworkProtocol")
|
||||
public static boolean tiscmNetworkProtocol = false;
|
||||
|
||||
@ConfigInfo(name = "hopperNoItemCost", comments = """
|
||||
Restore the transferred stack into a hopper when a wool block is placed on top of it.""")
|
||||
@ConfigInfo(name = "hopperNoItemCost")
|
||||
public static boolean hopperNoItemCost = false;
|
||||
|
||||
@ConfigInfo(name = "explosionNoBlockDamage", comments = """
|
||||
Let explosions damage entities without breaking blocks.""")
|
||||
@ConfigInfo(name = "explosionNoBlockDamage")
|
||||
public static boolean explosionNoBlockDamage = false;
|
||||
|
||||
@ConfigInfo(name = "noCreeperBlockBreaking", comments = """
|
||||
Disables creeper explosion block breaking.""")
|
||||
@ConfigInfo(name = "noCreeperBlockBreaking")
|
||||
public static boolean noCreeperBlockBreaking = false;
|
||||
|
||||
@ConfigInfo(name = "noGhastBlockBreaking", comments = """
|
||||
Disables ghast fireball explosion block breaking.""")
|
||||
@ConfigInfo(name = "noGhastBlockBreaking")
|
||||
public static boolean noGhastBlockBreaking = false;
|
||||
|
||||
@ConfigInfo(name = "disableBlazeFire", comments = """
|
||||
Disables fire made from blaze fireballs.""")
|
||||
@ConfigInfo(name = "disableBlazeFire")
|
||||
public static boolean disableBlazeFire = false;
|
||||
|
||||
@ConfigInfo(name = "disableGhastFire", comments = """
|
||||
Disables fire made from ghast fireballs.""")
|
||||
@ConfigInfo(name = "disableGhastFire")
|
||||
public static boolean disableGhastFire = false;
|
||||
|
||||
@ConfigInfo(name = "optimizedTNTHighPriority", comments = """
|
||||
Compatibility flag for the already optimized server explosion path carried by the current runtime.""")
|
||||
@ConfigInfo(name = "optimizedTNTHighPriority")
|
||||
public static boolean optimizedTNTHighPriority = false;
|
||||
|
||||
@ConfigInfo(name = "tntPrimerMomentumRemoved", comments = """
|
||||
Remove the random horizontal launch momentum from newly primed TNT.""")
|
||||
@ConfigInfo(name = "tntPrimerMomentumRemoved")
|
||||
public static boolean tntPrimerMomentumRemoved = false;
|
||||
|
||||
@ConfigInfo(name = "tntIgnoreRedstoneSignal", comments = """
|
||||
Ignore redstone power when deciding whether TNT should auto-prime.""")
|
||||
@ConfigInfo(name = "tntIgnoreRedstoneSignal")
|
||||
public static boolean tntIgnoreRedstoneSignal = false;
|
||||
|
||||
@ConfigInfo(name = "tntDupingFix", comments = """
|
||||
Toggle the piston desync path used by vanilla TNT duplication setups.""")
|
||||
@ConfigInfo(name = "tntDupingFix")
|
||||
public static boolean tntDupingFix = false;
|
||||
|
||||
@ConfigInfo(name = "interactionUpdates", comments = """
|
||||
Control whether player interaction block changes emit normal block updates.
|
||||
Set to false to suppress neighbor and shape updates during block use and breaking.""")
|
||||
@ConfigInfo(name = "interactionUpdates")
|
||||
public static boolean interactionUpdates = true;
|
||||
|
||||
@ConfigInfo(name = "xpNoCooldown", comments = """
|
||||
Allow players to absorb multiple experience orbs in the same tick without pickup delay.""")
|
||||
@ConfigInfo(name = "xpNoCooldown")
|
||||
public static boolean xpNoCooldown = false;
|
||||
|
||||
@ConfigInfo(name = "powerfulExpMending", comments = """
|
||||
Let picked-up experience repair all damaged mending items in the player's inventory, not only equipped gear.""")
|
||||
@ConfigInfo(name = "powerfulExpMending")
|
||||
public static boolean powerfulExpMending = false;
|
||||
|
||||
@ConfigInfo(name = "clientSettingsLostOnRespawnFix", comments = """
|
||||
Reapply the player's last known client settings after respawn.""")
|
||||
@ConfigInfo(name = "clientSettingsLostOnRespawnFix")
|
||||
public static boolean clientSettingsLostOnRespawnFix = false;
|
||||
|
||||
@ConfigInfo(name = "sensibleEnderman", comments = """
|
||||
Restrict enderman block pickup to pumpkins and melons only.""")
|
||||
@ConfigInfo(name = "sensibleEnderman")
|
||||
public static boolean sensibleEnderman = false;
|
||||
|
||||
@ConfigInfo(name = "entityInstantDeathRemoval", comments = """
|
||||
Remove the normal 20gt delay before dead living entities are discarded.""")
|
||||
@ConfigInfo(name = "entityInstantDeathRemoval")
|
||||
public static boolean entityInstantDeathRemoval = false;
|
||||
|
||||
@ConfigInfo(name = "farmlandTrampledDisabled", comments = """
|
||||
Prevent farmland from turning into dirt when entities land on it.""")
|
||||
@ConfigInfo(name = "farmlandTrampledDisabled")
|
||||
public static boolean farmlandTrampledDisabled = false;
|
||||
|
||||
@ConfigInfo(name = "shulkerGolem", comments = """
|
||||
Allow a carved pumpkin on top of a shulker box to summon a shulker.""")
|
||||
@ConfigInfo(name = "shulkerGolem")
|
||||
public static boolean shulkerGolem = false;
|
||||
|
||||
@ConfigInfo(name = "preventEndSpikeRespawn", comments = """
|
||||
Skip obsidian spike regeneration during dragon respawn.""")
|
||||
@ConfigInfo(name = "preventEndSpikeRespawn")
|
||||
public static boolean preventEndSpikeRespawn = false;
|
||||
|
||||
@ConfigInfo(name = "yeetOutOfOrderChatKick", comments = """
|
||||
Ignore out-of-order secure chat chain checks instead of invalidating the chat session.""")
|
||||
@ConfigInfo(name = "yeetOutOfOrderChatKick")
|
||||
public static boolean yeetOutOfOrderChatKick = false;
|
||||
|
||||
@ConfigInfo(name = "betterCraftableBoneBlock", comments = """
|
||||
Add the AMS alternate bone block recipe that yields 3 bone blocks from 9 bones.""")
|
||||
@ConfigInfo(name = "betterCraftableBoneBlock")
|
||||
public static boolean betterCraftableBoneBlock = false;
|
||||
|
||||
@ConfigInfo(name = "betterCraftableDispenser", comments = """
|
||||
Add the AMS alternate dispenser recipes using a dropper.""")
|
||||
@ConfigInfo(name = "betterCraftableDispenser")
|
||||
public static boolean betterCraftableDispenser = false;
|
||||
|
||||
@ConfigInfo(name = "viewDistance", comments = """
|
||||
Override the dedicated server's startup view distance with the Carpet-compatible value.""")
|
||||
@ConfigInfo(name = "viewDistance")
|
||||
public static int viewDistance = 12;
|
||||
|
||||
@ConfigInfo(name = "tickCommandPermission", comments = """
|
||||
Override the `/tick` command permission level.
|
||||
Accepts values in the range 0..4, where 2 matches old Carpet behavior and 3 keeps vanilla.""")
|
||||
@ConfigInfo(name = "tickCommandPermission")
|
||||
public static int tickCommandPermission = 3;
|
||||
|
||||
@ConfigInfo(name = "tickFreezeCommandToggleable", comments = """
|
||||
Make `/tick freeze` toggle back to running when executed while the server is already frozen.""")
|
||||
@ConfigInfo(name = "tickFreezeCommandToggleable")
|
||||
public static boolean tickFreezeCommandToggleable = false;
|
||||
|
||||
@ConfigInfo(name = "syncServerMsptMetricsData", comments = """
|
||||
Broadcast live MSPT samples through the native TISCM protocol channel.""")
|
||||
@ConfigInfo(name = "syncServerMsptMetricsData")
|
||||
public static boolean syncServerMsptMetricsData = false;
|
||||
|
||||
@ConfigInfo(name = "simpleInGameCalculator", comments = """
|
||||
Evaluate chat messages prefixed with `=` as a simple calculator expression and reply privately.""")
|
||||
@ConfigInfo(name = "simpleInGameCalculator")
|
||||
public static boolean simpleInGameCalculator = false;
|
||||
|
||||
@ConfigInfo(name = "microTiming", comments = """
|
||||
Compatibility flag for the built-in region profiler and timing instrumentation carried by Folia/Moonrise.""")
|
||||
@ConfigInfo(name = "microTiming")
|
||||
public static boolean microTiming = false;
|
||||
|
||||
@ConfigInfo(name = "fastRedstoneDust", comments = """
|
||||
Route redstone dust updates through the Alternate Current fast-update backend.""")
|
||||
@ConfigInfo(name = "fastRedstoneDust")
|
||||
public static boolean fastRedstoneDust = false;
|
||||
|
||||
@ConfigInfo(name = "lagFreeSpawning", comments = """
|
||||
Use the lightweight collision and precooked-mob spawning path for natural spawning checks.""")
|
||||
@ConfigInfo(name = "lagFreeSpawning")
|
||||
public static boolean lagFreeSpawning = false;
|
||||
|
||||
@ConfigInfo(name = "optimizedFastEntityMovement", comments = """
|
||||
Compatibility flag for the always-on Moonrise/Paper fast entity movement collision pipeline.""")
|
||||
@ConfigInfo(name = "optimizedFastEntityMovement")
|
||||
public static boolean optimizedFastEntityMovement = false;
|
||||
|
||||
@ConfigInfo(name = "optimizedHardHitBoxEntityCollision", comments = """
|
||||
Compatibility flag for the always-on Moonrise/Paper hard-hitbox entity collision optimizations.""")
|
||||
@ConfigInfo(name = "optimizedHardHitBoxEntityCollision")
|
||||
public static boolean optimizedHardHitBoxEntityCollision = false;
|
||||
|
||||
@ConfigInfo(name = "tntFuseDuration", comments = """
|
||||
Override the default primed TNT fuse duration in ticks.
|
||||
Accepts values in the range 0..32767.""")
|
||||
@ConfigInfo(name = "tntFuseDuration")
|
||||
public static int tntFuseDuration = 80;
|
||||
|
||||
@ConfigInfo(name = "defaultLoggers", comments = """
|
||||
Carpet-style default logger subscriptions for players.
|
||||
Examples: ["tps", "mob_caps", "counter white"]""")
|
||||
@ConfigInfo(name = "defaultLoggers")
|
||||
public static List<String> defaultLoggers = List.of();
|
||||
|
||||
public static boolean mergedUpdateSuppressionCrashEnabled() {
|
||||
|
||||
+1
-3
@@ -7,8 +7,6 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
||||
|
||||
@ConfigClassInfo(category = EnumConfigCategory.REMOVED, name = "removed_config")
|
||||
public class RemovedConfig implements IConfigModule {
|
||||
@ConfigInfo(name = "removed", comments =
|
||||
"""
|
||||
RemovedConfig redirect to here, no any function.""")
|
||||
@ConfigInfo(name = "removed")
|
||||
public static boolean enabled = true;
|
||||
}
|
||||
+3
-12
@@ -11,21 +11,12 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@ConfigClassInfo(
|
||||
category = EnumConfigCategory.ROOT,
|
||||
name = "hopper_counter",
|
||||
directory = {"carpet"},
|
||||
comments = """
|
||||
Hopper counter functions."""
|
||||
)
|
||||
@ConfigClassInfo(category = EnumConfigCategory.ROOT, name = "hopper_counter", directory = {"carpet"})
|
||||
public class WoolHopperCounterConfig implements IConfigModule {
|
||||
@ConfigInfo(name = "hopperCounters", comments = """
|
||||
Enable the existing wool hopper counter implementation.""")
|
||||
@ConfigInfo(name = "hopperCounters")
|
||||
public static boolean hopperCounters = false;
|
||||
|
||||
@ConfigInfo(name = "hopperCountersUnlimitedSpeed", comments = """
|
||||
Remove the hopper transfer speed limit for counters.
|
||||
Only effective when hopperCounters is enabled.""")
|
||||
@ConfigInfo(name = "hopperCountersUnlimitedSpeed")
|
||||
public static boolean hopperCountersUnlimitedSpeed = false;
|
||||
|
||||
@DoNotLoad
|
||||
|
||||
+6
-17
@@ -7,32 +7,21 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
||||
|
||||
@ConfigClassInfo(category = EnumConfigCategory.EXPERIMENT, name = "command")
|
||||
public class CommandConfig implements IConfigModule {
|
||||
@ConfigInfo(name = "trigger_command_enabled", comments =
|
||||
"""
|
||||
Allow to use trigger command""")
|
||||
@ConfigInfo(name = "trigger_command_enabled")
|
||||
public static boolean trigger = false;
|
||||
|
||||
@ConfigInfo(name = "function_command_enabled", comments =
|
||||
"""
|
||||
Allow to use function command""")
|
||||
@ConfigInfo(name = "function_command_enabled")
|
||||
public static boolean function = false;
|
||||
|
||||
@ConfigInfo(name = "scoreboard_command_enabled", comments =
|
||||
"""
|
||||
Allow to use scoreboard command""")
|
||||
@ConfigInfo(name = "scoreboard_command_enabled")
|
||||
public static boolean scoreboard = false;
|
||||
|
||||
@ConfigInfo(name = "enabled", directory = {"save_all_command"}, comments =
|
||||
"""
|
||||
Allow to use save-all command""")
|
||||
@ConfigInfo(name = "enabled", directory = {"save_all_command"})
|
||||
public static boolean saveAll = false;
|
||||
|
||||
@ConfigInfo(name = "log_all_process", directory = {"save_all_command"}, comments =
|
||||
"""
|
||||
Log all process of save-all command to console""")
|
||||
@ConfigInfo(name = "log_all_process", directory = {"save_all_command"})
|
||||
public static boolean logAllProcess = false;
|
||||
|
||||
@ConfigInfo(name = "save_all_command_timeout", directory = {"save_all_command"}, comments = """
|
||||
Maximum seconds to save before the chunk report it is timeout.""")
|
||||
@ConfigInfo(name = "save_all_command_timeout", directory = {"save_all_command"})
|
||||
public static long saveAllTimeout = 30;
|
||||
}
|
||||
+1
-3
@@ -7,8 +7,6 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
||||
|
||||
@ConfigClassInfo(category = EnumConfigCategory.EXPERIMENT, name = "entity_damage_source_trace")
|
||||
public class EntityDamageSourceTraceConfig implements IConfigModule {
|
||||
@ConfigInfo(name = "enabled", comments =
|
||||
"""
|
||||
Allow trace damage source cross different Region Scheduler.""")
|
||||
@ConfigInfo(name = "enabled")
|
||||
public static boolean enabled = false;
|
||||
}
|
||||
+1
-7
@@ -13,13 +13,7 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
||||
@ConfigClassInfo(name = "global_entities_counter", category = EnumConfigCategory.EXPERIMENT)
|
||||
public class GlobalEntitiesCounter implements IConfigModule {
|
||||
@HotReloadUnsupported
|
||||
@ConfigInfo(name = "version", comments = """
|
||||
DISABLED
|
||||
DEFAULT_SYNC: Enable global entities counter origin version with sync counter module.
|
||||
DEFAULT_ASYNC: Enable global entities counter origin version with async counter module.
|
||||
PRECISE: Enable precise mob cap calculation with incremental counting. Replaces the periodic full-scan with event-driven real-time updates.
|
||||
|
||||
You need to set per-player-mob-spawns to false on paper-world-defaults.yml or paper-world.yml""")
|
||||
@ConfigInfo(name = "version")
|
||||
public static GlobalEntitiesCounterType type = GlobalEntitiesCounterType.DISABLED;
|
||||
|
||||
@DoNotLoad
|
||||
|
||||
+1
-2
@@ -7,7 +7,6 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
||||
|
||||
@ConfigClassInfo(category = EnumConfigCategory.FIXES, name = "update-suppression-crash-fix")
|
||||
public class UpdateSuppressionCrashFixConfig implements IConfigModule {
|
||||
@ConfigInfo(name = "enabled", comments = """
|
||||
Should crash caused by update suppression be prevented?""")
|
||||
@ConfigInfo(name = "enabled")
|
||||
public static boolean enabled = true;
|
||||
}
|
||||
|
||||
+1
-2
@@ -7,7 +7,6 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
||||
|
||||
@ConfigClassInfo(category = EnumConfigCategory.FIXES, name = "vanilla-like-experience")
|
||||
public class VanillaLikeExperienceConfig implements IConfigModule {
|
||||
@ConfigInfo(name = "enabled", comments = """
|
||||
Restore a more vanilla-like technical gameplay experience by bypassing some Paper safety and behavior changes.""")
|
||||
@ConfigInfo(name = "enabled")
|
||||
public static boolean enabled = false;
|
||||
}
|
||||
|
||||
+3
-9
@@ -11,22 +11,16 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
||||
public class ContainerExpansionConfig implements IConfigModule {
|
||||
@HotReloadUnsupported
|
||||
@CommandSuggestions(suggest = {"1", "2", "3", "4", "5", "6"})
|
||||
@ConfigInfo(name = "barrel_rows", comments =
|
||||
"""
|
||||
range: 1~6""")
|
||||
@ConfigInfo(name = "barrel_rows")
|
||||
public static int barrelRows = 3;
|
||||
|
||||
@HotReloadUnsupported
|
||||
@CommandSuggestions(suggest = {"1", "2", "3", "4", "5", "6"})
|
||||
@ConfigInfo(name = "enderchest_rows", comments =
|
||||
"""
|
||||
range: 1~6""")
|
||||
@ConfigInfo(name = "enderchest_rows")
|
||||
public static int enderchestRows = 3;
|
||||
|
||||
@CommandSuggestions(suggest = {"1", "2", "32", "64"})
|
||||
@ConfigInfo(name = "shulker_stackable_count", directory = {"shulker_box"}, comments =
|
||||
"""
|
||||
range: 1~64""")
|
||||
@ConfigInfo(name = "shulker_stackable_count", directory = {"shulker_box"})
|
||||
public static int shulkerCount = 1;
|
||||
|
||||
@ConfigInfo(name = "same_nbt_shulker_stackable", directory = {"shulker_box"})
|
||||
|
||||
+16
-33
@@ -16,69 +16,52 @@ import java.util.Set;
|
||||
|
||||
@ConfigClassInfo(category = EnumConfigCategory.FUNCTION, name = "fakeplayer")
|
||||
public class FakeplayerConfig implements IConfigModule {
|
||||
@ConfigInfo(name = "enable", comments = """
|
||||
Enable fakeplayer functionality (/bot command)""")
|
||||
@ConfigInfo(name = "enable")
|
||||
public static boolean enable = true;
|
||||
|
||||
@ConfigInfo(name = "unable-fakeplayer-names", comments = """
|
||||
List of names that cannot be used for fakeplayers""")
|
||||
@ConfigInfo(name = "unable-fakeplayer-names")
|
||||
public static List<String> unableNames = List.of("player-name");
|
||||
|
||||
@ConfigInfo(name = "limit", comments = """
|
||||
Maximum number of fakeplayers allowed""")
|
||||
@ConfigInfo(name = "limit")
|
||||
public static int limit = 10;
|
||||
|
||||
@ConfigInfo(name = "prefix", comments = """
|
||||
Prefix for fakeplayer names""")
|
||||
@ConfigInfo(name = "prefix")
|
||||
public static String prefix = "";
|
||||
|
||||
@ConfigInfo(name = "suffix", comments = """
|
||||
Suffix for fakeplayer names""")
|
||||
@ConfigInfo(name = "suffix")
|
||||
public static String suffix = "";
|
||||
|
||||
@ConfigInfo(name = "regen-amount", comments = """
|
||||
Regeneration amount for fakeplayers""")
|
||||
@ConfigInfo(name = "regen-amount")
|
||||
public static double regenAmount = 0.0;
|
||||
|
||||
@ConfigInfo(name = "open-action-gui", comments = """
|
||||
Allow opening fakeplayer action gui,
|
||||
need sneak to open if you enabled inventory open gui""")
|
||||
@ConfigInfo(name = "open-action-gui")
|
||||
public static boolean canOpenActionGui = false;
|
||||
|
||||
@ConfigInfo(name = "use-action", comments = """
|
||||
Allow fakeplayers to use actions""")
|
||||
@ConfigInfo(name = "use-action")
|
||||
public static boolean canUseAction = true;
|
||||
|
||||
@ConfigInfo(name = "modify-config", comments = """
|
||||
Allow modifying fakeplayer config""")
|
||||
@ConfigInfo(name = "modify-config")
|
||||
public static boolean canModifyConfig = false;
|
||||
|
||||
@ConfigInfo(name = "manual-save-and-load", comments = """
|
||||
Allow manual save and load of fakeplayers""")
|
||||
@ConfigInfo(name = "manual-save-and-load")
|
||||
public static boolean canManualSaveAndLoad = false;
|
||||
|
||||
@ConfigInfo(name = "cache-skin", comments = """
|
||||
Use skin cache for fakeplayers""")
|
||||
@ConfigInfo(name = "cache-skin")
|
||||
public static boolean useSkinCache = false;
|
||||
|
||||
@ConfigInfo(name = "always-send-data", comments = """
|
||||
Always send data for fakeplayers""")
|
||||
@ConfigInfo(name = "always-send-data")
|
||||
public static boolean canSendDataAlways = true;
|
||||
|
||||
@ConfigInfo(name = "skip-sleep-check", comments = """
|
||||
Skip sleep check for fakeplayers""")
|
||||
@ConfigInfo(name = "skip-sleep-check")
|
||||
public static boolean canSkipSleep = false;
|
||||
|
||||
@ConfigInfo(name = "spawn-phantom", comments = """
|
||||
Allow phantoms to spawn for fakeplayers""")
|
||||
@ConfigInfo(name = "spawn-phantom")
|
||||
public static boolean canSpawnPhantom = false;
|
||||
|
||||
@ConfigInfo(name = "simulation-distance", comments = """
|
||||
Simulation distance for fakeplayers (-1 for default)""")
|
||||
@ConfigInfo(name = "simulation-distance")
|
||||
public static int simulationDistance = -1;
|
||||
|
||||
@ConfigInfo(name = "enable-locator-bar", comments = """
|
||||
Enable locator bar for fakeplayers""")
|
||||
@ConfigInfo(name = "enable-locator-bar")
|
||||
public static boolean enableLocatorBar = false;
|
||||
|
||||
@DoNotLoad
|
||||
|
||||
+5
-11
@@ -9,18 +9,12 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
||||
@ConfigClassInfo(category = EnumConfigCategory.FUNCTION, name = "language")
|
||||
public class LanguageConfig implements IConfigModule {
|
||||
@HotReloadUnsupported
|
||||
@ConfigInfo(name = "lang", comments = """
|
||||
Please use the key from https://minecraft.wiki/w/Language
|
||||
Sample of format: en_us zh_cn zh_hk zh_tw
|
||||
ATTENTION: If you want to edit language for carpet system,
|
||||
please edit it in carpet config file.""")
|
||||
@ConfigInfo(name = "lang")
|
||||
public static String lang = "en_us";
|
||||
|
||||
@ConfigInfo(name = "full_blocking_load", comments = """
|
||||
Whether to allow blocking server loading when loading localized language.
|
||||
If you want only use your localized language to shown in your terminal,
|
||||
you need to enable it.
|
||||
|
||||
WARNING: This may slow down the startup speed!""")
|
||||
@ConfigInfo(name = "full_blocking_load")
|
||||
public static boolean full_blocking_load = false;
|
||||
|
||||
@ConfigInfo(name = "allow_auto_reset_comments")
|
||||
public static boolean allowAutoResetComments = true;
|
||||
}
|
||||
+1
-3
@@ -22,8 +22,6 @@ public class OldFeatureConfig implements IConfigModule {
|
||||
@ConfigInfo(name = "old_raid_behavior")
|
||||
public static boolean oldRaidBehavior = false;
|
||||
|
||||
@ConfigInfo(name = "villager-void-trade", comments =
|
||||
"""
|
||||
Allow villager void trade.""")
|
||||
@ConfigInfo(name = "villager-void-trade")
|
||||
public static boolean villagerVoidTrade = false;
|
||||
}
|
||||
+1
-3
@@ -7,8 +7,6 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
||||
|
||||
@ConfigClassInfo(category = EnumConfigCategory.FUNCTION, name = "redstone")
|
||||
public class RedStoneConfig implements IConfigModule {
|
||||
@ConfigInfo(name = "shears_rotate", comments =
|
||||
"""
|
||||
Allows you to use the Shears to right-click to rotate the block.""")
|
||||
@ConfigInfo(name = "shears_rotate")
|
||||
public static boolean shears = false;
|
||||
}
|
||||
+2
-4
@@ -18,13 +18,11 @@ public class ReplayAPIConfig implements IConfigModule {
|
||||
public static boolean enableCache = true;
|
||||
|
||||
@HotReloadUnsupported
|
||||
@ConfigInfo(name = "cache-photographer-time", comments = """
|
||||
Time to cache photographer profile(in seconds)""")
|
||||
@ConfigInfo(name = "cache-photographer-time")
|
||||
public static int cachePhotographerTime = 3600;
|
||||
|
||||
@HotReloadUnsupported
|
||||
@ConfigInfo(name = "cache-photographer-size", comments = """
|
||||
Maximum size of cache photographer profile""")
|
||||
@ConfigInfo(name = "cache-photographer-size")
|
||||
public static int cachePhotographerSize = 100;
|
||||
|
||||
@Override
|
||||
|
||||
+1
-6
@@ -8,12 +8,7 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
||||
|
||||
@ConfigClassInfo(category = EnumConfigCategory.FUNCTION, name = "alternative_block_placement", directory = {"protocol"})
|
||||
public class AlternativeBlockPlacementProtocolConfig implements IConfigModule {
|
||||
@ConfigInfo(name = "enabled", comments = """
|
||||
Specify the precise placement protocol type
|
||||
NONE Disable precise placement protocol
|
||||
CARPET Precise placement protocol version 2
|
||||
CARPET_FIX Enhanced precise placement protocol version 2 (requires MasaGadget installed on client)
|
||||
LITEMATICA Precise placement protocol version 3""")
|
||||
@ConfigInfo(name = "enabled")
|
||||
public static EnumAlternativePlaceType alternativeBlockPlacement = EnumAlternativePlaceType.NONE;
|
||||
|
||||
public static boolean needIgnoreDistance() {
|
||||
|
||||
+2
-4
@@ -7,10 +7,8 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
||||
|
||||
@ConfigClassInfo(category = EnumConfigCategory.FUNCTION, name = "appleskin", directory = {"protocol"})
|
||||
public class AppleSkinProtocolConfig implements IConfigModule {
|
||||
@ConfigInfo(name = "enabled", comments = """
|
||||
Enable AppleSkin protocol support""")
|
||||
@ConfigInfo(name = "enabled")
|
||||
public static boolean enabled = false;
|
||||
@ConfigInfo(name = "sync-tick-interval", comments = """
|
||||
Set AppleSkin Synchronization Frequency (Unit: Game Ticks)""")
|
||||
@ConfigInfo(name = "sync-tick-interval")
|
||||
public static int syncTickInterval = 20;
|
||||
}
|
||||
|
||||
+1
-2
@@ -7,7 +7,6 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
||||
|
||||
@ConfigClassInfo(category = EnumConfigCategory.FUNCTION, name = "bbor", directory = {"protocol"})
|
||||
public class BBORProtocolConfig implements IConfigModule {
|
||||
@ConfigInfo(name = "enabled", comments = """
|
||||
Enable BBOR protocol support""")
|
||||
@ConfigInfo(name = "enabled")
|
||||
public static boolean enabled = false;
|
||||
}
|
||||
|
||||
+1
-2
@@ -7,7 +7,6 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
||||
|
||||
@ConfigClassInfo(category = EnumConfigCategory.FUNCTION, name = "jade", directory = {"protocol"})
|
||||
public class JadeProtocolConfig implements IConfigModule {
|
||||
@ConfigInfo(name = "enabled", comments = """
|
||||
Enable Jade protocol support""")
|
||||
@ConfigInfo(name = "enabled")
|
||||
public static boolean enabled = false;
|
||||
}
|
||||
|
||||
+2
-14
@@ -1,12 +1,10 @@
|
||||
package fun.bm.lophine.config.modules.function.protocol;
|
||||
|
||||
import com.electronwill.nightconfig.core.file.CommentedFileConfig;
|
||||
import fun.bm.lophine.carpet.CarpetCompatSync;
|
||||
import fun.bm.lophine.enums.PcaPlayerEntityType;
|
||||
import me.earthme.luminol.config.IConfigModule;
|
||||
import me.earthme.luminol.config.flags.ConfigClassInfo;
|
||||
import me.earthme.luminol.config.flags.ConfigInfo;
|
||||
import me.earthme.luminol.config.flags.TransformedConfig;
|
||||
import me.earthme.luminol.enums.EnumConfigCategory;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.leavesmc.leaves.protocol.PcaSyncProtocol;
|
||||
@@ -17,19 +15,10 @@ import java.util.Set;
|
||||
public class PcaSyncProtocolConfig implements IConfigModule {
|
||||
private static boolean lastEnabled = false;
|
||||
|
||||
@TransformedConfig(name = "pca-sync-protocol", directory = {"protocol"})
|
||||
@ConfigInfo(name = "enabled", comments = """
|
||||
Enable PCA sync protocol support""")
|
||||
@ConfigInfo(name = "enabled")
|
||||
public static boolean enabled = false;
|
||||
|
||||
@TransformedConfig(name = "pca-sync-player-entity", directory = {"protocol"})
|
||||
@ConfigInfo(name = "sync-player-entity", comments = """
|
||||
Controls which player entities can be watched through the PCA sync protocol.
|
||||
NOBODY: never sync player entities
|
||||
BOT: only sync Lophine fake players
|
||||
OPS: sync fake players and allow operators to sync real players
|
||||
OPS_AND_SELF: sync fake players, operators, and a player's own entity
|
||||
EVERYONE: allow all player entities""")
|
||||
@ConfigInfo(name = "sync-player-entity")
|
||||
public static PcaPlayerEntityType syncPlayerEntity = PcaPlayerEntityType.OPS;
|
||||
|
||||
@Override
|
||||
@@ -38,6 +27,5 @@ public class PcaSyncProtocolConfig implements IConfigModule {
|
||||
PcaSyncProtocol.onConfigModify(enabled);
|
||||
lastEnabled = enabled;
|
||||
}
|
||||
CarpetCompatSync.apply();
|
||||
}
|
||||
}
|
||||
|
||||
+1
-2
@@ -7,7 +7,6 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
||||
|
||||
@ConfigClassInfo(category = EnumConfigCategory.FUNCTION, name = "rei", directory = {"protocol"})
|
||||
public class REIServerProtocolConfig implements IConfigModule {
|
||||
@ConfigInfo(name = "enabled", comments = """
|
||||
Enable Roughly Enough Items protocol support""")
|
||||
@ConfigInfo(name = "enabled")
|
||||
public static boolean enabled = false;
|
||||
}
|
||||
|
||||
+1
-1
@@ -39,6 +39,6 @@ public class ServuxProtocolConfig implements IConfigModule {
|
||||
public static int litematicsMaxNbtSize = 2097152;
|
||||
|
||||
@CommandSuggestions(suggest = {"-1", "1200"})
|
||||
@ConfigInfo(name = "litematics-print-max-delay-ticks", directory = {"litematics"}, comments = "The max delay ticks for printing litematics, -1 to disable")
|
||||
@ConfigInfo(name = "litematics-print-max-delay-ticks", directory = {"litematics"})
|
||||
public static int maxDelay = 1200;
|
||||
}
|
||||
|
||||
+3
-6
@@ -12,14 +12,11 @@ import java.util.Set;
|
||||
|
||||
@ConfigClassInfo(category = EnumConfigCategory.FUNCTION, name = "syncmatica", directory = {"protocol"})
|
||||
public class SyncmaticaProtocolConfig implements IConfigModule {
|
||||
@ConfigInfo(name = "enabled", comments = """
|
||||
Enable Syncmatica protocol support""")
|
||||
@ConfigInfo(name = "enabled")
|
||||
public static boolean enabled = false;
|
||||
@ConfigInfo(name = "useQuota", comments = """
|
||||
Is there a limit on the size of projection files?""")
|
||||
@ConfigInfo(name = "useQuota")
|
||||
public static boolean useQuota = false;
|
||||
@ConfigInfo(name = "quota-Limit", comments = """
|
||||
Maximum Projection File Size (in bytes)""")
|
||||
@ConfigInfo(name = "quota-Limit")
|
||||
public static int quotaLimit = 40000000;
|
||||
|
||||
public void onLoaded(CommentedFileConfig configInstance, @Nullable Set<Exception> e) {
|
||||
|
||||
+1
-2
@@ -9,8 +9,7 @@ import java.util.Random;
|
||||
|
||||
@ConfigClassInfo(category = EnumConfigCategory.FUNCTION, name = "xaero-map", directory = {"protocol"})
|
||||
public class XaeroMapProtocolConfig implements IConfigModule {
|
||||
@ConfigInfo(name = "enabled", comments = """
|
||||
Enable Xaero World Map Protocol Support""")
|
||||
@ConfigInfo(name = "enabled")
|
||||
public static boolean enabled = false;
|
||||
@ConfigInfo(name = "xaeroMapServerID")
|
||||
public static int xaeroMapServerID = new Random().nextInt();
|
||||
|
||||
+2
-4
@@ -7,11 +7,9 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
||||
|
||||
@ConfigClassInfo(category = EnumConfigCategory.MISC, name = "disable-check")
|
||||
public class DisableCheckConfig implements IConfigModule {
|
||||
@ConfigInfo(name = "disable-op-move-check", comments = """
|
||||
Disable the check for the operator's move check""")
|
||||
@ConfigInfo(name = "disable-op-move-check")
|
||||
public static boolean disableOpMoveCheck = false;
|
||||
|
||||
@ConfigInfo(name = "disable-op-fly-check", comments = """
|
||||
Disable the check for the operator's fly check""")
|
||||
@ConfigInfo(name = "disable-op-fly-check")
|
||||
public static boolean disableOpFlyCheck = false;
|
||||
}
|
||||
|
||||
+1
-5
@@ -7,10 +7,6 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
||||
|
||||
@ConfigClassInfo(category = EnumConfigCategory.MISC, name = "item-entity")
|
||||
public class ItemEntityConfig implements IConfigModule {
|
||||
@ConfigInfo(name = "follow-tick-sequence-merge", comments = """
|
||||
Due to Paper's modification of the merge radius,
|
||||
when the merge radius is large and stacks containing many items get stuck in an unexpected position,
|
||||
individual items may never reach their destination.
|
||||
This configuration option is added to fix this behavior.""")
|
||||
@ConfigInfo(name = "follow-tick-sequence-merge")
|
||||
public static boolean followTickSequenceMerge = false;
|
||||
}
|
||||
|
||||
+1
-3
@@ -7,8 +7,6 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
||||
|
||||
@ConfigClassInfo(category = EnumConfigCategory.REMOVED, name = "removed_config")
|
||||
public class RemovedConfig implements IConfigModule {
|
||||
@ConfigInfo(name = "removed", comments =
|
||||
"""
|
||||
RemovedConfig redirect to here, no any function.""")
|
||||
@ConfigInfo(name = "removed")
|
||||
public static boolean enabled = true;
|
||||
}
|
||||
@@ -109,6 +109,11 @@ public class ServerI18nUtil {
|
||||
}
|
||||
Language.inject(createLangInstance());
|
||||
logger.info("Successfully loaded language: {}", lang);
|
||||
if (LanguageConfig.allowAutoResetComments) {
|
||||
logger.info("Start trying to load localized comments.");
|
||||
ConfigManager.reloadComments();
|
||||
logger.info("Loaded all comments.");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
if (e instanceof MalformedJsonException malformedJson) {
|
||||
malformedJson.clean();
|
||||
@@ -297,6 +302,12 @@ public class ServerI18nUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public static String getLocalizedComment(String key) {
|
||||
String current = Language.getInstance().getOrDefault(key, "");
|
||||
if (!current.isBlank()) return current;
|
||||
return Language.DEFAULT_INSTANCE.getOrDefault(key, "");
|
||||
}
|
||||
|
||||
private static class UnsupportedLanguageException extends Exception {
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import java.util.List;
|
||||
|
||||
public class BarSubcommand extends LiteralNode {
|
||||
public BarSubcommand(EnumBarType barType) {
|
||||
super(barType.getCommandName());
|
||||
super(barType.getName());
|
||||
children(
|
||||
new ToggleCommand(barType),
|
||||
new ConfigEditCommand(barType)
|
||||
|
||||
@@ -152,4 +152,13 @@ public class ConfigManager {
|
||||
toReload.forEach(ConfigsInstance::saveConfigs);
|
||||
needTransformedConfigs.clear(); // free space when all done
|
||||
}
|
||||
|
||||
public static void reloadComments() {
|
||||
CompletableFuture<?>[] futures = configfiles.values().stream()
|
||||
.map(config -> CompletableFuture.runAsync(() -> {
|
||||
config.reload(false, false);
|
||||
}))
|
||||
.toArray(CompletableFuture[]::new);
|
||||
CompletableFuture.allOf(futures).join();
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package me.earthme.luminol.config;
|
||||
import com.electronwill.nightconfig.core.UnmodifiableConfig;
|
||||
import com.electronwill.nightconfig.core.file.CommentedFileConfig;
|
||||
import com.mojang.logging.LogUtils;
|
||||
import fun.bm.lophine.utils.ServerI18nUtil;
|
||||
import io.papermc.paper.threadedregions.RegionizedServer;
|
||||
import me.earthme.luminol.api.config.ConfigDataPair;
|
||||
import me.earthme.luminol.api.config.LuminolConfigsInstance;
|
||||
@@ -150,6 +151,7 @@ public class ConfigsInstance implements LuminolConfigsInstance {
|
||||
// if the config load with exceptions but allowed, remove exceptions from the map
|
||||
allInstanced.replaceAll((_, _) -> null);
|
||||
setupLatch();
|
||||
saveConfigs();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -256,28 +258,12 @@ public class ConfigsInstance implements LuminolConfigsInstance {
|
||||
}
|
||||
}
|
||||
|
||||
loadCategoryComments(); // load base key comment
|
||||
|
||||
allInstanced.putAll(stagedMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load config category comments
|
||||
*/
|
||||
private void loadCategoryComments() {
|
||||
for (EnumConfigCategory category : EnumConfigCategory.values()) {
|
||||
String key = category.getBaseKeyName();
|
||||
if (key == null) continue;
|
||||
String comment = category.getKeyComment();
|
||||
if (comment == null) continue;
|
||||
if (!completeConfigPath(key).isEmpty()) {
|
||||
String comment0 = configFileInstance.getComment(key);
|
||||
if (comment0 == null) {
|
||||
configFileInstance.setComment(key, comment);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Instantiate all configuration modules
|
||||
@@ -303,7 +289,7 @@ public class ConfigsInstance implements LuminolConfigsInstance {
|
||||
// Build configuration path and handle class comments
|
||||
final List<String> category = buildConfigCategoryPath(configClassInfo);
|
||||
final String fullConfigBasePath = String.join(".", category);
|
||||
handleClassLevelComments(configClassInfo, fullConfigBasePath);
|
||||
handleClassLevelComments(fullConfigBasePath, keepComments);
|
||||
|
||||
// Process each field in the module
|
||||
Field[] fields = singleConfigModule.getClass().getDeclaredFields();
|
||||
@@ -340,12 +326,18 @@ public class ConfigsInstance implements LuminolConfigsInstance {
|
||||
/**
|
||||
* Handle class-level comments for configuration
|
||||
*/
|
||||
private void handleClassLevelComments(ConfigClassInfo configClassInfo, String fullConfigBasePath) {
|
||||
final String comment = configFileInstance.getComment(fullConfigBasePath);
|
||||
if (comment == null || comment.isBlank()) {
|
||||
String comments0 = configClassInfo.comments();
|
||||
if (!comments0.isBlank()) {
|
||||
configFileInstance.setComment(fullConfigBasePath, comments0);
|
||||
private void handleClassLevelComments(String fullConfigBasePath, boolean keepComments) {
|
||||
final String existingComment = configFileInstance.getComment(fullConfigBasePath);
|
||||
final String localizedComment = ServerI18nUtil.getLocalizedComment(name + "." + fullConfigBasePath + ".comment");
|
||||
if (!keepComments) {
|
||||
// Force reset to localized default
|
||||
if (!localizedComment.isBlank()) {
|
||||
configFileInstance.setComment(fullConfigBasePath, localizedComment);
|
||||
}
|
||||
} else if (existingComment == null || existingComment.isBlank()) {
|
||||
// Only fill in when blank
|
||||
if (!localizedComment.isBlank()) {
|
||||
configFileInstance.setComment(fullConfigBasePath, localizedComment);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -405,7 +397,7 @@ public class ConfigsInstance implements LuminolConfigsInstance {
|
||||
private void handleMissingOrRemovedConfig(Field field, String fullConfigKeyName,
|
||||
ConfigInfo configInfo, boolean removed) throws IllegalAccessException {
|
||||
// Process transformed configurations
|
||||
processTransformedConfigs(field, fullConfigKeyName, configInfo, removed);
|
||||
processTransformedConfigs(field, fullConfigKeyName, removed);
|
||||
|
||||
// Handle removed configurations
|
||||
if (removed) {
|
||||
@@ -440,7 +432,7 @@ public class ConfigsInstance implements LuminolConfigsInstance {
|
||||
}
|
||||
|
||||
// Add default value with comments
|
||||
final String comments = configInfo.comments();
|
||||
final String comments = ServerI18nUtil.getLocalizedComment(name + "." + fullConfigKeyName + ".comment");
|
||||
if (!comments.isBlank()) {
|
||||
configFileInstance.setComment(fullConfigKeyName, comments);
|
||||
}
|
||||
@@ -451,8 +443,7 @@ public class ConfigsInstance implements LuminolConfigsInstance {
|
||||
/**
|
||||
* Process transformed configurations
|
||||
*/
|
||||
private void processTransformedConfigs(Field field, String fullConfigKeyName,
|
||||
ConfigInfo configInfo, boolean removed) {
|
||||
private void processTransformedConfigs(Field field, String fullConfigKeyName, boolean removed) {
|
||||
for (TransformedConfig transformedConfig : field.getAnnotationsByType(TransformedConfig.class)) {
|
||||
final String oldConfigKeyName = String.join(".", transformedConfig.directory()) + "." + transformedConfig.name();
|
||||
|
||||
@@ -485,7 +476,7 @@ public class ConfigsInstance implements LuminolConfigsInstance {
|
||||
removeConfig(oldConfigKeyName, transformedConfig.directory());
|
||||
}
|
||||
|
||||
final String comments = configInfo.comments();
|
||||
final String comments = ServerI18nUtil.getLocalizedComment(name + "." + fullConfigKeyName + ".comment");
|
||||
if (!comments.isBlank()) {
|
||||
configFileInstance.setComment(fullConfigKeyName, comments);
|
||||
}
|
||||
@@ -526,7 +517,7 @@ public class ConfigsInstance implements LuminolConfigsInstance {
|
||||
|
||||
// Handle comments
|
||||
if (!keepComments) {
|
||||
final String comments = configInfo.comments();
|
||||
final String comments = ServerI18nUtil.getLocalizedComment(name + "." + fullConfigKeyName + ".comment");
|
||||
configFileInstance.setComment(fullConfigKeyName, comments);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,4 @@ public @interface ConfigClassInfo {
|
||||
String name();
|
||||
|
||||
String[] directory() default {};
|
||||
|
||||
String comments() default "";
|
||||
}
|
||||
|
||||
@@ -9,7 +9,5 @@ public @interface ConfigInfo {
|
||||
|
||||
String[] directory() default {};
|
||||
|
||||
String comments() default "";
|
||||
|
||||
boolean allowAutoReset() default true;
|
||||
}
|
||||
+2
-9
@@ -11,16 +11,9 @@ public class CommandConfig implements IConfigModule {
|
||||
@ConfigInfo(name = "enable_data_command")
|
||||
@HotReloadUnsupported
|
||||
public static boolean data = false;
|
||||
@ConfigInfo(name = "enable_command_block", comments = """
|
||||
Force to enable command blocks.
|
||||
ATTENTION: WOULD CAUSE SERVER CRASHING AS SOME THREADING ISSUE!!!
|
||||
DO NOT ENABLE UNLESS YOU KNOW WHAT YOU ARE DOING!!!
|
||||
""")
|
||||
@ConfigInfo(name = "enable_command_block")
|
||||
public static boolean commandBlock = false;
|
||||
@ConfigInfo(name = "enable_waypoints_and_waypoint_command", comments = """
|
||||
Enable waypoint and waypoint command.
|
||||
WARN: Still under testing
|
||||
""")
|
||||
@ConfigInfo(name = "enable_waypoints_and_waypoint_command")
|
||||
@HotReloadUnsupported
|
||||
public static boolean waypointsAndWaypointCommand = false;
|
||||
}
|
||||
|
||||
+1
-6
@@ -7,11 +7,6 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
||||
|
||||
@ConfigClassInfo(category = EnumConfigCategory.EXPERIMENT, name = "disable_async_catchers")
|
||||
public class DisableAsyncCatcherConfig implements IConfigModule {
|
||||
@ConfigInfo(name = "enabled", comments = """
|
||||
Disable async catcher to prevent some crashes caused by some plugins which supports folia but has issuable logics.
|
||||
ATTENTION: Would cause region deadlock when getChunkAt was incorrectly called!
|
||||
See: https://github.com/PaperMC/Folia/issues/280 which is resolved in folia(https://github.com/PaperMC/Folia/commit/2e7bc0721af95196c85500c7bb136aeea0bc12ce)
|
||||
DO NOT ENABLE UNLESS YOU KNOW WHAT YOU ARE DOING!!!
|
||||
""")
|
||||
@ConfigInfo(name = "enabled")
|
||||
public static boolean enabled = false;
|
||||
}
|
||||
+1
-4
@@ -7,9 +7,6 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
||||
|
||||
@ConfigClassInfo(category = EnumConfigCategory.EXPERIMENT, name = "disable_entity_exception_catchers")
|
||||
public class DisableEntityCatchConfig implements IConfigModule {
|
||||
@ConfigInfo(name = "enabled", comments = """
|
||||
If this config enabled, the server will crash directly when entity ticking has some errors instead of removing the entity to keep server running.
|
||||
It could prevent entity disappearing but may cause more server crashes.
|
||||
DO NOT ENABLE UNLESS YOU KNOW WHAT YOU ARE DOING!!!""")
|
||||
@ConfigInfo(name = "enabled")
|
||||
public static boolean enabled = false;
|
||||
}
|
||||
+1
-8
@@ -10,13 +10,6 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
||||
@ConfigClassInfo(category = EnumConfigCategory.FIXES, name = "collision_behavior")
|
||||
public class CollisionBehaviorConfig implements IConfigModule {
|
||||
@CommandSuggestions(suggest = {"VANILLA", "BLOCK_SHAPE_VANILLA", "PAPER"})
|
||||
@ConfigInfo(name = "mode", comments =
|
||||
"""
|
||||
Decides which collision logics will be used(Moonrise and Paper modified this for optimization but would also break some vanilla behaviours at the same time).
|
||||
Would be useful for fixing improper behaviours of some huge redstone machines
|
||||
Available Value:
|
||||
VANILLA
|
||||
BLOCK_SHAPE_VANILLA
|
||||
PAPER""")
|
||||
@ConfigInfo(name = "mode")
|
||||
public static EnumCollisionBehaviorMode behaviorMode = EnumCollisionBehaviorMode.BLOCK_SHAPE_VANILLA;
|
||||
}
|
||||
+1
-7
@@ -7,13 +7,7 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
||||
|
||||
@ConfigClassInfo(category = EnumConfigCategory.FIXES, name = "fix_high_velocity_issue")
|
||||
public class FoliaEntityMovingFixConfig implements IConfigModule {
|
||||
@ConfigInfo(name = "enabled", comments =
|
||||
"""
|
||||
A simple fix of an issue on folia\s
|
||||
(Sometimes the entity would\s
|
||||
have a large moment that cross the\s
|
||||
different tick regions, and it would\s
|
||||
make the server crashed) but sometimes it might doesn't work""")
|
||||
@ConfigInfo(name = "enabled")
|
||||
public static boolean enabled = false;
|
||||
|
||||
@ConfigInfo(name = "warn_on_detected")
|
||||
|
||||
+4
-4
@@ -5,14 +5,14 @@ import me.earthme.luminol.config.flags.ConfigClassInfo;
|
||||
import me.earthme.luminol.config.flags.ConfigInfo;
|
||||
import me.earthme.luminol.enums.EnumConfigCategory;
|
||||
|
||||
@ConfigClassInfo(category = EnumConfigCategory.FIXES, name = "force_cleanup_drop_non_owned_entity_memory_module", comments = "This config is a temporary fix for those incorrect owned data in the memory of each mob, for more you can see https://github.com/PaperMC/Folia/issues/203")
|
||||
@ConfigClassInfo(category = EnumConfigCategory.FIXES, name = "force_cleanup_drop_non_owned_entity_memory_module")
|
||||
public class ForceCleanupEntityBrainMemoryConfig implements IConfigModule {
|
||||
@ConfigInfo(name = "enabled_for_entity", comments = "When enabled, the entity's brain will clean the memory which is typed of entity and not belong to current tickregion")
|
||||
@ConfigInfo(name = "enabled_for_entity")
|
||||
public static boolean enabledForEntity = false;
|
||||
|
||||
@ConfigInfo(name = "enabled_for_block_pos", comments = "When enabled, the entity's brain will clean the memory which is typed of block_pos and not belong to current tickregion")
|
||||
@ConfigInfo(name = "enabled_for_block_pos")
|
||||
public static boolean enabledForBlockPos = false;
|
||||
|
||||
@ConfigInfo(name = "enabled_for_position_tracker", comments = "When enabled, the entity's brain will clean the memory which is typed of position_tracker and not belong to current tickregion")
|
||||
@ConfigInfo(name = "enabled_for_position_tracker")
|
||||
public static boolean enabledForPositionTracker = false;
|
||||
}
|
||||
+1
-3
@@ -7,8 +7,6 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
||||
|
||||
@ConfigClassInfo(category = EnumConfigCategory.FIXES, name = "item_multitask")
|
||||
public class ItemMultitaskConfig implements IConfigModule {
|
||||
@ConfigInfo(name = "enabled", comments = """
|
||||
Prevent the server from interrupting the state of items
|
||||
during block interactions or hotbar slot changes.""")
|
||||
@ConfigInfo(name = "enabled")
|
||||
public static boolean enabled = false;
|
||||
}
|
||||
|
||||
+1
-4
@@ -6,9 +6,6 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
||||
|
||||
@ConfigClassInfo(category = EnumConfigCategory.FIXES, name = "long_command_support")
|
||||
public class LongCommandSupportConfig {
|
||||
@ConfigInfo(name = "enabled", comments = """
|
||||
Some long commands can be run through the dialog command,
|
||||
but paper has prohibited it.
|
||||
Enable this to fix this problem.""")
|
||||
@ConfigInfo(name = "enabled")
|
||||
public static boolean enabled = true;
|
||||
}
|
||||
|
||||
+1
-4
@@ -7,9 +7,6 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
||||
|
||||
@ConfigClassInfo(name = "poi_range_fixes", category = EnumConfigCategory.FIXES)
|
||||
public class POIRangeFixes implements IConfigModule {
|
||||
@ConfigInfo(name = "do_not_compete_poi_if_unloaded", comments = """
|
||||
Do not compete POI if it's unloaded
|
||||
Related with https://github.com/PaperMC/Folia/issues/292
|
||||
""")
|
||||
@ConfigInfo(name = "do_not_compete_poi_if_unloaded")
|
||||
public static boolean doNotCompetePOIIfUnloaded = false;
|
||||
}
|
||||
|
||||
+2
-2
@@ -7,8 +7,8 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
||||
|
||||
@ConfigClassInfo(category = EnumConfigCategory.FIXES, name = "pathfinding_fixes")
|
||||
public class PathfindingFixesConfig implements IConfigModule {
|
||||
@ConfigInfo(name = "break_down_pathfinding_when_out_of_region", comments = "Recompute path or stop pathfinding when it's touching the blocks out of current tick region")
|
||||
@ConfigInfo(name = "break_down_pathfinding_when_out_of_region")
|
||||
public static boolean breakDownPathfindingWhenOutOfRegion = false;
|
||||
@ConfigInfo(name = "do_not_pathfind_to_not_owned_targets", comments = "Skip pathfinding target when it's out of current tick region")
|
||||
@ConfigInfo(name = "do_not_pathfind_to_not_owned_targets")
|
||||
public static boolean doNotPathfindToNotOwnedTargets = false;
|
||||
}
|
||||
|
||||
+1
-4
@@ -7,10 +7,7 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
||||
|
||||
@ConfigClassInfo(category = EnumConfigCategory.FIXES, name = "prevent_incorrect_teleport_async_calls_during_move_event")
|
||||
public class PreventIncorrectTeleportAsyncConfig implements IConfigModule {
|
||||
@ConfigInfo(name = "enabled", comments = """
|
||||
When enabled, the server would reject some incorrect teleportAsync calls during move events.
|
||||
And this will reduce the crashes which caused by plugins(Residence etc.)
|
||||
But you should notice that it might break the compatibility with some plugins.""")
|
||||
@ConfigInfo(name = "enabled")
|
||||
public static boolean enabled = false;
|
||||
|
||||
@ConfigInfo(name = "throw_when_caught")
|
||||
|
||||
+1
-4
@@ -7,9 +7,6 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
||||
|
||||
@ConfigClassInfo(category = EnumConfigCategory.FIXES, name = "allow_unsafe_teleportation")
|
||||
public class UnsafeTeleportationConfig implements IConfigModule {
|
||||
@ConfigInfo(name = "enabled", comments = """
|
||||
Allow non player entities enter end portals if enabled.
|
||||
If you want to use sand duping,please turn on this.
|
||||
Warning: This would cause some unsafe issues, you could learn more on : https://github.com/PaperMC/Folia/issues/297""")
|
||||
@ConfigInfo(name = "enabled")
|
||||
public static boolean enabled = false;
|
||||
}
|
||||
+1
-1
@@ -7,6 +7,6 @@ import me.earthme.luminol.enums.EnumConfigCategory;
|
||||
|
||||
@ConfigClassInfo(category = EnumConfigCategory.FIXES, name = "use_vanilla_random_source")
|
||||
public class VanillaRandomSourceConfig implements IConfigModule {
|
||||
@ConfigInfo(name = "enable_for_player_entity", comments = "Related with RNG cracks")
|
||||
@ConfigInfo(name = "enable_for_player_entity")
|
||||
public static boolean useLegacyRandomSourceForPlayers = false;
|
||||
}
|
||||
+1
-1
@@ -28,7 +28,7 @@ public class MembarConfig implements IConfigModule {
|
||||
public static List<String> memColors = List.of("<gradient:#55ff55:#00aa00><text></gradient>", "<gradient:#ffff55:#ffaa00><text></gradient>", "<gradient:#ff5555:#aa0000><text></gradient>", "<gradient:#55ff55:#00aa00><text></gradient>");
|
||||
@ConfigInfo(name = "update_interval_ticks")
|
||||
public static int updateInterval = 15;
|
||||
@ConfigInfo(name = "display", comments = "Available displays: BOSS_BAR, ACTION_BAR, TAB_LIST")
|
||||
@ConfigInfo(name = "display")
|
||||
public static EnumStatusBarDisplay display = EnumStatusBarDisplay.BOSS_BAR;
|
||||
|
||||
@DoNotLoad
|
||||
|
||||
+3
-15
@@ -12,27 +12,15 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@ConfigClassInfo(name = "portal_rate_limit", category = EnumConfigCategory.FUNCTION)
|
||||
public class PortalRateLimiterConfig implements IConfigModule {
|
||||
@ConfigInfo(name = "enable", comments = "Whether or not to limit the portal rate when entity goes into portals")
|
||||
@ConfigInfo(name = "enable")
|
||||
@HotReloadUnsupported
|
||||
public static boolean enabled = false;
|
||||
|
||||
@ConfigInfo(name = "maximum_portal_teleports_per_tick", comments = """
|
||||
Decides how much portal teleportation should be handled within a tick in a single tick region,when exceed,
|
||||
the portal teleportation will be pushed into the next tick
|
||||
|
||||
Note: set to -1 to use custom expressions""")
|
||||
@ConfigInfo(name = "maximum_portal_teleports_per_tick")
|
||||
@HotReloadUnsupported
|
||||
public static int maxPortalTeleportsPerTick = 200;
|
||||
|
||||
@ConfigInfo(name = "maximum_portal_teleports_per_tick_expression", comments = """
|
||||
If the fixed limit is not enough for use, you could define your own expression to dynamically limit the
|
||||
portal rate.
|
||||
|
||||
Available variables(all is of current tickregion): e (ticking_entity_count)
|
||||
c (ticking_chunk_count)
|
||||
p (player_count)
|
||||
Example: 50 * (1 + sqrt(x/1000) + c/200 + p/5)
|
||||
""")
|
||||
@ConfigInfo(name = "maximum_portal_teleports_per_tick_expression")
|
||||
@HotReloadUnsupported
|
||||
public static String maxPortalTeleportsExpression = "50 * (1 + sqrt(e/1000) + c/200 + p/5)";
|
||||
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ public class RegionBarConfig implements IConfigModule {
|
||||
public static List<String> utilColors = List.of("<gradient:#55ff55:#00aa00><text></gradient>", "<gradient:#ffff55:#ffaa00><text></gradient>", "<gradient:#ff5555:#aa0000><text></gradient>", "<gradient:#55ff55:#00aa00><text></gradient>");
|
||||
@ConfigInfo(name = "update_interval_ticks")
|
||||
public static int updateInterval = 15;
|
||||
@ConfigInfo(name = "display", comments = "Available displays: BOSS_BAR, ACTION_BAR, TAB_LIST")
|
||||
@ConfigInfo(name = "display")
|
||||
public static EnumStatusBarDisplay display = EnumStatusBarDisplay.BOSS_BAR;
|
||||
|
||||
@DoNotLoad
|
||||
|
||||
+7
-7
@@ -19,25 +19,25 @@ import java.util.Set;
|
||||
@ConfigClassInfo(category = EnumConfigCategory.FUNCTION, name = "region_format")
|
||||
public class RegionFormatConfig implements IConfigModule {
|
||||
@HotReloadUnsupported
|
||||
@ConfigInfo(name = "format", allowAutoReset = false, comments = "Available choices: MCA, B_LINEAR, LINEAR_V2")
|
||||
@ConfigInfo(name = "format", allowAutoReset = false)
|
||||
public static EnumRegionFormat regionFormat = EnumRegionFormat.MCA;
|
||||
@HotReloadUnsupported
|
||||
@ConfigInfo(name = "linear_compression_level", comments = "Decides the compression level of the region file(Only works for LINEAR_V2 and B_LINEAR)")
|
||||
@ConfigInfo(name = "linear_compression_level")
|
||||
public static int linearCompressionLevel = 1;
|
||||
@HotReloadUnsupported
|
||||
@ConfigInfo(name = "linear_io_thread_count", comments = "Decides the worker thread count of linear(Only works for LINEAR_V2)")
|
||||
@ConfigInfo(name = "linear_io_thread_count")
|
||||
public static int linearIoThreadCount = 6;
|
||||
@HotReloadUnsupported
|
||||
@ConfigInfo(name = "linear_io_flush_delay_ms", comments = "Decides when it will be flushed to the region file when it has been marked to save for n(default is 100) milliseconds(Only works for LINEAR_V2)")
|
||||
@ConfigInfo(name = "linear_io_flush_delay_ms")
|
||||
public static int linearIoFlushDelayMs = 100;
|
||||
@HotReloadUnsupported
|
||||
@ConfigInfo(name = "blinear_io_flush_delay_ms", comments = "Decides when it will be flushed to the region file when there has been no write operations for n(default is 3000) milliseconds(Only works for B_LINEAR)")
|
||||
@ConfigInfo(name = "blinear_io_flush_delay_ms")
|
||||
public static int blinearIoFlushDelayMs = 3000;
|
||||
@HotReloadUnsupported
|
||||
@ConfigInfo(name = "blinear_io_thread_count", comments = "Decides the worker thread count of buffered linear(Only works for B_LINEAR)")
|
||||
@ConfigInfo(name = "blinear_io_thread_count")
|
||||
public static int blinearIoThreadCount = 6;
|
||||
@HotReloadUnsupported
|
||||
@ConfigInfo(name = "linear_use_virtual_thread", comments = "Decides if it could use virtual threads for linear format(Only works for LINEAR_V2)")
|
||||
@ConfigInfo(name = "linear_use_virtual_thread")
|
||||
public static boolean linearUseVirtualThread = true;
|
||||
|
||||
@DoNotLoad
|
||||
|
||||
+3
-13
@@ -11,25 +11,15 @@ import java.util.Base64;
|
||||
|
||||
@ConfigClassInfo(category = EnumConfigCategory.FUNCTION, name = "secure_seed")
|
||||
public class SecureSeedConfig implements IConfigModule {
|
||||
@ConfigInfo(name = "enabled", comments = """
|
||||
Once you enable secure seed, all ores and structures are generated with 1024-bit seed
|
||||
instead of using 64-bit seed in vanilla, making traditional seed cracking impossible.
|
||||
Note: If you use V1 it will be vulnerable to terrain elevation attacks.
|
||||
***** WARN: You need keep it enabled if your old world are also using secure seed! Or it will kill your save *****""")
|
||||
@ConfigInfo(name = "enabled")
|
||||
@HotReloadUnsupported
|
||||
public static boolean enabled = false;
|
||||
|
||||
@ConfigInfo(name = "version", comments = """
|
||||
Version 1: Blake2b (insecure, reversible with a GPU/ASIC cluster in minutes with enough entropy)
|
||||
Version 2: Blake3 with salt key derivation (recommended, irreversible)
|
||||
***** WARN: Switching versions will cause chunk errors! *****""")
|
||||
@ConfigInfo(name = "version")
|
||||
@HotReloadUnsupported
|
||||
public static int version = 1;
|
||||
|
||||
@ConfigInfo(name = "salt", comments = """
|
||||
Auto-generated 256-bit salt for V2 cryptographic operations.
|
||||
Generated once on first startup - DO NOT SHARE THIS OR MODIFY (MODIFYING THIS WILL CAUSE CHUNK ERRORS)!
|
||||
Used with Blake3 keyed hash to make seed irreversible.""")
|
||||
@ConfigInfo(name = "salt")
|
||||
@HotReloadUnsupported
|
||||
public static String salt = generateSalt();
|
||||
|
||||
|
||||
+3
-3
@@ -32,11 +32,11 @@ public class TpsBarConfig implements IConfigModule {
|
||||
public static List<String> chunkHotColors = List.of("<gradient:#55ff55:#00aa00><text></gradient>", "<gradient:#ffff55:#ffaa00><text></gradient>", "<gradient:#ff5555:#aa0000><text></gradient>", "<gradient:#55ff55:#00aa00><text></gradient>");
|
||||
@ConfigInfo(name = "update_interval_ticks")
|
||||
public static int updateInterval = 15;
|
||||
@ConfigInfo(name = "precision_of_tps_value", comments = "Example(if tps is 20.00000000)(value -> result): 2 -> 20.00, 1 -> 20.0")
|
||||
@ConfigInfo(name = "precision_of_tps_value")
|
||||
public static int precisionOfTPS = 2;
|
||||
@ConfigInfo(name = "precision_of_mspt_value", comments = "Example(if mspt is 20.00000000)(value -> result): 2 -> 20.00, 1 -> 20.0")
|
||||
@ConfigInfo(name = "precision_of_mspt_value")
|
||||
public static int precisionOfMSPT = 2;
|
||||
@ConfigInfo(name = "display", comments = "Available displays: BOSS_BAR, ACTION_BAR, TAB_LIST")
|
||||
@ConfigInfo(name = "display")
|
||||
public static EnumStatusBarDisplay display = EnumStatusBarDisplay.BOSS_BAR;
|
||||
|
||||
@DoNotLoad
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user