-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPersistentDrops.cs
More file actions
79 lines (59 loc) · 1.9 KB
/
PersistentDrops.cs
File metadata and controls
79 lines (59 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
using Oxide.Core.Libraries.Covalence;
using System.Collections.Generic;
using UnityEngine;
using Oxide.Core;
using Oxide.Plugins;
namespace Oxide.Plugins
{
[Info("PersistanceDrops", "Jake_Rich", 0.1)]
[Description("Item's dropped on ground won't despawn, without lagging the client")]
public class PersistentDrops : RustPlugin
{
public static PersistentDrops thisPlugin;
#region Writing
public void Output(params object[] text)
{
string str = "";
for (int i = 0; i < text.Length; i++)
{
str += text[i].ToString() + " ";
}
Puts(str);
}
public static void Write(params object[] text)
{
thisPlugin.Output(text);
}
public static void Write(object text)
{
thisPlugin.Output(text);
}
#endregion
public static Dictionary<Vector2, GridData> itemGrid = new Dictionary<Vector2, GridData>();
void Loaded()
{
thisPlugin = this;
}
void Unload()
{
}
void OnEntitySpawned(BaseNetworkable entity)
{
//Puts(entity.GetType().ToString());
if (entity.GetType() == typeof(DroppedItem))
{
DroppedItem item = (DroppedItem)(entity);
//Puts(item.gameObject);
//Puts(BasePlayer.activePlayerList[0].GetActiveItem()?.info.worldModelPrefab.resourcePath.ToString());
}
//Puts("OnEntitySpawned works!");
}
}
}
public class GridData
{
public HashSet<BasePlayer> subscribedPlayers = new HashSet<BasePlayer>();
public HashSet<BaseEntity> items = new HashSet<BaseEntity>();
public int versionNumber = 0;
public float timeCreated;
}