mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-05-18 22:33:51 +00:00
playsound, sleep ignoring
This commit is contained in:
parent
a5e39efa04
commit
a0be612f48
7 changed files with 294 additions and 9 deletions
|
|
@ -126,6 +126,12 @@ internal static class NativeBridge
|
|||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
internal delegate void NativeSetAllowFlightDelegate(int entityId, int allowFlight);
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
internal delegate void NativePlaySoundDelegate(int entityId, int soundId, double x, double y, double z, float volume, float pitch);
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
internal delegate void NativeSetSleepingIgnoredDelegate(int entityId, int ignored);
|
||||
|
||||
|
||||
internal static NativeDamageDelegate? DamagePlayer;
|
||||
internal static NativeSetHealthDelegate? SetPlayerHealth;
|
||||
|
|
@ -168,6 +174,8 @@ internal static class NativeBridge
|
|||
internal static NativeSetSneakingDelegate? SetSneaking;
|
||||
internal static NativeSetVelocityDelegate? SetVelocity;
|
||||
internal static NativeSetAllowFlightDelegate? SetAllowFlight;
|
||||
internal static NativePlaySoundDelegate? PlaySound;
|
||||
internal static NativeSetSleepingIgnoredDelegate? SetSleepingIgnored;
|
||||
|
||||
internal static void SetCallbacks(IntPtr damage, IntPtr setHealth, IntPtr teleport, IntPtr setGameMode, IntPtr broadcastMessage, IntPtr setFallDistance, IntPtr getPlayerSnapshot, IntPtr sendMessage, IntPtr setWalkSpeed, IntPtr teleportEntity)
|
||||
{
|
||||
|
|
@ -222,10 +230,12 @@ internal static class NativeBridge
|
|||
SetHeldItemSlot = Marshal.GetDelegateForFunctionPointer<NativeSetHeldItemSlotDelegate>(setHeldItemSlot);
|
||||
}
|
||||
|
||||
internal static void SetEntityCallbacks(IntPtr setSneaking, IntPtr setVelocity, IntPtr setAllowFlight)
|
||||
internal static void SetEntityCallbacks(IntPtr setSneaking, IntPtr setVelocity, IntPtr setAllowFlight, IntPtr playSound, IntPtr setSleepingIgnored)
|
||||
{
|
||||
SetSneaking = Marshal.GetDelegateForFunctionPointer<NativeSetSneakingDelegate>(setSneaking);
|
||||
SetVelocity = Marshal.GetDelegateForFunctionPointer<NativeSetVelocityDelegate>(setVelocity);
|
||||
SetAllowFlight = Marshal.GetDelegateForFunctionPointer<NativeSetAllowFlightDelegate>(setAllowFlight);
|
||||
PlaySound = Marshal.GetDelegateForFunctionPointer<NativePlaySoundDelegate>(playSound);
|
||||
SetSleepingIgnored = Marshal.GetDelegateForFunctionPointer<NativeSetSleepingIgnoredDelegate>(setSleepingIgnored);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue