This commit is contained in:
Zoë
2022-07-14 19:50:25 -07:00
parent 04c6363469
commit 1003304fde
45 changed files with 189 additions and 221 deletions
@@ -1,34 +1,30 @@
package com.dfsek.terra.lifecycle;
import cloud.commandframework.execution.CommandExecutionCoordinator;
import cloud.commandframework.fabric.FabricServerCommandManager;
import com.dfsek.terra.api.command.CommandSender;
import com.dfsek.terra.api.event.events.platform.CommandRegistrationEvent;
import com.dfsek.terra.mod.MinecraftAddon;
import net.minecraft.server.command.ServerCommandSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.dfsek.terra.api.command.CommandSender;
import com.dfsek.terra.api.event.events.platform.CommandRegistrationEvent;
public class LifecycleEntryPoint {
private static final Logger logger = LoggerFactory.getLogger(LifecycleEntryPoint.class);
protected static void initialize(String modName, LifecyclePlatform platform) {
logger.info("Initializing Terra {} mod...", modName);
FabricServerCommandManager<CommandSender> manager = new FabricServerCommandManager<>(
CommandExecutionCoordinator.simpleCoordinator(),
serverCommandSource -> (CommandSender) serverCommandSource,
commandSender -> (ServerCommandSource) commandSender
);
manager.brigadierManager().setNativeNumberSuggestions(false);
platform.getEventManager().callEvent(new CommandRegistrationEvent(manager));
}
}
@@ -80,9 +80,9 @@ public abstract class LifecyclePlatform extends ModPlatform {
LOGGER.warn("Failed to parse Minecraft version", e);
}
}
addons.addAll(getPlatformMods());
return addons;
}
@@ -9,7 +9,7 @@ import com.dfsek.terra.mod.util.BiomeUtil;
public final class LifecycleUtil {
private LifecycleUtil() {
}
public static void initialize() {