registerLuauPlugin method

Future<SetonixPlugin> registerLuauPlugin(
  1. String name,
  2. String code, {
  3. ItemLocation? location,
  4. 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,
    ),
  );
}