mcvm_plugin 0.5.0

Plugin loading and definition for mcvm
Documentation
use mcvm_plugin::api::CustomPlugin;
use mcvm_shared::output::{MCVMOutput, MessageContents, MessageLevel};

fn main() -> anyhow::Result<()> {
	let mut plugin = CustomPlugin::new("print_custom_config")?;
	plugin.on_load(|mut ctx, _| {
		if let Some(custom_config) = ctx.get_custom_config().map(String::from) {
			ctx.get_output().display(
				MessageContents::Property(
					"Config".into(),
					Box::new(MessageContents::Simple(custom_config)),
				),
				MessageLevel::Important,
			);
		}
		Ok(())
	})?;

	Ok(())
}