- 构建:Loom 1.18-SNAPSHOT、Gradle 9.7.1、official 映射 & - 依赖:carpet 26.1+v260401、fabric-api 0.155.3+26.1.2、fabric-permissions-api 0.7.0 & - 源码:~30 文件 + 28 mixin 从 Yarn 迁移到 Mojang official 映射 & - accessWidener 改为 official 命名空间 & - 适配新 API:Component/ChatFormatting/CommandSourceStack/Commands/ResourceKey/ & ServerLevel/ServerPlayer/Abilities/CraftingRemainingItem/PermissionSet/ValueInput-Output 等 & - 部分功能(elytraCraftable/datapack 注入/offlineFakePlayers)按新 API 近似重写,待实机验证
This commit is contained in:
1 parent
a1a2103f47
commit
8e44aaa780
36 files changed
+521
-576
No files matched your search
@@ -12,9 +12,9 @@ import com.mojang.brigadier.CommandDispatcher;
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.fabricmc.loader.api.Version;
|
||||
import net.minecraft.command.CommandRegistryAccess;
|
||||
import net.minecraft.commands.CommandBuildContext;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.command.ServerCommandSource;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -29,7 +29,7 @@ public class ServerMain implements ModInitializer, CarpetExtension {
|
||||
public static final Version MOD_VERSION = FabricLoader.getInstance().getModContainer(MOD_ID).get().getMetadata().getVersion();
|
||||
|
||||
public static final Logger LOGGER = LogManager.getLogger(MOD_ID);
|
||||
static final Gson GSON = new GsonBuilder().setLenient().create(); // 使用宽容模式,避免部分开发者在书写JSON时不遵守RFC 4627规范
|
||||
static final Gson GSON = new GsonBuilder().setLenient().create();
|
||||
|
||||
public static ServerMain INSTANCE;
|
||||
public static MinecraftServer server;
|
||||
@@ -74,9 +74,9 @@ public class ServerMain implements ModInitializer, CarpetExtension {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCommands(CommandDispatcher<ServerCommandSource> dispatcher, CommandRegistryAccess commandBuildContext) {
|
||||
public void registerCommands(CommandDispatcher<CommandSourceStack> dispatcher, CommandBuildContext commandBuildContext) {
|
||||
HatCommand.register(dispatcher);
|
||||
SitCommand.register(dispatcher);
|
||||
BotCommand.register(dispatcher);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user