Minor bug fixes

This commit is contained in:
Kenzie Togami
2019-04-28 17:27:33 -07:00
parent 32d4b36419
commit 6255ccce38
6 changed files with 27 additions and 17 deletions

View File

@ -84,6 +84,7 @@ public class ApplyBrushCommands {
builder.addParts(REGION_FACTORY, RADIUS);
builder.addPart(SubCommandPart.builder(TranslatableComponent.of("type"), TextComponent.of("Type of brush to use"))
.withCommands(manager.getAllCommands().collect(Collectors.toList()))
.required()
.build());
});
}

View File

@ -89,6 +89,7 @@ public class PaintBrushCommands {
builder.addParts(REGION_FACTORY, RADIUS, DENSITY);
builder.addPart(SubCommandPart.builder(TranslatableComponent.of("type"), TextComponent.of("Type of brush to use"))
.withCommands(manager.getAllCommands().collect(Collectors.toList()))
.required()
.build());
});
}

View File

@ -36,6 +36,7 @@ import com.sk89q.worldedit.world.World;
import org.enginehub.piston.CommandManager;
import org.enginehub.piston.converter.ArgumentConverter;
import org.enginehub.piston.converter.ConversionResult;
import org.enginehub.piston.converter.FailedConversion;
import org.enginehub.piston.converter.SuccessfulConversion;
import org.enginehub.piston.inject.InjectedValueAccess;
import org.enginehub.piston.inject.Key;
@ -86,7 +87,7 @@ public class FactoryConverter<T> implements ArgumentConverter<T> {
factoryExtractor.apply(worldEdit).parseFromInput(argument, parserContext)
);
} catch (InputParseException e) {
throw new IllegalArgumentException(e);
return FailedConversion.from(e);
}
}