Expose HexColor argument type (#12833)

This commit is contained in:
caramel
2025-07-13 00:41:21 +09:00
committed by GitHub
parent 76fb5060c1
commit fcfc6c3fe8
3 changed files with 20 additions and 0 deletions

View File

@@ -39,6 +39,7 @@ import net.kyori.adventure.key.Key;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.format.Style;
import net.kyori.adventure.text.format.TextColor;
import net.minecraft.advancements.critereon.MinMaxBounds;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.arguments.ColorArgument;
@@ -49,6 +50,7 @@ import net.minecraft.commands.arguments.EntityArgument;
import net.minecraft.commands.arguments.GameModeArgument;
import net.minecraft.commands.arguments.GameProfileArgument;
import net.minecraft.commands.arguments.HeightmapTypeArgument;
import net.minecraft.commands.arguments.HexColorArgument;
import net.minecraft.commands.arguments.MessageArgument;
import net.minecraft.commands.arguments.ObjectiveCriteriaArgument;
import net.minecraft.commands.arguments.RangeArgument;
@@ -205,6 +207,11 @@ public class VanillaArgumentProviderImpl implements VanillaArgumentProvider {
);
}
@Override
public ArgumentType<TextColor> hexColor() {
return this.wrap(HexColorArgument.hexColor(), TextColor::color);
}
@Override
public ArgumentType<Component> component() {
return this.wrap(ComponentArgument.textComponent(PaperCommands.INSTANCE.getBuildContext()), PaperAdventure::asAdventure);