Configured
This commit is contained in:
@@ -24,7 +24,7 @@ public class MinionArgument {
|
||||
|
||||
public static MinionData parse(MinecraftServer server, String argument) throws CommandSyntaxException {
|
||||
Optional<MinionData> data = Optional.empty();
|
||||
if(argument.startsWith(MinionProfileUtils.PREFIX)) {
|
||||
if(argument.startsWith(MinionProfileUtils.getPrefix())) {
|
||||
data = MinionPersistentState.get(server).getMinionWithName(argument);
|
||||
} else {
|
||||
try {
|
||||
|
||||
@@ -1,19 +1,26 @@
|
||||
package io.github.skippyall.minions.command;
|
||||
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import io.github.skippyall.minions.MinionsConfig;
|
||||
import net.minecraft.command.CommandRegistryAccess;
|
||||
import net.minecraft.server.command.CommandManager;
|
||||
import net.minecraft.server.command.ServerCommandSource;
|
||||
|
||||
import static net.minecraft.server.command.CommandManager.literal;
|
||||
|
||||
public class MinionsCommand {
|
||||
public static void register(CommandDispatcher<ServerCommandSource> dispatcher) {
|
||||
public static void register(CommandDispatcher<ServerCommandSource> dispatcher, CommandRegistryAccess access, CommandManager.RegistrationEnvironment environment) {
|
||||
LiteralArgumentBuilder<ServerCommandSource> builder = literal("minions")
|
||||
.then(SpawnSubcommand.SPAWN)
|
||||
.then(ListSubcommand.LIST);
|
||||
|
||||
if(MinionsConfig.get().minion.enableMobCapHacks) {
|
||||
builder.then(MobCapDebugSubcommand.MOB_CAP_DEBUG);
|
||||
}
|
||||
|
||||
dispatcher.register(
|
||||
literal("minions")
|
||||
.then(SpawnSubcommand.SPAWN)
|
||||
.then(MobCapDebugSubcommand.MOB_CAP_DEBUG)
|
||||
.then(ListSubcommand.LIST)
|
||||
builder
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package io.github.skippyall.minions.command;
|
||||
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import com.mojang.brigadier.context.CommandContext;
|
||||
import io.github.skippyall.minions.mixinhelper.ChunkLevelManager$DistanceFromNearestPlayerTrackerAccessor;
|
||||
import io.github.skippyall.minions.mixinhelper.ChunkLevelManagerAccessor;
|
||||
import io.github.skippyall.minions.mixinhelper.antimobcap.ChunkLevelManager$DistanceFromNearestPlayerTrackerAccessor;
|
||||
import io.github.skippyall.minions.mixinhelper.antimobcap.ChunkLevelManagerAccessor;
|
||||
import io.github.skippyall.minions.mixins.antimobcap.ServerChunkManagerAccessor;
|
||||
import net.minecraft.server.command.ServerCommandSource;
|
||||
import net.minecraft.server.world.ChunkLevelManager;
|
||||
|
||||
Reference in New Issue
Block a user