registerLuauPlugin method
- String name,
- String code, {
- ItemLocation? location,
- String? storageKey,
Implementation
Future<SetonixPlugin> registerLuauPlugin(
String name,
String code, {
ItemLocation? location,
String? storageKey,
}) {
if (!_nativeEnabled) throw Exception('Native not enabled');
return registerPlugin(
name,
(pluginServer) => RustSetonixPlugin.build(
(c) => LuauPlugin(code: code, callback: c),
pluginServer,
onPrint: (e) => server.print(e, name),
location: location ?? ItemLocation.fromString(name),
storageKey: storageKey ?? name,
),
);
}