feat: 复刻1.12遗留漏洞机制(旧版分类)
build / build (push) Has been cancelled

新增[旧版]Carpet分类及7条规则,完整复刻1.12获取非法方块所需机制:

- legacyInstantFall/legacyInstantTick:等价1.12的瞬间下落/计划刻立即执行

- legacyAsyncChunkAccess:自建后台线程模拟1.12信标线程并发访问区块

- legacyChunkSwap:hook getVisibleChunkIfPresent,异步线程伪装区块未加载触发装饰

- legacyFallingBlockReplace/legacyFallingBlockTarget:拦截fall的state参数实现落沙替换

参考1.12源码(MCP反编译)+Earthcomputer/Myren的原理讲解实现。
This commit is contained in:
AxTps committed 2026-10-04 17:06:20 +08:00
1 parent d6eb433f65
commit ff742f0274
11 files changed
+449 -3

No files matched your search

@@ -51,6 +51,34 @@ public class ServerMain implements ModInitializer, CarpetExtension {
@Override
public void onServerLoaded(MinecraftServer server) {
ServerMain.server = server;
startLegacyRuleWatcher();
}
/** [旧版] 轮询规则状态,按需启停异步 chunk 线程。 */
private void startLegacyRuleWatcher() {
Thread watcher = new Thread(() -> {
boolean running = false;
while (!Thread.currentThread().isInterrupted()) {
try {
boolean want = SLSCarpetSettings.legacyExploitMode
&& SLSCarpetSettings.legacyAsyncChunkAccess;
if (want && !running) {
com.github.zly2006.carpetslsaddition.util.LegacyAsyncExecutor.start();
running = true;
} else if (!want && running) {
com.github.zly2006.carpetslsaddition.util.LegacyAsyncExecutor.stop();
running = false;
}
Thread.sleep(1000L);
} catch (InterruptedException e) {
return;
} catch (Throwable t) {
LOGGER.debug("[SLSA] legacy rule watcher error: {}", t.toString());
}
}
}, "SLSA-Legacy-RuleWatcher");
watcher.setDaemon(true);
watcher.start();
}
@Override