pumpkin-api-cs/src/gen/Plugin.cs
Alexander Medvedev 1ff1774b1c first commit
2026-04-29 12:57:22 +02:00

1893 lines
120 KiB
C#

// Generated by `wit-bindgen` 0.57.1. DO NOT EDIT!
// <auto-generated />
#nullable enable
using System;
using System.Runtime.InteropServices;
using System.Collections.Concurrent;
using System.Threading;
using System.Threading.Tasks;
namespace PluginWorld {
public interface IPluginWorldImports{
}
public interface IPluginWorldExports{
static abstract void InitPlugin();
static abstract void OnLoad(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IContextImports.Context context);
static abstract void OnUnload(global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IContextImports.Context context);
static abstract global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event HandleEvent(uint eventId, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IServerImports.Server server, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event @event);
static abstract int HandleCommand(uint commandId, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.CommandSender sender, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IServerImports.Server server, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.ConsumedArgs args);
static abstract void HandleTask(uint handlerId, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IServerImports.Server server);
}
public readonly struct None {}
[global::System.Runtime.InteropServices.StructLayoutAttribute(global::System.Runtime.InteropServices.LayoutKind.Sequential)]
public readonly struct Result<TOk, TErr>
{
public readonly byte Tag;
private readonly object value;
private Result(byte tag, object value)
{
Tag = tag;
this.value = value;
}
public static Result<TOk, TErr> Ok(TOk ok)
{
return new Result<TOk, TErr>(Tags.Ok, ok!);
}
public static Result<TOk, TErr> Err(TErr err)
{
return new Result<TOk, TErr>(Tags.Err, err!);
}
public bool IsOk => Tag == Tags.Ok;
public bool IsErr => Tag == Tags.Err;
public TOk AsOk
{
get
{
if (Tag == Tags.Ok)
{
return (TOk)value;
}
throw new global::System.ArgumentException("expected k, got " + Tag);
}
}
public TErr AsErr
{
get
{
if (Tag == Tags.Err)
{
return (TErr)value;
}
throw new global::System.ArgumentException("expected Err, got " + Tag);
}
}
public class Tags
{
public const byte Ok = 0;
public const byte Err = 1;
}
}
public class Option<T> {
private static Option<T> none = new ();
private Option()
{
HasValue = false;
}
public Option(T v)
{
HasValue = true;
Value = v;
}
public static Option<T> None => none;
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute(true, nameof(Value))]
public bool HasValue { get; }
public T? Value { get; }
}
public class WitException: global::System.Exception {
public object Value { get; }
public uint NestingLevel { get; }
public WitException(object v, uint level)
{
Value = v;
NestingLevel = level;
}
}
public class WitException<T>: WitException {
public T TypedValue { get { return (T)this.Value;} }
public WitException(T v, uint level) : base(v!, level)
{
}
}
public static class InteropReturnArea
{
[global::System.Runtime.CompilerServices.InlineArrayAttribute(9)]
[global::System.Runtime.InteropServices.StructLayoutAttribute(global::System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 8)]
internal struct ReturnArea
{
private ulong buffer;
internal unsafe nint AddressOfReturnArea()
{
return (nint)global::System.Runtime.CompilerServices.Unsafe.AsPointer(ref buffer);
}
}
[global::System.ThreadStaticAttribute]
[global::System.Runtime.CompilerServices.FixedAddressValueTypeAttribute]
internal static ReturnArea returnArea = default;
}
public static class MemoryHelper
{
public static unsafe void* AlignStackPtr(void* stackAddress, uint alignment)
{
return (void*)(((nint)stackAddress) + ((int)alignment - 1) & -(int)alignment);
}
}
namespace Imports {
public partial class PluginWorldImportsInterop : IPluginWorldImports
{}
}
namespace Exports {
public static class PluginWorldInterop
{
[global::System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute(EntryPoint = "init-plugin")]
public static unsafe void wasmExportInitPlugin() {
PluginWorldExportsImpl.InitPlugin();
}
[global::System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute(EntryPoint = "on-load")]
public static unsafe nint wasmExportOnLoad(int p0) {
var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IContextImports.Context(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IContextImports.Context.THandle(p0));
Result<None, string> ret;
try
{
PluginWorldExportsImpl.OnLoad((resource));
ret = Result<None, string>.Ok(new None());
}
catch (WitException e)
{
switch (e.NestingLevel)
{
case 0:
{
ret = Result<None, string>.Err((string) e.Value);
break;
}
default: throw new global::System.ArgumentException($"invalid nesting level: {e.NestingLevel}");
}
}
var ptr = InteropReturnArea.returnArea.AddressOfReturnArea();
switch (ret.Tag) {
case 0: {
*(byte*)(ptr + 0) = (byte)0;
break;
}
case 1: {
string payload2 = ret.AsErr;
*(byte*)(ptr + 0) = (byte)1;
var stringSpan = global::System.MemoryExtensions.AsSpan(payload2);
var length = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan);
var strPtr = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length);
global::System.Text.Encoding.UTF8.GetBytes(stringSpan, new global::System.Span<byte>(strPtr, length));
new global::System.Span<int>((void*)((byte*)ptr + 8), 1)[0] = length;
new global::System.Span<nint>((void*)((byte*)ptr + 4), 1)[0] = (nint)(int)strPtr;
break;
}
default: throw new global::System.ArgumentException("invalid discriminant: " + ret);
}
return ptr;
}
[global::System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute(EntryPoint = "cabi_post_on-load")]
public static unsafe void cabi_post_wasmExportOnLoad(nint p0) {
switch (new global::System.Span<byte>((byte*)p0 + 0, 1)[0]) {
case 0: {
break;
}
case 1: {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 4), 1)[0]);
break;
}
}
}
[global::System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute(EntryPoint = "on-unload")]
public static unsafe nint wasmExportOnUnload(int p0) {
var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IContextImports.Context(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IContextImports.Context.THandle(p0));
Result<None, string> ret;
try
{
PluginWorldExportsImpl.OnUnload((resource));
ret = Result<None, string>.Ok(new None());
}
catch (WitException e)
{
switch (e.NestingLevel)
{
case 0:
{
ret = Result<None, string>.Err((string) e.Value);
break;
}
default: throw new global::System.ArgumentException($"invalid nesting level: {e.NestingLevel}");
}
}
var ptr = InteropReturnArea.returnArea.AddressOfReturnArea();
switch (ret.Tag) {
case 0: {
*(byte*)(ptr + 0) = (byte)0;
break;
}
case 1: {
string payload2 = ret.AsErr;
*(byte*)(ptr + 0) = (byte)1;
var stringSpan = global::System.MemoryExtensions.AsSpan(payload2);
var length = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan);
var strPtr = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length);
global::System.Text.Encoding.UTF8.GetBytes(stringSpan, new global::System.Span<byte>(strPtr, length));
new global::System.Span<int>((void*)((byte*)ptr + 8), 1)[0] = length;
new global::System.Span<nint>((void*)((byte*)ptr + 4), 1)[0] = (nint)(int)strPtr;
break;
}
default: throw new global::System.ArgumentException("invalid discriminant: " + ret);
}
return ptr;
}
[global::System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute(EntryPoint = "cabi_post_on-unload")]
public static unsafe void cabi_post_wasmExportOnUnload(nint p0) {
switch (new global::System.Span<byte>((byte*)p0 + 0, 1)[0]) {
case 0: {
break;
}
case 1: {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 4), 1)[0]);
break;
}
}
}
[global::System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute(EntryPoint = "handle-event")]
public static unsafe nint wasmExportHandleEvent(nint p0) {
var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IServerImports.Server(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IServerImports.Server.THandle(new global::System.Span<int>((void*)((byte*)p0 + 4), 1)[0]));
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event lifted159;
switch (new global::System.Span<byte>((byte*)p0 + 8, 1)[0]) {
case 0: {
var resource0 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span<int>((void*)((byte*)p0 + 16), 1)[0]));
var resource1 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent.THandle(new global::System.Span<int>((void*)((byte*)p0 + 20), 1)[0]));
lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerJoinEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerJoinEventData (
resource0, resource1, (new global::System.Span<byte>((byte*)p0 + 24, 1)[0] != 0)));
break;
}
case 1: {
var resource4 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span<int>((void*)((byte*)p0 + 16), 1)[0]));
var resource5 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent.THandle(new global::System.Span<int>((void*)((byte*)p0 + 20), 1)[0]));
lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerLeaveEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerLeaveEventData (
resource4, resource5, (new global::System.Span<byte>((byte*)p0 + 24, 1)[0] != 0)));
break;
}
case 2: {
var resource8 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span<int>((void*)((byte*)p0 + 16), 1)[0]));
var resource9 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent.THandle(new global::System.Span<int>((void*)((byte*)p0 + 20), 1)[0]));
lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerLoginEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerLoginEventData (
resource8, resource9, (new global::System.Span<byte>((byte*)p0 + 24, 1)[0] != 0)));
break;
}
case 3: {
var resource12 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span<int>((void*)((byte*)p0 + 16), 1)[0]));
var str = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span<nint>((void*)((byte*)p0 + 20), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 24), 1)[0]);
if (new global::System.Span<int>((void*)((byte*)p0 + 24), 1)[0] > 0) {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 20), 1)[0]);
}
var array = new global::System.Collections.Generic.List<global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player>(new global::System.Span<int>((void*)((byte*)p0 + 32), 1)[0]);
for (int index = 0; index < new global::System.Span<int>((void*)((byte*)p0 + 32), 1)[0]; ++index) {
nint basePtr14 = new global::System.Span<nint>((void*)((byte*)p0 + 28), 1)[0] + (index * 4);
var resource15 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span<int>((void*)((byte*)basePtr14 + 0), 1)[0]));
array.Add(resource15);
}
if (new global::System.Span<int>((void*)((byte*)p0 + 32), 1)[0] > 0) {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 28), 1)[0]);
}
lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerChatEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerChatEventData (
resource12, str, array, (new global::System.Span<byte>((byte*)p0 + 36, 1)[0] != 0)));
break;
}
case 4: {
var resource18 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span<int>((void*)((byte*)p0 + 16), 1)[0]));
var str19 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span<nint>((void*)((byte*)p0 + 20), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 24), 1)[0]);
if (new global::System.Span<int>((void*)((byte*)p0 + 24), 1)[0] > 0) {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 20), 1)[0]);
}
lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerCommandSendEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerCommandSendEventData (
resource18, str19, (new global::System.Span<byte>((byte*)p0 + 28, 1)[0] != 0)));
break;
}
case 5: {
var resource22 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span<int>((void*)((byte*)p0 + 16), 1)[0]));
var str23 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span<nint>((void*)((byte*)p0 + 20), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 24), 1)[0]);
if (new global::System.Span<int>((void*)((byte*)p0 + 24), 1)[0] > 0) {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 20), 1)[0]);
}
lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerPermissionCheckEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerPermissionCheckEventData (
resource22, str23, (new global::System.Span<byte>((byte*)p0 + 28, 1)[0] != 0)));
break;
}
case 6: {
var resource26 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span<int>((void*)((byte*)p0 + 16), 1)[0]));
lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerMoveEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerMoveEventData (
resource26, (new global::System.Span<double>((void*)((byte*)p0 + 24), 1)[0], new global::System.Span<double>((void*)((byte*)p0 + 32), 1)[0], new global::System.Span<double>((void*)((byte*)p0 + 40), 1)[0]), (new global::System.Span<double>((void*)((byte*)p0 + 48), 1)[0], new global::System.Span<double>((void*)((byte*)p0 + 56), 1)[0], new global::System.Span<double>((void*)((byte*)p0 + 64), 1)[0]), (new global::System.Span<byte>((byte*)p0 + 72, 1)[0] != 0)));
break;
}
case 7: {
var resource29 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span<int>((void*)((byte*)p0 + 16), 1)[0]));
lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerTeleportEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerTeleportEventData (
resource29, (new global::System.Span<double>((void*)((byte*)p0 + 24), 1)[0], new global::System.Span<double>((void*)((byte*)p0 + 32), 1)[0], new global::System.Span<double>((void*)((byte*)p0 + 40), 1)[0]), (new global::System.Span<double>((void*)((byte*)p0 + 48), 1)[0], new global::System.Span<double>((void*)((byte*)p0 + 56), 1)[0], new global::System.Span<double>((void*)((byte*)p0 + 64), 1)[0]), (new global::System.Span<byte>((byte*)p0 + 72, 1)[0] != 0)));
break;
}
case 8: {
var resource32 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span<int>((void*)((byte*)p0 + 16), 1)[0]));
var resource33 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World.THandle(new global::System.Span<int>((void*)((byte*)p0 + 20), 1)[0]));
var resource34 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World.THandle(new global::System.Span<int>((void*)((byte*)p0 + 24), 1)[0]));
lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerChangeWorldEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerChangeWorldEventData (
resource32, resource33, resource34, (new global::System.Span<double>((void*)((byte*)p0 + 32), 1)[0], new global::System.Span<double>((void*)((byte*)p0 + 40), 1)[0], new global::System.Span<double>((void*)((byte*)p0 + 48), 1)[0]), new global::System.Span<float>((void*)((byte*)p0 + 56), 1)[0], new global::System.Span<float>((void*)((byte*)p0 + 60), 1)[0], (new global::System.Span<byte>((byte*)p0 + 64, 1)[0] != 0)));
break;
}
case 9: {
var resource37 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span<int>((void*)((byte*)p0 + 16), 1)[0]));
lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerExpChangeEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerExpChangeEventData (
resource37, new global::System.Span<int>((void*)((byte*)p0 + 20), 1)[0]));
break;
}
case 10: {
var resource40 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span<int>((void*)((byte*)p0 + 16), 1)[0]));
lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerItemHeldEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerItemHeldEventData (
resource40, ((byte)new global::System.Span<byte>((byte*)p0 + 20, 1)[0]), ((byte)new global::System.Span<byte>((byte*)p0 + 21, 1)[0]), (new global::System.Span<byte>((byte*)p0 + 22, 1)[0] != 0)));
break;
}
case 11: {
var resource43 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span<int>((void*)((byte*)p0 + 16), 1)[0]));
lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerChangedMainHandEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerChangedMainHandEventData (
resource43, (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.Hand)new global::System.Span<byte>((byte*)p0 + 20, 1)[0]));
break;
}
case 12: {
var resource46 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span<int>((void*)((byte*)p0 + 16), 1)[0]));
lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerGamemodeChangeEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerGamemodeChangeEventData (
resource46, (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.GameMode)new global::System.Span<byte>((byte*)p0 + 20, 1)[0], (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.GameMode)new global::System.Span<byte>((byte*)p0 + 21, 1)[0], (new global::System.Span<byte>((byte*)p0 + 22, 1)[0] != 0)));
break;
}
case 13: {
var resource49 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span<int>((void*)((byte*)p0 + 16), 1)[0]));
var str50 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span<nint>((void*)((byte*)p0 + 20), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 24), 1)[0]);
if (new global::System.Span<int>((void*)((byte*)p0 + 24), 1)[0] > 0) {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 20), 1)[0]);
}
var array51 = new byte[new global::System.Span<int>((void*)((byte*)p0 + 32), 1)[0]];
new global::System.Span<byte>((void*)(new global::System.Span<nint>((void*)((byte*)p0 + 28), 1)[0]), new global::System.Span<int>((void*)((byte*)p0 + 32), 1)[0]).CopyTo(new global::System.Span<byte>(array51));
if (new global::System.Span<int>((void*)((byte*)p0 + 32), 1)[0] > 0) {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 28), 1)[0]);
}
lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerCustomPayloadEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerCustomPayloadEventData (
resource49, str50, array51));
break;
}
case 14: {
var resource54 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span<int>((void*)((byte*)p0 + 16), 1)[0]));
string? lifted;
switch (new global::System.Span<byte>((byte*)p0 + 20, 1)[0]) {
case 0: {
lifted = null;
break;
}
case 1: {
var str59 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span<nint>((void*)((byte*)p0 + 24), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 28), 1)[0]);
if (new global::System.Span<int>((void*)((byte*)p0 + 28), 1)[0] > 0) {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 24), 1)[0]);
}
lifted = str59;
break;
}
default: throw new global::System.ArgumentException("invalid discriminant: " + (new global::System.Span<byte>((byte*)p0 + 20, 1)[0]));
}
var str60 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span<nint>((void*)((byte*)p0 + 32), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 36), 1)[0]);
if (new global::System.Span<int>((void*)((byte*)p0 + 36), 1)[0] > 0) {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 32), 1)[0]);
}
var str61 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span<nint>((void*)((byte*)p0 + 40), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 44), 1)[0]);
if (new global::System.Span<int>((void*)((byte*)p0 + 44), 1)[0] > 0) {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 40), 1)[0]);
}
lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerFishEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerFishEventData (
resource54, lifted, str60, str61, (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerFishState)new global::System.Span<byte>((byte*)p0 + 48, 1)[0], (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.Hand)new global::System.Span<byte>((byte*)p0 + 49, 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 52), 1)[0], (new global::System.Span<byte>((byte*)p0 + 56, 1)[0] != 0)));
break;
}
case 15: {
var resource64 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span<int>((void*)((byte*)p0 + 16), 1)[0]));
var str65 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span<nint>((void*)((byte*)p0 + 20), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 24), 1)[0]);
if (new global::System.Span<int>((void*)((byte*)p0 + 24), 1)[0] > 0) {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 20), 1)[0]);
}
var str66 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span<nint>((void*)((byte*)p0 + 32), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 36), 1)[0]);
if (new global::System.Span<int>((void*)((byte*)p0 + 36), 1)[0] > 0) {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 32), 1)[0]);
}
lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerEggThrowEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerEggThrowEventData (
resource64, str65, (new global::System.Span<byte>((byte*)p0 + 28, 1)[0] != 0), ((byte)new global::System.Span<byte>((byte*)p0 + 29, 1)[0]), str66, (new global::System.Span<byte>((byte*)p0 + 40, 1)[0] != 0)));
break;
}
case 16: {
var resource69 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span<int>((void*)((byte*)p0 + 16), 1)[0]));
lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerInteractUnknownEntityEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerInteractUnknownEntityEventData (
resource69, new global::System.Span<int>((void*)((byte*)p0 + 20), 1)[0], (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.EntityInteractionAction)new global::System.Span<byte>((byte*)p0 + 24, 1)[0], (new global::System.Span<byte>((byte*)p0 + 25, 1)[0] != 0)));
break;
}
case 17: {
var resource72 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span<int>((void*)((byte*)p0 + 16), 1)[0]));
(int, int, int)? lifted77;
switch (new global::System.Span<byte>((byte*)p0 + 24, 1)[0]) {
case 0: {
lifted77 = null;
break;
}
case 1: {
lifted77 = (new global::System.Span<int>((void*)((byte*)p0 + 28), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 32), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 36), 1)[0]);
break;
}
default: throw new global::System.ArgumentException("invalid discriminant: " + (new global::System.Span<byte>((byte*)p0 + 24, 1)[0]));
}
var str78 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span<nint>((void*)((byte*)p0 + 40), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 44), 1)[0]);
if (new global::System.Span<int>((void*)((byte*)p0 + 44), 1)[0] > 0) {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 40), 1)[0]);
}
lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerInteractEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerInteractEventData (
resource72, (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.InteractAction)new global::System.Span<byte>((byte*)p0 + 20, 1)[0], lifted77, str78, (new global::System.Span<byte>((byte*)p0 + 48, 1)[0] != 0)));
break;
}
case 18: {
var resource81 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span<int>((void*)((byte*)p0 + 16), 1)[0]));
lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerToggleSneakEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerToggleSneakEventData (
resource81, (new global::System.Span<byte>((byte*)p0 + 20, 1)[0] != 0), (new global::System.Span<byte>((byte*)p0 + 21, 1)[0] != 0)));
break;
}
case 19: {
var resource84 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span<int>((void*)((byte*)p0 + 16), 1)[0]));
lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerToggleFlightEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerToggleFlightEventData (
resource84, (new global::System.Span<byte>((byte*)p0 + 20, 1)[0] != 0), (new global::System.Span<byte>((byte*)p0 + 21, 1)[0] != 0)));
break;
}
case 20: {
var resource87 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span<int>((void*)((byte*)p0 + 16), 1)[0]));
lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.PlayerToggleSprintEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerToggleSprintEventData (
resource87, (new global::System.Span<byte>((byte*)p0 + 20, 1)[0] != 0), (new global::System.Span<byte>((byte*)p0 + 21, 1)[0] != 0)));
break;
}
case 21: {
var resource90 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span<int>((void*)((byte*)p0 + 16), 1)[0]));
string? lifted96;
switch (new global::System.Span<byte>((byte*)p0 + 20, 1)[0]) {
case 0: {
lifted96 = null;
break;
}
case 1: {
var str95 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span<nint>((void*)((byte*)p0 + 24), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 28), 1)[0]);
if (new global::System.Span<int>((void*)((byte*)p0 + 28), 1)[0] > 0) {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 24), 1)[0]);
}
lifted96 = str95;
break;
}
default: throw new global::System.ArgumentException("invalid discriminant: " + (new global::System.Span<byte>((byte*)p0 + 20, 1)[0]));
}
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.ItemStack? lifted102;
switch (new global::System.Span<byte>((byte*)p0 + 40, 1)[0]) {
case 0: {
lifted102 = null;
break;
}
case 1: {
var str101 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span<nint>((void*)((byte*)p0 + 44), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 48), 1)[0]);
if (new global::System.Span<int>((void*)((byte*)p0 + 48), 1)[0] > 0) {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 44), 1)[0]);
}
lifted102 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.ItemStack (
str101, ((byte)new global::System.Span<byte>((byte*)p0 + 52, 1)[0]));
break;
}
default: throw new global::System.ArgumentException("invalid discriminant: " + (new global::System.Span<byte>((byte*)p0 + 40, 1)[0]));
}
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.ItemStack? lifted108;
switch (new global::System.Span<byte>((byte*)p0 + 56, 1)[0]) {
case 0: {
lifted108 = null;
break;
}
case 1: {
var str107 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span<nint>((void*)((byte*)p0 + 60), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 64), 1)[0]);
if (new global::System.Span<int>((void*)((byte*)p0 + 64), 1)[0] > 0) {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 60), 1)[0]);
}
lifted108 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.ItemStack (
str107, ((byte)new global::System.Span<byte>((byte*)p0 + 68, 1)[0]));
break;
}
default: throw new global::System.ArgumentException("invalid discriminant: " + (new global::System.Span<byte>((byte*)p0 + 56, 1)[0]));
}
lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.InventoryClickEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.InventoryClickEventData (
resource90, lifted96, (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.ClickType)new global::System.Span<byte>((byte*)p0 + 32, 1)[0], ((short)new global::System.Span<short>((void*)((byte*)p0 + 34), 1)[0]), ((short)new global::System.Span<short>((void*)((byte*)p0 + 36), 1)[0]), lifted102, lifted108, new global::System.Span<int>((void*)((byte*)p0 + 72), 1)[0], (new global::System.Span<byte>((byte*)p0 + 76, 1)[0] != 0)));
break;
}
case 22: {
var resource111 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span<int>((void*)((byte*)p0 + 16), 1)[0]));
string? lifted117;
switch (new global::System.Span<byte>((byte*)p0 + 20, 1)[0]) {
case 0: {
lifted117 = null;
break;
}
case 1: {
var str116 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span<nint>((void*)((byte*)p0 + 24), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 28), 1)[0]);
if (new global::System.Span<int>((void*)((byte*)p0 + 28), 1)[0] > 0) {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 24), 1)[0]);
}
lifted117 = str116;
break;
}
default: throw new global::System.ArgumentException("invalid discriminant: " + (new global::System.Span<byte>((byte*)p0 + 20, 1)[0]));
}
lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.InventoryCloseEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.InventoryCloseEventData (
resource111, lifted117));
break;
}
case 23: {
var resource120 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World.THandle(new global::System.Span<int>((void*)((byte*)p0 + 16), 1)[0]));
lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.BlockRedstoneEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.BlockRedstoneEventData (
resource120, ((ushort)new global::System.Span<ushort>((void*)((byte*)p0 + 20), 1)[0]), (new global::System.Span<int>((void*)((byte*)p0 + 24), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 28), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 32), 1)[0]), new global::System.Span<int>((void*)((byte*)p0 + 36), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 40), 1)[0], (new global::System.Span<byte>((byte*)p0 + 44, 1)[0] != 0)));
break;
}
case 24: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player? lifted128;
switch (new global::System.Span<byte>((byte*)p0 + 16, 1)[0]) {
case 0: {
lifted128 = null;
break;
}
case 1: {
var resource127 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span<int>((void*)((byte*)p0 + 20), 1)[0]));
lifted128 = resource127;
break;
}
default: throw new global::System.ArgumentException("invalid discriminant: " + (new global::System.Span<byte>((byte*)p0 + 16, 1)[0]));
}
var str129 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span<nint>((void*)((byte*)p0 + 24), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 28), 1)[0]);
if (new global::System.Span<int>((void*)((byte*)p0 + 28), 1)[0] > 0) {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 24), 1)[0]);
}
lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.BlockBreakEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.BlockBreakEventData (
lifted128, str129, (new global::System.Span<int>((void*)((byte*)p0 + 32), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 36), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 40), 1)[0]), unchecked((uint)(new global::System.Span<int>((void*)((byte*)p0 + 44), 1)[0])), (new global::System.Span<byte>((byte*)p0 + 48, 1)[0] != 0), (new global::System.Span<byte>((byte*)p0 + 49, 1)[0] != 0)));
break;
}
case 25: {
var str132 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span<nint>((void*)((byte*)p0 + 16), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 20), 1)[0]);
if (new global::System.Span<int>((void*)((byte*)p0 + 20), 1)[0] > 0) {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 16), 1)[0]);
}
var str133 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span<nint>((void*)((byte*)p0 + 24), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 28), 1)[0]);
if (new global::System.Span<int>((void*)((byte*)p0 + 28), 1)[0] > 0) {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 24), 1)[0]);
}
lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.BlockBurnEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.BlockBurnEventData (
str132, str133, (new global::System.Span<byte>((byte*)p0 + 32, 1)[0] != 0)));
break;
}
case 26: {
var str136 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span<nint>((void*)((byte*)p0 + 16), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 20), 1)[0]);
if (new global::System.Span<int>((void*)((byte*)p0 + 20), 1)[0] > 0) {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 16), 1)[0]);
}
var resource137 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span<int>((void*)((byte*)p0 + 28), 1)[0]));
var str138 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span<nint>((void*)((byte*)p0 + 32), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 36), 1)[0]);
if (new global::System.Span<int>((void*)((byte*)p0 + 36), 1)[0] > 0) {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 32), 1)[0]);
}
lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.BlockCanBuildEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.BlockCanBuildEventData (
str136, (new global::System.Span<byte>((byte*)p0 + 24, 1)[0] != 0), resource137, str138, (new global::System.Span<byte>((byte*)p0 + 40, 1)[0] != 0)));
break;
}
case 27: {
var resource141 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World.THandle(new global::System.Span<int>((void*)((byte*)p0 + 16), 1)[0]));
var str142 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span<nint>((void*)((byte*)p0 + 20), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 24), 1)[0]);
if (new global::System.Span<int>((void*)((byte*)p0 + 24), 1)[0] > 0) {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 20), 1)[0]);
}
var str143 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span<nint>((void*)((byte*)p0 + 32), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 36), 1)[0]);
if (new global::System.Span<int>((void*)((byte*)p0 + 36), 1)[0] > 0) {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 32), 1)[0]);
}
lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.BlockGrowEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.BlockGrowEventData (
resource141, str142, ((ushort)new global::System.Span<ushort>((void*)((byte*)p0 + 28), 1)[0]), str143, ((ushort)new global::System.Span<ushort>((void*)((byte*)p0 + 40), 1)[0]), (new global::System.Span<int>((void*)((byte*)p0 + 44), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 48), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 52), 1)[0]), (new global::System.Span<byte>((byte*)p0 + 56, 1)[0] != 0)));
break;
}
case 28: {
var resource146 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player.THandle(new global::System.Span<int>((void*)((byte*)p0 + 16), 1)[0]));
var str147 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span<nint>((void*)((byte*)p0 + 20), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 24), 1)[0]);
if (new global::System.Span<int>((void*)((byte*)p0 + 24), 1)[0] > 0) {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 20), 1)[0]);
}
var str148 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span<nint>((void*)((byte*)p0 + 28), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 32), 1)[0]);
if (new global::System.Span<int>((void*)((byte*)p0 + 32), 1)[0] > 0) {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 28), 1)[0]);
}
lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.BlockPlaceEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.BlockPlaceEventData (
resource146, str147, str148, (new global::System.Span<int>((void*)((byte*)p0 + 36), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 40), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 44), 1)[0]), (new global::System.Span<byte>((byte*)p0 + 48, 1)[0] != 0), (new global::System.Span<byte>((byte*)p0 + 49, 1)[0] != 0)));
break;
}
case 29: {
var str151 = global::System.Text.Encoding.UTF8.GetString((byte*)new global::System.Span<nint>((void*)((byte*)p0 + 16), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 20), 1)[0]);
if (new global::System.Span<int>((void*)((byte*)p0 + 20), 1)[0] > 0) {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 16), 1)[0]);
}
lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.ServerCommandEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.ServerCommandEventData (
str151, (new global::System.Span<byte>((byte*)p0 + 24, 1)[0] != 0)));
break;
}
case 30: {
var resource154 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IWorldImports.World.THandle(new global::System.Span<int>((void*)((byte*)p0 + 16), 1)[0]));
lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.SpawnChangeEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.SpawnChangeEventData (
resource154, (new global::System.Span<int>((void*)((byte*)p0 + 20), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 24), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 28), 1)[0]), new global::System.Span<float>((void*)((byte*)p0 + 32), 1)[0], new global::System.Span<float>((void*)((byte*)p0 + 36), 1)[0], (new global::System.Span<int>((void*)((byte*)p0 + 40), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 44), 1)[0], new global::System.Span<int>((void*)((byte*)p0 + 48), 1)[0]), new global::System.Span<float>((void*)((byte*)p0 + 52), 1)[0], new global::System.Span<float>((void*)((byte*)p0 + 56), 1)[0]));
break;
}
case 31: {
var resource157 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent.THandle(new global::System.Span<int>((void*)((byte*)p0 + 16), 1)[0]));
var resource158 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent.THandle(new global::System.Span<int>((void*)((byte*)p0 + 20), 1)[0]));
lifted159 = global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event.ServerBroadcastEvent(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.ServerBroadcastEventData (
resource157, resource158, (new global::System.Span<byte>((byte*)p0 + 24, 1)[0] != 0)));
break;
}
default: throw new global::System.ArgumentException("invalid discriminant:" + new global::System.Span<byte>((byte*)p0 + 8, 1)[0]);
}
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.Event ret;
ret = PluginWorldExportsImpl.HandleEvent((unchecked((uint)(new global::System.Span<int>((void*)((byte*)p0 + 0), 1)[0]))), (resource), (lifted159));
global::System.Runtime.InteropServices.NativeMemory.Free((void*)p0);
var ptr = InteropReturnArea.returnArea.AddressOfReturnArea();
switch (ret.Tag) {
case 0: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerJoinEventData payload = ret.AsPlayerJoinEvent;
*(byte*)(ptr + 0) = (byte)0;
var handle = payload.player.Handle;
payload.player.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 8), 1)[0] = handle;
var handle162 = payload.joinMessage.Handle;
payload.joinMessage.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 12), 1)[0] = handle162;
*(byte*)(ptr + 16) = (byte)(payload.cancelled ? 1 : 0);
break;
}
case 1: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerLeaveEventData payload165 = ret.AsPlayerLeaveEvent;
*(byte*)(ptr + 0) = (byte)1;
var handle166 = payload165.player.Handle;
payload165.player.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 8), 1)[0] = handle166;
var handle167 = payload165.leaveMessage.Handle;
payload165.leaveMessage.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 12), 1)[0] = handle167;
*(byte*)(ptr + 16) = (byte)(payload165.cancelled ? 1 : 0);
break;
}
case 2: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerLoginEventData payload170 = ret.AsPlayerLoginEvent;
*(byte*)(ptr + 0) = (byte)2;
var handle171 = payload170.player.Handle;
payload170.player.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 8), 1)[0] = handle171;
var handle172 = payload170.kickMessage.Handle;
payload170.kickMessage.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 12), 1)[0] = handle172;
*(byte*)(ptr + 16) = (byte)(payload170.cancelled ? 1 : 0);
break;
}
case 3: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerChatEventData payload175 = ret.AsPlayerChatEvent;
*(byte*)(ptr + 0) = (byte)3;
var handle176 = payload175.player.Handle;
payload175.player.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 8), 1)[0] = handle176;
var stringSpan = global::System.MemoryExtensions.AsSpan(payload175.message);
var length = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan);
var strPtr = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length);
global::System.Text.Encoding.UTF8.GetBytes(stringSpan, new global::System.Span<byte>(strPtr, length));
new global::System.Span<int>((void*)((byte*)ptr + 16), 1)[0] = length;
new global::System.Span<nint>((void*)((byte*)ptr + 12), 1)[0] = (nint)(int)strPtr;
var bufferSize = 4 * (nuint)payload175.recipients.Count;
void* address = global::System.Runtime.InteropServices.NativeMemory.AlignedAlloc(bufferSize, 4);
for (int index180 = 0; index180 < payload175.recipients.Count; ++index180) {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player element177 = payload175.recipients[index180];
int basePtr178 = (int)address + (index180 * 4);
var handle179 = element177.Handle;
element177.Handle = 0;
new global::System.Span<int>((void*)((byte*)basePtr178 + 0), 1)[0] = handle179;
}
new global::System.Span<int>((void*)((byte*)ptr + 24), 1)[0] = payload175.recipients.Count;
new global::System.Span<nint>((void*)((byte*)ptr + 20), 1)[0] = (nint)(int)address;
*(byte*)(ptr + 28) = (byte)(payload175.cancelled ? 1 : 0);
break;
}
case 4: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerCommandSendEventData payload183 = ret.AsPlayerCommandSendEvent;
*(byte*)(ptr + 0) = (byte)4;
var handle184 = payload183.player.Handle;
payload183.player.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 8), 1)[0] = handle184;
var stringSpan189 = global::System.MemoryExtensions.AsSpan(payload183.command);
var length187 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan189);
var strPtr185 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length187);
global::System.Text.Encoding.UTF8.GetBytes(stringSpan189, new global::System.Span<byte>(strPtr185, length187));
new global::System.Span<int>((void*)((byte*)ptr + 16), 1)[0] = length187;
new global::System.Span<nint>((void*)((byte*)ptr + 12), 1)[0] = (nint)(int)strPtr185;
*(byte*)(ptr + 20) = (byte)(payload183.cancelled ? 1 : 0);
break;
}
case 5: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerPermissionCheckEventData payload192 = ret.AsPlayerPermissionCheckEvent;
*(byte*)(ptr + 0) = (byte)5;
var handle193 = payload192.player.Handle;
payload192.player.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 8), 1)[0] = handle193;
var stringSpan198 = global::System.MemoryExtensions.AsSpan(payload192.permission);
var length196 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan198);
var strPtr194 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length196);
global::System.Text.Encoding.UTF8.GetBytes(stringSpan198, new global::System.Span<byte>(strPtr194, length196));
new global::System.Span<int>((void*)((byte*)ptr + 16), 1)[0] = length196;
new global::System.Span<nint>((void*)((byte*)ptr + 12), 1)[0] = (nint)(int)strPtr194;
*(byte*)(ptr + 20) = (byte)(payload192.permissionResult ? 1 : 0);
break;
}
case 6: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerMoveEventData payload201 = ret.AsPlayerMoveEvent;
*(byte*)(ptr + 0) = (byte)6;
var handle202 = payload201.player.Handle;
payload201.player.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 8), 1)[0] = handle202;
new global::System.Span<double>((void*)((byte*)ptr + 16), 1)[0] = unchecked((double)payload201.fromPosition.Item1);
new global::System.Span<double>((void*)((byte*)ptr + 24), 1)[0] = unchecked((double)payload201.fromPosition.Item2);
new global::System.Span<double>((void*)((byte*)ptr + 32), 1)[0] = unchecked((double)payload201.fromPosition.Item3);
new global::System.Span<double>((void*)((byte*)ptr + 40), 1)[0] = unchecked((double)payload201.toPosition.Item1);
new global::System.Span<double>((void*)((byte*)ptr + 48), 1)[0] = unchecked((double)payload201.toPosition.Item2);
new global::System.Span<double>((void*)((byte*)ptr + 56), 1)[0] = unchecked((double)payload201.toPosition.Item3);
*(byte*)(ptr + 64) = (byte)(payload201.cancelled ? 1 : 0);
break;
}
case 7: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerTeleportEventData payload205 = ret.AsPlayerTeleportEvent;
*(byte*)(ptr + 0) = (byte)7;
var handle206 = payload205.player.Handle;
payload205.player.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 8), 1)[0] = handle206;
new global::System.Span<double>((void*)((byte*)ptr + 16), 1)[0] = unchecked((double)payload205.fromPosition.Item1);
new global::System.Span<double>((void*)((byte*)ptr + 24), 1)[0] = unchecked((double)payload205.fromPosition.Item2);
new global::System.Span<double>((void*)((byte*)ptr + 32), 1)[0] = unchecked((double)payload205.fromPosition.Item3);
new global::System.Span<double>((void*)((byte*)ptr + 40), 1)[0] = unchecked((double)payload205.toPosition.Item1);
new global::System.Span<double>((void*)((byte*)ptr + 48), 1)[0] = unchecked((double)payload205.toPosition.Item2);
new global::System.Span<double>((void*)((byte*)ptr + 56), 1)[0] = unchecked((double)payload205.toPosition.Item3);
*(byte*)(ptr + 64) = (byte)(payload205.cancelled ? 1 : 0);
break;
}
case 8: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerChangeWorldEventData payload209 = ret.AsPlayerChangeWorldEvent;
*(byte*)(ptr + 0) = (byte)8;
var handle210 = payload209.player.Handle;
payload209.player.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 8), 1)[0] = handle210;
var handle211 = payload209.previousWorld.Handle;
payload209.previousWorld.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 12), 1)[0] = handle211;
var handle212 = payload209.newWorld.Handle;
payload209.newWorld.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 16), 1)[0] = handle212;
new global::System.Span<double>((void*)((byte*)ptr + 24), 1)[0] = unchecked((double)payload209.position.Item1);
new global::System.Span<double>((void*)((byte*)ptr + 32), 1)[0] = unchecked((double)payload209.position.Item2);
new global::System.Span<double>((void*)((byte*)ptr + 40), 1)[0] = unchecked((double)payload209.position.Item3);
new global::System.Span<float>((void*)((byte*)ptr + 48), 1)[0] = unchecked((float)payload209.yaw);
new global::System.Span<float>((void*)((byte*)ptr + 52), 1)[0] = unchecked((float)payload209.pitch);
*(byte*)(ptr + 56) = (byte)(payload209.cancelled ? 1 : 0);
break;
}
case 9: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerExpChangeEventData payload215 = ret.AsPlayerExpChangeEvent;
*(byte*)(ptr + 0) = (byte)9;
var handle216 = payload215.player.Handle;
payload215.player.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 8), 1)[0] = handle216;
new global::System.Span<int>((void*)((byte*)ptr + 12), 1)[0] = payload215.amount;
break;
}
case 10: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerItemHeldEventData payload219 = ret.AsPlayerItemHeldEvent;
*(byte*)(ptr + 0) = (byte)10;
var handle220 = payload219.player.Handle;
payload219.player.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 8), 1)[0] = handle220;
*(byte*)(ptr + 12) = (byte)payload219.previousSlot;
*(byte*)(ptr + 13) = (byte)payload219.newSlot;
*(byte*)(ptr + 14) = (byte)(payload219.cancelled ? 1 : 0);
break;
}
case 11: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerChangedMainHandEventData payload223 = ret.AsPlayerChangedMainHandEvent;
*(byte*)(ptr + 0) = (byte)11;
var handle224 = payload223.player.Handle;
payload223.player.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 8), 1)[0] = handle224;
*(byte*)(ptr + 12) = (byte)(int)payload223.mainHand;
break;
}
case 12: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerGamemodeChangeEventData payload227 = ret.AsPlayerGamemodeChangeEvent;
*(byte*)(ptr + 0) = (byte)12;
var handle228 = payload227.player.Handle;
payload227.player.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 8), 1)[0] = handle228;
*(byte*)(ptr + 12) = (byte)(int)payload227.previousGamemode;
*(byte*)(ptr + 13) = (byte)(int)payload227.newGamemode;
*(byte*)(ptr + 14) = (byte)(payload227.cancelled ? 1 : 0);
break;
}
case 13: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerCustomPayloadEventData payload231 = ret.AsPlayerCustomPayloadEvent;
*(byte*)(ptr + 0) = (byte)13;
var handle232 = payload231.player.Handle;
payload231.player.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 8), 1)[0] = handle232;
var stringSpan237 = global::System.MemoryExtensions.AsSpan(payload231.channel);
var length235 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan237);
var strPtr233 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length235);
global::System.Text.Encoding.UTF8.GetBytes(stringSpan237, new global::System.Span<byte>(strPtr233, length235));
new global::System.Span<int>((void*)((byte*)ptr + 16), 1)[0] = length235;
new global::System.Span<nint>((void*)((byte*)ptr + 12), 1)[0] = (nint)(int)strPtr233;
var byteLength = (1) * payload231.data.Length;
var address238 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)(byteLength));
global::System.MemoryExtensions.AsSpan(payload231.data).CopyTo(new global::System.Span<byte>(address238,byteLength));
new global::System.Span<int>((void*)((byte*)ptr + 24), 1)[0] = payload231.data.Length;
new global::System.Span<nint>((void*)((byte*)ptr + 20), 1)[0] = (nint)(int)(address238);
break;
}
case 14: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerFishEventData payload241 = ret.AsPlayerFishEvent;
*(byte*)(ptr + 0) = (byte)14;
var handle242 = payload241.player.Handle;
payload241.player.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 8), 1)[0] = handle242;
if (payload241.caughtUuid != null) {
var payload248 = (string) payload241.caughtUuid;
*(byte*)(ptr + 12) = (byte)1;
var stringSpan253 = global::System.MemoryExtensions.AsSpan(payload248);
var length251 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan253);
var strPtr249 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length251);
global::System.Text.Encoding.UTF8.GetBytes(stringSpan253, new global::System.Span<byte>(strPtr249, length251));
new global::System.Span<int>((void*)((byte*)ptr + 20), 1)[0] = length251;
new global::System.Span<nint>((void*)((byte*)ptr + 16), 1)[0] = (nint)(int)strPtr249;
} else {
*(byte*)(ptr + 12) = (byte)0;
}
var stringSpan258 = global::System.MemoryExtensions.AsSpan(payload241.caughtType);
var length256 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan258);
var strPtr254 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length256);
global::System.Text.Encoding.UTF8.GetBytes(stringSpan258, new global::System.Span<byte>(strPtr254, length256));
new global::System.Span<int>((void*)((byte*)ptr + 28), 1)[0] = length256;
new global::System.Span<nint>((void*)((byte*)ptr + 24), 1)[0] = (nint)(int)strPtr254;
var stringSpan263 = global::System.MemoryExtensions.AsSpan(payload241.hookUuid);
var length261 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan263);
var strPtr259 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length261);
global::System.Text.Encoding.UTF8.GetBytes(stringSpan263, new global::System.Span<byte>(strPtr259, length261));
new global::System.Span<int>((void*)((byte*)ptr + 36), 1)[0] = length261;
new global::System.Span<nint>((void*)((byte*)ptr + 32), 1)[0] = (nint)(int)strPtr259;
*(byte*)(ptr + 40) = (byte)(int)payload241.state;
*(byte*)(ptr + 41) = (byte)(int)payload241.hand;
new global::System.Span<int>((void*)((byte*)ptr + 44), 1)[0] = payload241.expToDrop;
*(byte*)(ptr + 48) = (byte)(payload241.cancelled ? 1 : 0);
break;
}
case 15: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerEggThrowEventData payload266 = ret.AsPlayerEggThrowEvent;
*(byte*)(ptr + 0) = (byte)15;
var handle267 = payload266.player.Handle;
payload266.player.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 8), 1)[0] = handle267;
var stringSpan272 = global::System.MemoryExtensions.AsSpan(payload266.eggUuid);
var length270 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan272);
var strPtr268 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length270);
global::System.Text.Encoding.UTF8.GetBytes(stringSpan272, new global::System.Span<byte>(strPtr268, length270));
new global::System.Span<int>((void*)((byte*)ptr + 16), 1)[0] = length270;
new global::System.Span<nint>((void*)((byte*)ptr + 12), 1)[0] = (nint)(int)strPtr268;
*(byte*)(ptr + 20) = (byte)(payload266.hatching ? 1 : 0);
*(byte*)(ptr + 21) = (byte)payload266.numHatches;
var stringSpan277 = global::System.MemoryExtensions.AsSpan(payload266.hatchingType);
var length275 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan277);
var strPtr273 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length275);
global::System.Text.Encoding.UTF8.GetBytes(stringSpan277, new global::System.Span<byte>(strPtr273, length275));
new global::System.Span<int>((void*)((byte*)ptr + 28), 1)[0] = length275;
new global::System.Span<nint>((void*)((byte*)ptr + 24), 1)[0] = (nint)(int)strPtr273;
*(byte*)(ptr + 32) = (byte)(payload266.cancelled ? 1 : 0);
break;
}
case 16: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerInteractUnknownEntityEventData payload280 = ret.AsPlayerInteractUnknownEntityEvent;
*(byte*)(ptr + 0) = (byte)16;
var handle281 = payload280.player.Handle;
payload280.player.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 8), 1)[0] = handle281;
new global::System.Span<int>((void*)((byte*)ptr + 12), 1)[0] = payload280.entityId;
*(byte*)(ptr + 16) = (byte)(int)payload280.action;
*(byte*)(ptr + 17) = (byte)(payload280.cancelled ? 1 : 0);
break;
}
case 17: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerInteractEventData payload284 = ret.AsPlayerInteractEvent;
*(byte*)(ptr + 0) = (byte)17;
var handle285 = payload284.player.Handle;
payload284.player.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 8), 1)[0] = handle285;
*(byte*)(ptr + 12) = (byte)(int)payload284.action;
if (payload284.clickedPos != null) {
var payload291 = ((int, int, int)) payload284.clickedPos;
*(byte*)(ptr + 16) = (byte)1;
new global::System.Span<int>((void*)((byte*)ptr + 20), 1)[0] = payload291.Item1;
new global::System.Span<int>((void*)((byte*)ptr + 24), 1)[0] = payload291.Item2;
new global::System.Span<int>((void*)((byte*)ptr + 28), 1)[0] = payload291.Item3;
} else {
*(byte*)(ptr + 16) = (byte)0;
}
var stringSpan296 = global::System.MemoryExtensions.AsSpan(payload284.block);
var length294 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan296);
var strPtr292 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length294);
global::System.Text.Encoding.UTF8.GetBytes(stringSpan296, new global::System.Span<byte>(strPtr292, length294));
new global::System.Span<int>((void*)((byte*)ptr + 36), 1)[0] = length294;
new global::System.Span<nint>((void*)((byte*)ptr + 32), 1)[0] = (nint)(int)strPtr292;
*(byte*)(ptr + 40) = (byte)(payload284.cancelled ? 1 : 0);
break;
}
case 18: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerToggleSneakEventData payload299 = ret.AsPlayerToggleSneakEvent;
*(byte*)(ptr + 0) = (byte)18;
var handle300 = payload299.player.Handle;
payload299.player.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 8), 1)[0] = handle300;
*(byte*)(ptr + 12) = (byte)(payload299.isSneaking ? 1 : 0);
*(byte*)(ptr + 13) = (byte)(payload299.cancelled ? 1 : 0);
break;
}
case 19: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerToggleFlightEventData payload303 = ret.AsPlayerToggleFlightEvent;
*(byte*)(ptr + 0) = (byte)19;
var handle304 = payload303.player.Handle;
payload303.player.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 8), 1)[0] = handle304;
*(byte*)(ptr + 12) = (byte)(payload303.isFlying ? 1 : 0);
*(byte*)(ptr + 13) = (byte)(payload303.cancelled ? 1 : 0);
break;
}
case 20: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.PlayerToggleSprintEventData payload307 = ret.AsPlayerToggleSprintEvent;
*(byte*)(ptr + 0) = (byte)20;
var handle308 = payload307.player.Handle;
payload307.player.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 8), 1)[0] = handle308;
*(byte*)(ptr + 12) = (byte)(payload307.isSprinting ? 1 : 0);
*(byte*)(ptr + 13) = (byte)(payload307.cancelled ? 1 : 0);
break;
}
case 21: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.InventoryClickEventData payload311 = ret.AsInventoryClickEvent;
*(byte*)(ptr + 0) = (byte)21;
var handle312 = payload311.player.Handle;
payload311.player.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 8), 1)[0] = handle312;
if (payload311.windowType != null) {
var payload318 = (string) payload311.windowType;
*(byte*)(ptr + 12) = (byte)1;
var stringSpan323 = global::System.MemoryExtensions.AsSpan(payload318);
var length321 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan323);
var strPtr319 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length321);
global::System.Text.Encoding.UTF8.GetBytes(stringSpan323, new global::System.Span<byte>(strPtr319, length321));
new global::System.Span<int>((void*)((byte*)ptr + 20), 1)[0] = length321;
new global::System.Span<nint>((void*)((byte*)ptr + 16), 1)[0] = (nint)(int)strPtr319;
} else {
*(byte*)(ptr + 12) = (byte)0;
}
*(byte*)(ptr + 24) = (byte)(int)payload311.clickType;
new global::System.Span<short>((void*)((byte*)ptr + 26), 1)[0] = (short)payload311.slot;
new global::System.Span<short>((void*)((byte*)ptr + 28), 1)[0] = (short)payload311.rawSlot;
if (payload311.clickedItem != null) {
var payload329 = (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.ItemStack) payload311.clickedItem;
*(byte*)(ptr + 32) = (byte)1;
var stringSpan334 = global::System.MemoryExtensions.AsSpan(payload329.registryKey);
var length332 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan334);
var strPtr330 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length332);
global::System.Text.Encoding.UTF8.GetBytes(stringSpan334, new global::System.Span<byte>(strPtr330, length332));
new global::System.Span<int>((void*)((byte*)ptr + 40), 1)[0] = length332;
new global::System.Span<nint>((void*)((byte*)ptr + 36), 1)[0] = (nint)(int)strPtr330;
*(byte*)(ptr + 44) = (byte)payload329.count;
} else {
*(byte*)(ptr + 32) = (byte)0;
}
if (payload311.cursor != null) {
var payload340 = (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommonImports.ItemStack) payload311.cursor;
*(byte*)(ptr + 48) = (byte)1;
var stringSpan345 = global::System.MemoryExtensions.AsSpan(payload340.registryKey);
var length343 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan345);
var strPtr341 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length343);
global::System.Text.Encoding.UTF8.GetBytes(stringSpan345, new global::System.Span<byte>(strPtr341, length343));
new global::System.Span<int>((void*)((byte*)ptr + 56), 1)[0] = length343;
new global::System.Span<nint>((void*)((byte*)ptr + 52), 1)[0] = (nint)(int)strPtr341;
*(byte*)(ptr + 60) = (byte)payload340.count;
} else {
*(byte*)(ptr + 48) = (byte)0;
}
new global::System.Span<int>((void*)((byte*)ptr + 64), 1)[0] = payload311.hotbarButton;
*(byte*)(ptr + 68) = (byte)(payload311.cancelled ? 1 : 0);
break;
}
case 22: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.InventoryCloseEventData payload348 = ret.AsInventoryCloseEvent;
*(byte*)(ptr + 0) = (byte)22;
var handle349 = payload348.player.Handle;
payload348.player.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 8), 1)[0] = handle349;
if (payload348.windowType != null) {
var payload355 = (string) payload348.windowType;
*(byte*)(ptr + 12) = (byte)1;
var stringSpan360 = global::System.MemoryExtensions.AsSpan(payload355);
var length358 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan360);
var strPtr356 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length358);
global::System.Text.Encoding.UTF8.GetBytes(stringSpan360, new global::System.Span<byte>(strPtr356, length358));
new global::System.Span<int>((void*)((byte*)ptr + 20), 1)[0] = length358;
new global::System.Span<nint>((void*)((byte*)ptr + 16), 1)[0] = (nint)(int)strPtr356;
} else {
*(byte*)(ptr + 12) = (byte)0;
}
break;
}
case 23: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.BlockRedstoneEventData payload363 = ret.AsBlockRedstoneEvent;
*(byte*)(ptr + 0) = (byte)23;
var handle364 = payload363.targetWorld.Handle;
payload363.targetWorld.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 8), 1)[0] = handle364;
new global::System.Span<short>((void*)((byte*)ptr + 12), 1)[0] = (short)payload363.stateId;
new global::System.Span<int>((void*)((byte*)ptr + 16), 1)[0] = payload363.blockPosition.Item1;
new global::System.Span<int>((void*)((byte*)ptr + 20), 1)[0] = payload363.blockPosition.Item2;
new global::System.Span<int>((void*)((byte*)ptr + 24), 1)[0] = payload363.blockPosition.Item3;
new global::System.Span<int>((void*)((byte*)ptr + 28), 1)[0] = payload363.oldCurrent;
new global::System.Span<int>((void*)((byte*)ptr + 32), 1)[0] = payload363.newCurrent;
*(byte*)(ptr + 36) = (byte)(payload363.cancelled ? 1 : 0);
break;
}
case 24: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.BlockBreakEventData payload367 = ret.AsBlockBreakEvent;
*(byte*)(ptr + 0) = (byte)24;
if (payload367.player != null) {
var payload373 = (global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IPlayerImports.Player) payload367.player;
*(byte*)(ptr + 8) = (byte)1;
var handle374 = payload373.Handle;
payload373.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 12), 1)[0] = handle374;
} else {
*(byte*)(ptr + 8) = (byte)0;
}
var stringSpan379 = global::System.MemoryExtensions.AsSpan(payload367.block);
var length377 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan379);
var strPtr375 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length377);
global::System.Text.Encoding.UTF8.GetBytes(stringSpan379, new global::System.Span<byte>(strPtr375, length377));
new global::System.Span<int>((void*)((byte*)ptr + 20), 1)[0] = length377;
new global::System.Span<nint>((void*)((byte*)ptr + 16), 1)[0] = (nint)(int)strPtr375;
new global::System.Span<int>((void*)((byte*)ptr + 24), 1)[0] = payload367.blockPosition.Item1;
new global::System.Span<int>((void*)((byte*)ptr + 28), 1)[0] = payload367.blockPosition.Item2;
new global::System.Span<int>((void*)((byte*)ptr + 32), 1)[0] = payload367.blockPosition.Item3;
new global::System.Span<int>((void*)((byte*)ptr + 36), 1)[0] = unchecked((int)(payload367.exp));
*(byte*)(ptr + 40) = (byte)(payload367.shouldDrop ? 1 : 0);
*(byte*)(ptr + 41) = (byte)(payload367.cancelled ? 1 : 0);
break;
}
case 25: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.BlockBurnEventData payload382 = ret.AsBlockBurnEvent;
*(byte*)(ptr + 0) = (byte)25;
var stringSpan387 = global::System.MemoryExtensions.AsSpan(payload382.ignitingBlock);
var length385 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan387);
var strPtr383 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length385);
global::System.Text.Encoding.UTF8.GetBytes(stringSpan387, new global::System.Span<byte>(strPtr383, length385));
new global::System.Span<int>((void*)((byte*)ptr + 12), 1)[0] = length385;
new global::System.Span<nint>((void*)((byte*)ptr + 8), 1)[0] = (nint)(int)strPtr383;
var stringSpan392 = global::System.MemoryExtensions.AsSpan(payload382.block);
var length390 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan392);
var strPtr388 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length390);
global::System.Text.Encoding.UTF8.GetBytes(stringSpan392, new global::System.Span<byte>(strPtr388, length390));
new global::System.Span<int>((void*)((byte*)ptr + 20), 1)[0] = length390;
new global::System.Span<nint>((void*)((byte*)ptr + 16), 1)[0] = (nint)(int)strPtr388;
*(byte*)(ptr + 24) = (byte)(payload382.cancelled ? 1 : 0);
break;
}
case 26: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.BlockCanBuildEventData payload395 = ret.AsBlockCanBuildEvent;
*(byte*)(ptr + 0) = (byte)26;
var stringSpan400 = global::System.MemoryExtensions.AsSpan(payload395.blockToBuild);
var length398 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan400);
var strPtr396 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length398);
global::System.Text.Encoding.UTF8.GetBytes(stringSpan400, new global::System.Span<byte>(strPtr396, length398));
new global::System.Span<int>((void*)((byte*)ptr + 12), 1)[0] = length398;
new global::System.Span<nint>((void*)((byte*)ptr + 8), 1)[0] = (nint)(int)strPtr396;
*(byte*)(ptr + 16) = (byte)(payload395.buildable ? 1 : 0);
var handle401 = payload395.player.Handle;
payload395.player.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 20), 1)[0] = handle401;
var stringSpan406 = global::System.MemoryExtensions.AsSpan(payload395.block);
var length404 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan406);
var strPtr402 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length404);
global::System.Text.Encoding.UTF8.GetBytes(stringSpan406, new global::System.Span<byte>(strPtr402, length404));
new global::System.Span<int>((void*)((byte*)ptr + 28), 1)[0] = length404;
new global::System.Span<nint>((void*)((byte*)ptr + 24), 1)[0] = (nint)(int)strPtr402;
*(byte*)(ptr + 32) = (byte)(payload395.cancelled ? 1 : 0);
break;
}
case 27: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.BlockGrowEventData payload409 = ret.AsBlockGrowEvent;
*(byte*)(ptr + 0) = (byte)27;
var handle410 = payload409.targetWorld.Handle;
payload409.targetWorld.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 8), 1)[0] = handle410;
var stringSpan415 = global::System.MemoryExtensions.AsSpan(payload409.oldBlock);
var length413 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan415);
var strPtr411 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length413);
global::System.Text.Encoding.UTF8.GetBytes(stringSpan415, new global::System.Span<byte>(strPtr411, length413));
new global::System.Span<int>((void*)((byte*)ptr + 16), 1)[0] = length413;
new global::System.Span<nint>((void*)((byte*)ptr + 12), 1)[0] = (nint)(int)strPtr411;
new global::System.Span<short>((void*)((byte*)ptr + 20), 1)[0] = (short)payload409.oldStateId;
var stringSpan420 = global::System.MemoryExtensions.AsSpan(payload409.newBlock);
var length418 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan420);
var strPtr416 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length418);
global::System.Text.Encoding.UTF8.GetBytes(stringSpan420, new global::System.Span<byte>(strPtr416, length418));
new global::System.Span<int>((void*)((byte*)ptr + 28), 1)[0] = length418;
new global::System.Span<nint>((void*)((byte*)ptr + 24), 1)[0] = (nint)(int)strPtr416;
new global::System.Span<short>((void*)((byte*)ptr + 32), 1)[0] = (short)payload409.newStateId;
new global::System.Span<int>((void*)((byte*)ptr + 36), 1)[0] = payload409.blockPosition.Item1;
new global::System.Span<int>((void*)((byte*)ptr + 40), 1)[0] = payload409.blockPosition.Item2;
new global::System.Span<int>((void*)((byte*)ptr + 44), 1)[0] = payload409.blockPosition.Item3;
*(byte*)(ptr + 48) = (byte)(payload409.cancelled ? 1 : 0);
break;
}
case 28: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.BlockPlaceEventData payload423 = ret.AsBlockPlaceEvent;
*(byte*)(ptr + 0) = (byte)28;
var handle424 = payload423.player.Handle;
payload423.player.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 8), 1)[0] = handle424;
var stringSpan429 = global::System.MemoryExtensions.AsSpan(payload423.blockPlaced);
var length427 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan429);
var strPtr425 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length427);
global::System.Text.Encoding.UTF8.GetBytes(stringSpan429, new global::System.Span<byte>(strPtr425, length427));
new global::System.Span<int>((void*)((byte*)ptr + 16), 1)[0] = length427;
new global::System.Span<nint>((void*)((byte*)ptr + 12), 1)[0] = (nint)(int)strPtr425;
var stringSpan434 = global::System.MemoryExtensions.AsSpan(payload423.blockPlacedAgainst);
var length432 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan434);
var strPtr430 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length432);
global::System.Text.Encoding.UTF8.GetBytes(stringSpan434, new global::System.Span<byte>(strPtr430, length432));
new global::System.Span<int>((void*)((byte*)ptr + 24), 1)[0] = length432;
new global::System.Span<nint>((void*)((byte*)ptr + 20), 1)[0] = (nint)(int)strPtr430;
new global::System.Span<int>((void*)((byte*)ptr + 28), 1)[0] = payload423.blockPosition.Item1;
new global::System.Span<int>((void*)((byte*)ptr + 32), 1)[0] = payload423.blockPosition.Item2;
new global::System.Span<int>((void*)((byte*)ptr + 36), 1)[0] = payload423.blockPosition.Item3;
*(byte*)(ptr + 40) = (byte)(payload423.canBuild ? 1 : 0);
*(byte*)(ptr + 41) = (byte)(payload423.cancelled ? 1 : 0);
break;
}
case 29: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.ServerCommandEventData payload437 = ret.AsServerCommandEvent;
*(byte*)(ptr + 0) = (byte)29;
var stringSpan442 = global::System.MemoryExtensions.AsSpan(payload437.command);
var length440 = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan442);
var strPtr438 = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length440);
global::System.Text.Encoding.UTF8.GetBytes(stringSpan442, new global::System.Span<byte>(strPtr438, length440));
new global::System.Span<int>((void*)((byte*)ptr + 12), 1)[0] = length440;
new global::System.Span<nint>((void*)((byte*)ptr + 8), 1)[0] = (nint)(int)strPtr438;
*(byte*)(ptr + 16) = (byte)(payload437.cancelled ? 1 : 0);
break;
}
case 30: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.SpawnChangeEventData payload445 = ret.AsSpawnChangeEvent;
*(byte*)(ptr + 0) = (byte)30;
var handle446 = payload445.targetWorld.Handle;
payload445.targetWorld.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 8), 1)[0] = handle446;
new global::System.Span<int>((void*)((byte*)ptr + 12), 1)[0] = payload445.previousPosition.Item1;
new global::System.Span<int>((void*)((byte*)ptr + 16), 1)[0] = payload445.previousPosition.Item2;
new global::System.Span<int>((void*)((byte*)ptr + 20), 1)[0] = payload445.previousPosition.Item3;
new global::System.Span<float>((void*)((byte*)ptr + 24), 1)[0] = unchecked((float)payload445.previousYaw);
new global::System.Span<float>((void*)((byte*)ptr + 28), 1)[0] = unchecked((float)payload445.previousPitch);
new global::System.Span<int>((void*)((byte*)ptr + 32), 1)[0] = payload445.newPosition.Item1;
new global::System.Span<int>((void*)((byte*)ptr + 36), 1)[0] = payload445.newPosition.Item2;
new global::System.Span<int>((void*)((byte*)ptr + 40), 1)[0] = payload445.newPosition.Item3;
new global::System.Span<float>((void*)((byte*)ptr + 44), 1)[0] = unchecked((float)payload445.newYaw);
new global::System.Span<float>((void*)((byte*)ptr + 48), 1)[0] = unchecked((float)payload445.newPitch);
break;
}
case 31: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IEventImports.ServerBroadcastEventData payload449 = ret.AsServerBroadcastEvent;
*(byte*)(ptr + 0) = (byte)31;
var handle450 = payload449.message.Handle;
payload449.message.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 8), 1)[0] = handle450;
var handle451 = payload449.sender.Handle;
payload449.sender.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 12), 1)[0] = handle451;
*(byte*)(ptr + 16) = (byte)(payload449.cancelled ? 1 : 0);
break;
}
default: throw new global::System.ArgumentException("invalid discriminant: " + ret);
}
return ptr;
}
[global::System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute(EntryPoint = "cabi_post_handle-event")]
public static unsafe void cabi_post_wasmExportHandleEvent(nint p0) {
switch (new global::System.Span<byte>((byte*)p0 + 0, 1)[0]) {
case 0: {
break;
}
case 1: {
break;
}
case 2: {
break;
}
case 3: {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 12), 1)[0]);
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 20), 1)[0]);
break;
}
case 4: {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 12), 1)[0]);
break;
}
case 5: {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 12), 1)[0]);
break;
}
case 6: {
break;
}
case 7: {
break;
}
case 8: {
break;
}
case 9: {
break;
}
case 10: {
break;
}
case 11: {
break;
}
case 12: {
break;
}
case 13: {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 12), 1)[0]);
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 20), 1)[0]);
break;
}
case 14: {
switch (new global::System.Span<byte>((byte*)p0 + 12, 1)[0]) {
case 0: {
break;
}
case 1: {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 16), 1)[0]);
break;
}
}
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 24), 1)[0]);
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 32), 1)[0]);
break;
}
case 15: {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 12), 1)[0]);
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 24), 1)[0]);
break;
}
case 16: {
break;
}
case 17: {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 32), 1)[0]);
break;
}
case 18: {
break;
}
case 19: {
break;
}
case 20: {
break;
}
case 21: {
switch (new global::System.Span<byte>((byte*)p0 + 12, 1)[0]) {
case 0: {
break;
}
case 1: {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 16), 1)[0]);
break;
}
}
switch (new global::System.Span<byte>((byte*)p0 + 32, 1)[0]) {
case 0: {
break;
}
case 1: {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 36), 1)[0]);
break;
}
}
switch (new global::System.Span<byte>((byte*)p0 + 48, 1)[0]) {
case 0: {
break;
}
case 1: {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 52), 1)[0]);
break;
}
}
break;
}
case 22: {
switch (new global::System.Span<byte>((byte*)p0 + 12, 1)[0]) {
case 0: {
break;
}
case 1: {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 16), 1)[0]);
break;
}
}
break;
}
case 23: {
break;
}
case 24: {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 16), 1)[0]);
break;
}
case 25: {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 8), 1)[0]);
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 16), 1)[0]);
break;
}
case 26: {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 8), 1)[0]);
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 24), 1)[0]);
break;
}
case 27: {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 12), 1)[0]);
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 24), 1)[0]);
break;
}
case 28: {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 12), 1)[0]);
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 20), 1)[0]);
break;
}
case 29: {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 8), 1)[0]);
break;
}
case 30: {
break;
}
case 31: {
break;
}
}
}
[global::System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute(EntryPoint = "handle-command")]
public static unsafe nint wasmExportHandleCommand(int p0, int p1, int p2, int p3) {
var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.CommandSender(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.CommandSender.THandle(p1));
var resource0 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IServerImports.Server(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IServerImports.Server.THandle(p2));
var resource1 = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.ConsumedArgs(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.ConsumedArgs.THandle(p3));
Result<int, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.CommandError> ret;
try
{
ret = Result<int, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.CommandError>.Ok(PluginWorldExportsImpl.HandleCommand((unchecked((uint)(p0))), (resource), (resource0), (resource1)));
}
catch (WitException e)
{
switch (e.NestingLevel)
{
case 0:
{
ret = Result<int, global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.CommandError>.Err((global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.CommandError) e.Value);
break;
}
default: throw new global::System.ArgumentException($"invalid nesting level: {e.NestingLevel}");
}
}
var ptr = InteropReturnArea.returnArea.AddressOfReturnArea();
switch (ret.Tag) {
case 0: {
int payload = ret.AsOk;
*(byte*)(ptr + 0) = (byte)0;
new global::System.Span<int>((void*)((byte*)ptr + 4), 1)[0] = payload;
break;
}
case 1: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ICommandImports.CommandError payload4 = ret.AsErr;
*(byte*)(ptr + 0) = (byte)1;
switch (payload4.Tag) {
case 0: {
string? payload7 = payload4.AsInvalidConsumption;
*(byte*)(ptr + 4) = (byte)0;
if (payload7 != null) {
var payload13 = (string) payload7;
*(byte*)(ptr + 8) = (byte)1;
var stringSpan = global::System.MemoryExtensions.AsSpan(payload13);
var length = global::System.Text.Encoding.UTF8.GetByteCount(stringSpan);
var strPtr = global::System.Runtime.InteropServices.NativeMemory.Alloc((nuint)length);
global::System.Text.Encoding.UTF8.GetBytes(stringSpan, new global::System.Span<byte>(strPtr, length));
new global::System.Span<int>((void*)((byte*)ptr + 16), 1)[0] = length;
new global::System.Span<nint>((void*)((byte*)ptr + 12), 1)[0] = (nint)(int)strPtr;
} else {
*(byte*)(ptr + 8) = (byte)0;
}
break;
}
case 1: {
*(byte*)(ptr + 4) = (byte)1;
break;
}
case 2: {
*(byte*)(ptr + 4) = (byte)2;
break;
}
case 3: {
global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.ITextImports.TextComponent payload22 = payload4.AsCommandFailed;
*(byte*)(ptr + 4) = (byte)3;
var handle = payload22.Handle;
payload22.Handle = 0;
new global::System.Span<int>((void*)((byte*)ptr + 8), 1)[0] = handle;
break;
}
default: throw new global::System.ArgumentException("invalid discriminant: " + payload4);
}
break;
}
default: throw new global::System.ArgumentException("invalid discriminant: " + ret);
}
return ptr;
}
[global::System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute(EntryPoint = "cabi_post_handle-command")]
public static unsafe void cabi_post_wasmExportHandleCommand(nint p0) {
switch (new global::System.Span<byte>((byte*)p0 + 0, 1)[0]) {
case 0: {
break;
}
case 1: {
switch (new global::System.Span<byte>((byte*)p0 + 4, 1)[0]) {
case 0: {
switch (new global::System.Span<byte>((byte*)p0 + 8, 1)[0]) {
case 0: {
break;
}
case 1: {
global::System.Runtime.InteropServices.NativeMemory.Free((void*)new global::System.Span<nint>((void*)((byte*)p0 + 12), 1)[0]);
break;
}
}
break;
}
case 1: {
break;
}
case 2: {
break;
}
case 3: {
break;
}
}
break;
}
}
}
[global::System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute(EntryPoint = "handle-task")]
public static unsafe void wasmExportHandleTask(int p0, int p1) {
var resource = new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IServerImports.Server(new global::PluginWorld.wit.Imports.pumpkin.plugin.v0_1_0.IServerImports.Server.THandle(p1));
PluginWorldExportsImpl.HandleTask((unchecked((uint)(p0))), (resource));
}
}
}
}