Skip to content

Commit

Permalink
fix: Actually fix the transitive dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
FixedDev committed Jan 4, 2024
1 parent a887d40 commit ed1fdb4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ private boolean isFirstPartOptional(CommandPart part) {

private CommandNode<T> toArgumentBuilder(ArgumentPart part) {

return commandNodeMappings.getMapping(part.getClass())
return commandNodeMappings.getMappingByClass(part.getClass())
.map(map -> map.convert(part))
.orElseGet(() -> new GeneralMapping<>(senderMapping).convert(part));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public interface BrigadierCommandNodeMappings<T> {
* @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<CommandNodeMapping<T>> getMapping(Class<?> type) {
return getMapping((Type) type);
default Optional<CommandNodeMapping<T>> getMappingByClass(Class<?> type) {
return getMapping(type);
}

/**
Expand All @@ -43,11 +43,11 @@ default Optional<CommandNodeMapping<T>> getMapping(Class<?> type) {

static <T> BrigadierCommandNodeMappings.Builder<T> defaultMappings() {
return BrigadierCommandNodeMappings.<T>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<>());
}


Expand All @@ -56,7 +56,7 @@ static <T> Builder<T> builder() {
}

interface Builder<T> {
default Builder<T> addMapping(Class<?> type, CommandNodeMapping<T> mapping) {
default Builder<T> addMappingByClass(Class<?> type, CommandNodeMapping<T> mapping) {
return addMapping(type, mapping);
}

Expand Down

0 comments on commit ed1fdb4

Please sign in to comment.