This commit is contained in:
gnembon committed 2023-11-16 20:52:10 +01:00
1 parent 687591c5d5
commit df017bb122
4 files changed
+35 -32

No files matched your search

@@ -106,7 +106,7 @@ import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.storage.loot.LootDataType;
import net.minecraft.world.phys.Vec2;
import net.minecraft.world.scores.Scoreboard;
import net.minecraft.world.scores.ScoreHolder;
import javax.annotation.Nullable;
@@ -778,10 +778,10 @@ public abstract class CommandArgument
@Override
protected Value getValueFromContext(CommandContext<CommandSourceStack> context, String param) throws CommandSyntaxException
{
Collection<String> holders = ScoreHolderArgument.getNames(context, param);
Collection<ScoreHolder> holders = ScoreHolderArgument.getNames(context, param);
if (!single)
{
return ListValue.wrap(holders.stream().map(StringValue::of));
return ListValue.wrap(holders.stream().map(ValueConversions::of));
}
int size = holders.size();
if (size == 0)
@@ -790,7 +790,7 @@ public abstract class CommandArgument
}
if (size == 1)
{
return StringValue.of(holders.iterator().next());
return ValueConversions.of(holders.iterator().next());
}
throw new SimpleCommandExceptionType(Component.literal("Multiple score holders returned while only one was requested" + " for custom type " + suffix)).create();
}