This commit is contained in:
gnembon committed 2025-07-31 01:57:08 +02:00
1 parent 49840619f5
commit 134d839625
18 files changed
+56 -44

No files matched your search

@@ -102,6 +102,7 @@ import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.commands.BossBarCommands;
import net.minecraft.server.commands.LootCommand;
import net.minecraft.server.players.NameAndId;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.phys.Vec2;
@@ -718,10 +719,10 @@ public abstract class CommandArgument
@Override
protected Value getValueFromContext(CommandContext<CommandSourceStack> context, String param) throws CommandSyntaxException
{
Collection<GameProfile> profiles = GameProfileArgument.getGameProfiles(context, param);
Collection<NameAndId> profiles = GameProfileArgument.getGameProfiles(context, param);
if (!single)
{
return ListValue.wrap(profiles.stream().map(p -> StringValue.of(p.getName())));
return ListValue.wrap(profiles.stream().map(p -> StringValue.of(p.name())));
}
int size = profiles.size();
if (size == 0)
@@ -730,7 +731,7 @@ public abstract class CommandArgument
}
if (size == 1)
{
return StringValue.of(profiles.iterator().next().getName());
return StringValue.of(profiles.iterator().next().name());
}
throw new SimpleCommandExceptionType(Component.literal("Multiple game profiles returned while only one was requested" + " for custom type " + suffix)).create();
}