Initial commit: Dimensional Ripper mod source (NeoForge 1.21.1)

This commit is contained in:
xxdd001 committed 2026-08-26 21:04:16 +08:00
1 parent df32c72cc9
commit 453e715f3b
94 files changed
+7059

No files matched your search

@@ -0,0 +1,24 @@
package dev.modzuozhi.mixin;
import dev.modzuozhi.core.dimthread.ChunkPrefetcher;
import net.minecraft.server.level.ServerPlayer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
/**
* 阶段 A(步骤 0):挂载区块预取到玩家 tick。
* <p>
* 玩家实体 tick 只由主线程 {@code playerList.tick()} → {@code ServerPlayer.doTick()} 驱动
* (维度 worker 已跳过玩家 tick,见 {@link EntityTickParallelMixin}),因此本注入天然运行在
* 主线程,与维度并行无冲突。预取逻辑本身是纯增益、全 try/catch,任何异常都不影响玩家。
*/
@Mixin(ServerPlayer.class)
public abstract class ServerPlayerPrefetchMixin {
@Inject(method = "doTick", at = @At("HEAD"))
private void modzuozhi_prefetchChunks(CallbackInfo ci) {
ChunkPrefetcher.onPlayerTick((ServerPlayer) (Object) this);
}
}