diff --git a/brigadier/common/src/main/java/team/unnamed/commandflow/brigadier/CommandBrigadierConverter.java b/brigadier/common/src/main/java/team/unnamed/commandflow/brigadier/CommandBrigadierConverter.java index 0dfb1ff5..96ed65e1 100644 --- a/brigadier/common/src/main/java/team/unnamed/commandflow/brigadier/CommandBrigadierConverter.java +++ b/brigadier/common/src/main/java/team/unnamed/commandflow/brigadier/CommandBrigadierConverter.java @@ -214,7 +214,7 @@ private boolean isFirstPartOptional(CommandPart part) { private CommandNode toArgumentBuilder(ArgumentPart part) { - return commandNodeMappings.getMapping(part.getClass()) + return commandNodeMappings.getMappingByClass(part.getClass()) .map(map -> map.convert(part)) .orElseGet(() -> new GeneralMapping<>(senderMapping).convert(part)); diff --git a/brigadier/common/src/main/java/team/unnamed/commandflow/brigadier/mappings/BrigadierCommandNodeMappings.java b/brigadier/common/src/main/java/team/unnamed/commandflow/brigadier/mappings/BrigadierCommandNodeMappings.java index 6437b4cc..d18670b8 100644 --- a/brigadier/common/src/main/java/team/unnamed/commandflow/brigadier/mappings/BrigadierCommandNodeMappings.java +++ b/brigadier/common/src/main/java/team/unnamed/commandflow/brigadier/mappings/BrigadierCommandNodeMappings.java @@ -22,8 +22,8 @@ public interface BrigadierCommandNodeMappings { * @param type The type to get a conversion mapping for. * @return A {@link CommandNodeMapping}, if it exists, suitable for converting a {@linkplain team.unnamed.commandflow.part.ArgumentPart} of the specified type. */ - default Optional> getMapping(Class type) { - return getMapping((Type) type); + default Optional> getMappingByClass(Class type) { + return getMapping(type); } /** @@ -43,11 +43,11 @@ default Optional> getMapping(Class type) { static BrigadierCommandNodeMappings.Builder defaultMappings() { return BrigadierCommandNodeMappings.builder() - .addMapping(BooleanPart.class, new BooleanMapping<>()) - .addMapping(DoublePart.class, new DoubleMapping<>()) - .addMapping(IntegerPart.class, new IntegerMapping<>()) - .addMapping(LongPart.class, new LongMapping<>()) - .addMapping(StringPart.class, new StringMapping<>()); + .addMappingByClass(BooleanPart.class, new BooleanMapping<>()) + .addMappingByClass(DoublePart.class, new DoubleMapping<>()) + .addMappingByClass(IntegerPart.class, new IntegerMapping<>()) + .addMappingByClass(LongPart.class, new LongMapping<>()) + .addMappingByClass(StringPart.class, new StringMapping<>()); } @@ -56,7 +56,7 @@ static Builder builder() { } interface Builder { - default Builder addMapping(Class type, CommandNodeMapping mapping) { + default Builder addMappingByClass(Class type, CommandNodeMapping mapping) { return addMapping(type, mapping); }