From e8cfd54e2769cd39e93f8510bbd3148aa2a1b644 Mon Sep 17 00:00:00 2001 From: MS-crew <100300664+MS-crew@users.noreply.github.com> Date: Fri, 23 Jan 2026 15:12:33 +0300 Subject: [PATCH 1/8] Fix item owner being done in the wrong order --- EXILED/Exiled.API/Features/Player.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/EXILED/Exiled.API/Features/Player.cs b/EXILED/Exiled.API/Features/Player.cs index d8399527b..0ffef8a37 100644 --- a/EXILED/Exiled.API/Features/Player.cs +++ b/EXILED/Exiled.API/Features/Player.cs @@ -2942,13 +2942,11 @@ public Item AddItem(ItemBase itemBase, Item item = null, ItemAddReason addReason { item ??= Item.Get(itemBase); item.AddReason = addReason; - + item.ChangeOwner(item.Owner, this); Inventory.UserInventory.Items[item.Serial] = itemBase; typeof(InventoryExtensions).InvokeStaticEvent(nameof(InventoryExtensions.OnItemAdded), new object[] { ReferenceHub, itemBase, null }); - item.ChangeOwner(item.Owner, this); - if (itemBase is IAcquisitionConfirmationTrigger acquisitionConfirmationTrigger) { acquisitionConfirmationTrigger.AcquisitionAlreadyReceived = false; From 9fc98d76cd58070ac7ea06faab7753fbdd40925f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mustafa=20SAVA=C5=9E?= Date: Sat, 24 Jan 2026 12:10:07 +0300 Subject: [PATCH 2/8] Revert "Fix item owner being done in the wrong order" This reverts commit e8cfd54e2769cd39e93f8510bbd3148aa2a1b644. --- EXILED/Exiled.API/Features/Player.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/EXILED/Exiled.API/Features/Player.cs b/EXILED/Exiled.API/Features/Player.cs index 0ffef8a37..d8399527b 100644 --- a/EXILED/Exiled.API/Features/Player.cs +++ b/EXILED/Exiled.API/Features/Player.cs @@ -2942,11 +2942,13 @@ public Item AddItem(ItemBase itemBase, Item item = null, ItemAddReason addReason { item ??= Item.Get(itemBase); item.AddReason = addReason; - item.ChangeOwner(item.Owner, this); + Inventory.UserInventory.Items[item.Serial] = itemBase; typeof(InventoryExtensions).InvokeStaticEvent(nameof(InventoryExtensions.OnItemAdded), new object[] { ReferenceHub, itemBase, null }); + item.ChangeOwner(item.Owner, this); + if (itemBase is IAcquisitionConfirmationTrigger acquisitionConfirmationTrigger) { acquisitionConfirmationTrigger.AcquisitionAlreadyReceived = false; From a031d462f25af0a1e4cde42f3a5cafd645a7ca98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mustafa=20SAVA=C5=9E?= Date: Tue, 27 Jan 2026 02:00:08 +0300 Subject: [PATCH 3/8] draww --- EXILED/Exiled.API/Features/Draw.cs | 142 +++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 EXILED/Exiled.API/Features/Draw.cs diff --git a/EXILED/Exiled.API/Features/Draw.cs b/EXILED/Exiled.API/Features/Draw.cs new file mode 100644 index 000000000..1f1df60e2 --- /dev/null +++ b/EXILED/Exiled.API/Features/Draw.cs @@ -0,0 +1,142 @@ +// ----------------------------------------------------------------------- +// +// Copyright (c) ExMod Team. All rights reserved. +// Licensed under the CC BY-SA 3.0 license. +// +// ----------------------------------------------------------------------- + +namespace Exiled.API.Features +{ + using DrawableLine; + + using UnityEngine; + + /// + /// A utility class for drawing debug lines, shapes, and bounds for players or globally. + /// + public static class Draw + { + private const float DefaultDuration = 5f; + + private static readonly Color DefaultColor = Color.green; + + /// + /// Draws a line between two specified points. + /// + /// The starting position of the line. + /// The ending position of the line. + /// The to show the line to. If , it is shown to all players. + /// The color of the line. Defaults to . + /// How long the line should remain visible. + public static void Line(Vector3 start, Vector3 end, Player player = null, Color? color = null, float duration = DefaultDuration) + { + Send(player, duration, color ?? DefaultColor, start, end); + } + + /// + /// Draws a connected path through a series of points. + /// + /// An array of points to connect sequentially. + /// The to show the path to. If , it is shown to all players. + /// The color of the path. Defaults to . + /// How long the path should remain visible. + public static void Path(Vector3[] points, Player player = null, Color? color = null, float duration = DefaultDuration) + { + Send(player, duration, color ?? DefaultColor, points); + } + + /// + /// Draws a circle at a specific position. + /// + /// The center point of the circle. + /// The radius of the circle. + /// The to show the circle to. If , it is shown to all players. + /// Indicates whether the circle should be drawn on the horizontal plane (XZ) or vertical plane (XY). + /// The number of line segments used to draw the circle. Higher values result in a smoother circle. + /// The color of the circle. Defaults to . + /// How long the circle should remain visible. + public static void Circle(Vector3 origin, float radius, Player player = null, bool horizontal = true, int segments = 16, Color? color = null, float duration = DefaultDuration) + { + Vector3[] circlePoints = DrawableLines.GetCircle(origin, radius, horizontal, segments); + Send(player, duration, color ?? DefaultColor, circlePoints); + } + + /// + /// Draws a wireframe sphere composed of two circles (horizontal and vertical). + /// + /// The center point of the sphere. + /// The radius of the sphere. + /// The to show the sphere to. If , it is shown to all players. + /// The number of segments for the circles. Higher values result in a smoother sphere. + /// The color of the sphere. Defaults to . + /// How long the sphere should remain visible. + public static void Sphere(Vector3 origin, float radius, Player player = null, int segments = 16, Color? color = null, float duration = DefaultDuration) + { + Color finalColor = color ?? DefaultColor; + + Vector3[] horizontal = DrawableLines.GetCircle(origin, radius, true, segments); + Send(player, duration, finalColor, horizontal); + + Vector3[] vertical = DrawableLines.GetCircle(origin, radius, false, segments); + Send(player, duration, finalColor, vertical); + } + + /// + /// Draws the edges of a object (box). + /// + /// The object to visualize. + /// The to show the bounds to. If , it is shown to all players. + /// How long the bounds should remain visible. + /// The color of the box. Defaults to . + public static void Bounds(Bounds bounds, Player player = null, float duration = DefaultDuration, Color? color = null) + { + Color finalColor = color ?? DefaultColor; + Vector3 center = bounds.center; + Vector3 extents = bounds.extents; + + Vector3[] array = new Vector3[5]; + Vector3[] array2 = new Vector3[5]; + + array[0] = center + new Vector3(-extents.x, -extents.y, -extents.z); + array[1] = center + new Vector3(extents.x, -extents.y, -extents.z); + array[2] = center + new Vector3(extents.x, -extents.y, extents.z); + array[3] = center + new Vector3(-extents.x, -extents.y, extents.z); + array[4] = array[0]; + + array2[0] = center + new Vector3(-extents.x, extents.y, -extents.z); + array2[1] = center + new Vector3(extents.x, extents.y, -extents.z); + array2[2] = center + new Vector3(extents.x, extents.y, extents.z); + array2[3] = center + new Vector3(-extents.x, extents.y, extents.z); + array2[4] = array2[0]; + + Send(player, duration, finalColor, array); + Send(player, duration, finalColor, array2); + + for (int i = 0; i < 4; i++) + { + Send(player, duration, finalColor, array[i], array2[i]); + } + } + + private static void Send(Player player, float duration, Color color, params Vector3[] points) + { + if (points == null || points.Length < 2) + return; + + bool debugWas = DrawableLines.IsDebugModeEnabled; + DrawableLines.IsDebugModeEnabled = true; + + if (player != null) + { + DrawableLineMessage message = DrawableLines.ServerGenerateMessage(duration, color, points); + player.Connection.Send(message); + } + else + { + DrawableLines.ServerGenerateLine(duration, color, positions: points); + } + + DrawableLines.IsDebugModeEnabled = debugWas; + } + } +} \ No newline at end of file From 639431809f2534607e5084bb6320e91a7c6e23b5 Mon Sep 17 00:00:00 2001 From: MS-crew <100300664+MS-crew@users.noreply.github.com> Date: Tue, 27 Jan 2026 02:24:51 +0300 Subject: [PATCH 4/8] Update Draw.cs --- EXILED/Exiled.API/Features/Draw.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/EXILED/Exiled.API/Features/Draw.cs b/EXILED/Exiled.API/Features/Draw.cs index 1f1df60e2..024b015fa 100644 --- a/EXILED/Exiled.API/Features/Draw.cs +++ b/EXILED/Exiled.API/Features/Draw.cs @@ -128,8 +128,7 @@ private static void Send(Player player, float duration, Color color, params Vect if (player != null) { - DrawableLineMessage message = DrawableLines.ServerGenerateMessage(duration, color, points); - player.Connection.Send(message); + player.Connection.Send(new DrawableLineMessage(duration, color, positions)); } else { From 13b5dd61485b4f672ae915bf4eb2e95493c98df6 Mon Sep 17 00:00:00 2001 From: MS-crew <100300664+MS-crew@users.noreply.github.com> Date: Tue, 27 Jan 2026 02:29:12 +0300 Subject: [PATCH 5/8] Update Draw.cs --- EXILED/Exiled.API/Features/Draw.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EXILED/Exiled.API/Features/Draw.cs b/EXILED/Exiled.API/Features/Draw.cs index 024b015fa..30052d117 100644 --- a/EXILED/Exiled.API/Features/Draw.cs +++ b/EXILED/Exiled.API/Features/Draw.cs @@ -128,7 +128,7 @@ private static void Send(Player player, float duration, Color color, params Vect if (player != null) { - player.Connection.Send(new DrawableLineMessage(duration, color, positions)); + player.Connection.Send(new DrawableLineMessage(duration, color, points)); } else { From c01e518ddf6806f732af2c54538a04206b243c56 Mon Sep 17 00:00:00 2001 From: MS-crew <100300664+MS-crew@users.noreply.github.com> Date: Tue, 27 Jan 2026 02:34:24 +0300 Subject: [PATCH 6/8] Update Draw.cs --- EXILED/Exiled.API/Features/Draw.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EXILED/Exiled.API/Features/Draw.cs b/EXILED/Exiled.API/Features/Draw.cs index 30052d117..2aa42117a 100644 --- a/EXILED/Exiled.API/Features/Draw.cs +++ b/EXILED/Exiled.API/Features/Draw.cs @@ -132,7 +132,7 @@ private static void Send(Player player, float duration, Color color, params Vect } else { - DrawableLines.ServerGenerateLine(duration, color, positions: points); + NetworkServer.SendToReady(new DrawableLineMessage(duration, color, points)); } DrawableLines.IsDebugModeEnabled = debugWas; From 07f081902b4230e19120ccf4e504d87a4c35e7e4 Mon Sep 17 00:00:00 2001 From: MS-crew <100300664+MS-crew@users.noreply.github.com> Date: Tue, 27 Jan 2026 02:40:38 +0300 Subject: [PATCH 7/8] Update Draw.cs --- EXILED/Exiled.API/Features/Draw.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/EXILED/Exiled.API/Features/Draw.cs b/EXILED/Exiled.API/Features/Draw.cs index 2aa42117a..398a376a1 100644 --- a/EXILED/Exiled.API/Features/Draw.cs +++ b/EXILED/Exiled.API/Features/Draw.cs @@ -9,6 +9,8 @@ namespace Exiled.API.Features { using DrawableLine; + using Mirror; + using UnityEngine; /// From 1e56f9670bb8b73e15e83d72137bcf3896caaad4 Mon Sep 17 00:00:00 2001 From: MS-crew <100300664+MS-crew@users.noreply.github.com> Date: Tue, 27 Jan 2026 02:43:02 +0300 Subject: [PATCH 8/8] Update Draw.cs --- EXILED/Exiled.API/Features/Draw.cs | 9 --------- 1 file changed, 9 deletions(-) diff --git a/EXILED/Exiled.API/Features/Draw.cs b/EXILED/Exiled.API/Features/Draw.cs index 398a376a1..07de5bbca 100644 --- a/EXILED/Exiled.API/Features/Draw.cs +++ b/EXILED/Exiled.API/Features/Draw.cs @@ -125,19 +125,10 @@ private static void Send(Player player, float duration, Color color, params Vect if (points == null || points.Length < 2) return; - bool debugWas = DrawableLines.IsDebugModeEnabled; - DrawableLines.IsDebugModeEnabled = true; - if (player != null) - { player.Connection.Send(new DrawableLineMessage(duration, color, points)); - } else - { NetworkServer.SendToReady(new DrawableLineMessage(duration, color, points)); - } - - DrawableLines.IsDebugModeEnabled = debugWas; } } } \ No newline at end of file