Port to 26.1

This commit is contained in:
skippyall
2026-04-29 17:20:13 +02:00
parent f5202a4264
commit e117139a63
100 changed files with 609 additions and 550 deletions
@@ -6,10 +6,11 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.mojang.brigadier.suggestion.Suggestions;
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
import io.github.skippyall.minions.docs.DocsManager;
import java.util.concurrent.CompletableFuture;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.arguments.ResourceLocationArgument;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.commands.arguments.IdentifierArgument;
import net.minecraft.resources.Identifier;
import java.util.concurrent.CompletableFuture;
import static net.minecraft.commands.Commands.argument;
import static net.minecraft.commands.Commands.literal;
@@ -17,7 +18,7 @@ import static net.minecraft.commands.Commands.literal;
public class DocsSubcommand {
public static final LiteralArgumentBuilder<CommandSourceStack> DOCS = literal("docs")
.then(
argument("docName", ResourceLocationArgument.id())
argument("docName", IdentifierArgument.id())
.suggests(DocsSubcommand::getSuggestions)
.executes(DocsSubcommand::execute)
);
@@ -28,7 +29,7 @@ public class DocsSubcommand {
}
public static int execute(CommandContext<CommandSourceStack> context) throws CommandSyntaxException {
ResourceLocation id = ResourceLocationArgument.getId(context, "docName");
Identifier id = IdentifierArgument.getId(context, "docName");
DocsManager.showDocsEntry(context.getSource().getPlayerOrException(), id);
return 1;
}
@@ -4,10 +4,11 @@ import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.context.CommandContext;
import io.github.skippyall.minions.minion.MinionData;
import io.github.skippyall.minions.minion.MinionPersistentState;
import java.util.Collection;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.network.chat.Component;
import java.util.Collection;
import static net.minecraft.commands.Commands.literal;
public class ListSubcommand {
@@ -9,13 +9,14 @@ import io.github.skippyall.minions.minion.fakeplayer.MinionFakePlayer;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.arguments.coordinates.Coordinates;
import net.minecraft.commands.arguments.coordinates.Vec3Argument;
import net.minecraft.server.permissions.Permissions;
import static net.minecraft.commands.Commands.argument;
import static net.minecraft.commands.Commands.literal;
public class SpawnSubcommand {
public static final LiteralArgumentBuilder<CommandSourceStack> SPAWN = literal("spawn")
.requires(source -> source.hasPermission(2))
.requires(source -> source.permissions().hasPermission(Permissions.COMMANDS_GAMEMASTER))
.then(argument("minion", StringArgumentType.word())
.suggests(MinionArgument.SUGGESTION_PROVIDER)
.then(argument("pos", Vec3Argument.vec3())
@@ -3,8 +3,6 @@ package io.github.skippyall.minions.command;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.context.CommandContext;
import io.github.skippyall.minions.Minions;
import java.util.Collection;
import java.util.HashSet;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.arguments.coordinates.BlockPosArgument;
import net.minecraft.core.BlockPos;
@@ -13,6 +11,9 @@ import net.minecraft.network.chat.Component;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Blocks;
import java.util.Collection;
import java.util.HashSet;
import static net.minecraft.commands.Commands.argument;
import static net.minecraft.commands.Commands.literal;