The current BepInExPack is broken due to the Oakveil update, and mods installed through a mod manager may not work. Join the modding Discord for more information.
Decompiled source of CrimsonMoon v0.2.0
CrimsonMoon.dll
Decompiled 4 months agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Core.Logging.Interpolation; using BepInEx.Logging; using BepInEx.Unity.IL2CPP; using BepInEx.Unity.IL2CPP.Utils.Collections; using CrimsonMoon; using CrimsonMoon.Structs; using CrimsonMoon.Utils; using HarmonyLib; using Il2CppInterop.Runtime; using Il2CppInterop.Runtime.InteropTypes.Arrays; using ProjectM; using ProjectM.Network; using ProjectM.Physics; using ProjectM.Shared; using Stunlock.Core; using Unity.Collections; using Unity.Entities; using Unity.Mathematics; using Unity.Scenes; using Unity.Transforms; using UnityEngine; using VampireCommandFramework; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = "")] [assembly: AssemblyCompany("CrimsonMoon")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("A sacraficial alter to praise the moon! Honor it in return for a blood moon!")] [assembly: AssemblyFileVersion("0.2.0.0")] [assembly: AssemblyInformationalVersion("0.2.0+10.Branch.master.Sha.a94cb121c83689190a82981549f0af3a73e6bf95")] [assembly: AssemblyProduct("CrimsonMoon")] [assembly: AssemblyTitle("CrimsonMoon")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.2.0.0")] [module: UnverifiableCode] [HarmonyPatch] internal static class InitializationPatch { [HarmonyPatch(typeof(SceneSystem), "ShutdownStreamingSupport")] [HarmonyPostfix] private static void ShutdownStreamingSupportPostfix() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown Core.InitializeAfterLoaded(); if (Core._hasInitialized) { ManualLogSource logInstance = Plugin.LogInstance; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(16, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("|"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("CrimsonMoon"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("["); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("0.2.0"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("] initialized|"); } logInstance.LogInfo(val); Plugin.Harmony.Unpatch((MethodBase)typeof(SceneSystem).GetMethod("ShutdownStreamingSupport"), typeof(InitializationPatch).GetMethod("OneShot_AfterLoad_InitializationPatch")); } } } namespace CrimsonMoon { internal static class Core { public static bool _hasInitialized = false; private static MonoBehaviour mono; public static World Server { get; } = GetServerWorld() ?? throw new Exception("There is no Server world..."); public static DropClearSystem DropItem { get; internal set; } internal static void InitializeAfterLoaded() { if (!_hasInitialized) { DropItem = new DropClearSystem(); _hasInitialized = true; } } public static Coroutine StartCoroutine(IEnumerator routine) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown if ((Object)(object)mono == (Object)null) { GameObject val = new GameObject("CrimsonMoon"); mono = (MonoBehaviour)(object)val.AddComponent<IgnorePhysicsDebugSystem>(); Object.DontDestroyOnLoad((Object)val); } return mono.StartCoroutine(CollectionExtensions.WrapToIl2Cpp(routine)); } private static World GetServerWorld() { return ((IEnumerable<World>)World.s_AllWorlds.ToArray()).FirstOrDefault((Func<World, bool>)((World world) => world.Name == "Server")); } } [BepInPlugin("CrimsonMoon", "CrimsonMoon", "0.2.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BasePlugin { private Harmony _harmony; internal static Plugin Instance; public static Harmony Harmony => Instance._harmony; public static ManualLogSource LogInstance => ((BasePlugin)Instance).Log; public static Settings Settings { get; private set; } public override void Load() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown Instance = this; Settings = new Settings(((BasePlugin)this).Config); ManualLogSource log = ((BasePlugin)this).Log; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(27, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Plugin "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("CrimsonMoon"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" version "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("0.2.0"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" is loaded!"); } log.LogInfo(val); _harmony = new Harmony("CrimsonMoon"); _harmony.PatchAll(Assembly.GetExecutingAssembly()); CommandRegistry.RegisterAll(); } public override bool Unload() { CommandRegistry.UnregisterAssembly(); Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } return true; } } public static class MyPluginInfo { public const string PLUGIN_GUID = "CrimsonMoon"; public const string PLUGIN_NAME = "CrimsonMoon"; public const string PLUGIN_VERSION = "0.2.0"; } } namespace CrimsonMoon.Utils { internal class DropClearSystem { private EntityQuery dropItemQuery; public DropClearSystem() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) EntityQueryDesc val = new EntityQueryDesc(); val.All = Il2CppStructArray<ComponentType>.op_Implicit((ComponentType[])(object)new ComponentType[4] { new ComponentType(Il2CppType.Of<ItemPickup>(), (AccessMode)0), new ComponentType(Il2CppType.Of<PrefabGUID>(), (AccessMode)0), new ComponentType(Il2CppType.Of<Translation>(), (AccessMode)0), new ComponentType(Il2CppType.Of<DestroyWhenNoCharacterNearbyAfterDuration>(), (AccessMode)0) }); val.None = Il2CppStructArray<ComponentType>.op_Implicit((ComponentType[])(object)new ComponentType[1] { new ComponentType(Il2CppType.Of<AttachedBuffer>(), (AccessMode)1) }); val.Options = (EntityQueryOptions)2; EntityQueryDesc val2 = val; EntityManager entityManager = Core.Server.EntityManager; dropItemQuery = ((EntityManager)(ref entityManager)).CreateEntityQuery(val2.All); } private IEnumerable<Entity> GetDropItems() { NativeArray<Entity> entities = ((EntityQuery)(ref dropItemQuery)).ToEntityArray(AllocatorHandle.op_Implicit((Allocator)2)); Enumerator<Entity> enumerator = entities.GetEnumerator(); while (enumerator.MoveNext()) { Entity current = enumerator.Current; current.Read<PrefabGUID>(); yield return current; } entities.Dispose(); } private int ClearDropItems(Func<Entity, bool> shouldClear = null) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) int num = 0; DynamicBuffer<InventoryBuffer> val = default(DynamicBuffer<InventoryBuffer>); foreach (Entity dropItem in GetDropItems()) { if (shouldClear != null && !shouldClear(dropItem)) { continue; } EntityManager entityManager = Core.Server.EntityManager; if (((EntityManager)(ref entityManager)).TryGetBuffer<InventoryBuffer>(dropItem, ref val)) { Enumerator<InventoryBuffer> enumerator2 = val.GetEnumerator(); while (enumerator2.MoveNext()) { InventoryBuffer current2 = enumerator2.Current; NetworkedEntity itemEntity = current2.ItemEntity; if (!(((NetworkedEntity)(ref itemEntity)).GetEntityOnServer() == Entity.Null)) { EntityManager entityManager2 = Core.Server.EntityManager; itemEntity = current2.ItemEntity; DestroyUtility.Destroy(entityManager2, ((NetworkedEntity)(ref itemEntity)).GetEntityOnServer(), (DestroyDebugReason)0, (string)null, 0); } } } DestroyUtility.Destroy(Core.Server.EntityManager, dropItem, (DestroyDebugReason)0, (string)null, 0); num++; } return num; } public int ClearDropItemsInRadius(float3 pos, float radius) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) float2 posXZ = ((float3)(ref pos)).xz; return ClearDropItems(delegate(Entity entity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) Translation val = entity.Read<Translation>(); return math.distance(posXZ, ((float3)(ref val.Value)).xz) <= radius; }); } } public static class ECSExtensionService { public unsafe static void Write<T>(this Entity entity, T componentData) where T : struct { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) ComponentType val = default(ComponentType); ((ComponentType)(ref val))..ctor(Il2CppType.Of<T>(), (AccessMode)0); byte[] array = StructureToByteArray(componentData); int num = Marshal.SizeOf<T>(); fixed (byte* ptr = array) { EntityManager entityManager = Core.Server.EntityManager; ((EntityManager)(ref entityManager)).SetComponentDataRaw(entity, val.TypeIndex, (void*)ptr, num); } } public static byte[] StructureToByteArray<T>(T structure) where T : struct { int num = Marshal.SizeOf(structure); byte[] array = new byte[num]; IntPtr intPtr = Marshal.AllocHGlobal(num); Marshal.StructureToPtr(structure, intPtr, fDeleteOld: true); Marshal.Copy(intPtr, array, 0, num); Marshal.FreeHGlobal(intPtr); return array; } public unsafe static T Read<T>(this Entity entity) where T : struct { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) ComponentType val = default(ComponentType); ((ComponentType)(ref val))..ctor(Il2CppType.Of<T>(), (AccessMode)0); EntityManager entityManager = Core.Server.EntityManager; return Marshal.PtrToStructure<T>(new IntPtr(((EntityManager)(ref entityManager)).GetComponentDataRawRO(entity, val.TypeIndex))); } public static DynamicBuffer<T> ReadBuffer<T>(this Entity entity) where T : struct { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = Core.Server.EntityManager; return ((EntityManager)(ref entityManager)).GetBuffer<T>(entity, false); } public static void Add<T>(this Entity entity) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) ComponentType val = default(ComponentType); ((ComponentType)(ref val))..ctor(Il2CppType.Of<T>(), (AccessMode)0); EntityManager entityManager = Core.Server.EntityManager; ((EntityManager)(ref entityManager)).AddComponent(entity, val); } public static void Remove<T>(this Entity entity) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) ComponentType val = default(ComponentType); ((ComponentType)(ref val))..ctor(Il2CppType.Of<T>(), (AccessMode)0); EntityManager entityManager = Core.Server.EntityManager; ((EntityManager)(ref entityManager)).RemoveComponent(entity, val); } public static bool Has<T>(this Entity entity) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) ComponentType val = default(ComponentType); ((ComponentType)(ref val))..ctor(Il2CppType.Of<T>(), (AccessMode)0); EntityManager entityManager = Core.Server.EntityManager; return ((EntityManager)(ref entityManager)).HasComponent(entity, val); } public static void LogComponentTypes(this Entity entity) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown //IL_003d: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = Core.Server.EntityManager; Enumerator<ComponentType> enumerator = ((EntityManager)(ref entityManager)).GetComponentTypes(entity, (Allocator)2).GetEnumerator(); bool flag = default(bool); while (enumerator.MoveNext()) { ComponentType current = enumerator.Current; ManualLogSource logInstance = Plugin.LogInstance; BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(0, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<ComponentType>(current); } logInstance.LogInfo(val); } Plugin.LogInstance.LogInfo((object)"==="); } public static void LogComponentTypes(this EntityQuery entityQuery) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val; foreach (ComponentType item in (Il2CppArrayBase<ComponentType>)(object)((EntityQuery)(ref entityQuery)).GetQueryTypes()) { ManualLogSource logInstance = Plugin.LogInstance; val = new BepInExInfoLogInterpolatedStringHandler(22, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Query Component Type: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<ComponentType>(item); } logInstance.LogInfo(val); } ManualLogSource logInstance2 = Plugin.LogInstance; val = new BepInExInfoLogInterpolatedStringHandler(3, 0, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("==="); } logInstance2.LogInfo(val); } public static string LookupName(this PrefabGUID prefabGuid) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) PrefabCollectionSystem existingSystemManaged = Core.Server.GetExistingSystemManaged<PrefabCollectionSystem>(); object obj; if (!existingSystemManaged.PrefabGuidToNameDictionary.ContainsKey(prefabGuid)) { obj = "GUID Not Found"; } else { string text = existingSystemManaged.PrefabGuidToNameDictionary[prefabGuid]; PrefabGUID val = prefabGuid; obj = text + " " + ((object)(PrefabGUID)(ref val)).ToString(); } return obj.ToString(); } } } namespace CrimsonMoon.Structs { public struct PlayerData { public FixedString64Bytes CharacterName { get; set; } public ulong SteamID { get; set; } public bool IsOnline { get; set; } public Entity UserEntity { get; set; } public Entity CharEntity { get; set; } public PlayerData(FixedString64Bytes _characterName = default(FixedString64Bytes), ulong _steamID = 0uL, bool _isOnline = false, Entity _userEntity = default(Entity), Entity _charEntity = default(Entity)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) CharacterName = _characterName; SteamID = _steamID; IsOnline = _isOnline; UserEntity = _userEntity; CharEntity = _charEntity; } } public class Player { public string Name { get; set; } public ulong SteamID { get; set; } public bool IsOnline { get; set; } public bool IsAdmin { get; set; } public Entity User { get; set; } public Entity Character { get; set; } public Player(Entity userEntity = default(Entity), Entity charEntity = default(Entity)) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) User = userEntity; User val = User.Read<User>(); Character = val.LocalCharacter._Entity; Name = ((object)(FixedString64Bytes)(ref val.CharacterName)).ToString(); IsOnline = val.IsConnected; IsAdmin = val.IsAdmin; SteamID = val.PlatformId; } } public readonly struct Settings { internal readonly ConfigFile CONFIG; internal readonly ConfigEntry<bool> ENABLE_MOD; internal readonly ConfigEntry<double> ALTER_LOCATION_X; internal readonly ConfigEntry<double> ALTER_LOCATION_Y; internal readonly ConfigEntry<double> ALTER_LOCATION_Z; internal readonly ConfigEntry<int> SACRAFICE_GUID; internal readonly ConfigEntry<int> MIN_AMOUNT; public Settings(ConfigFile config) { CONFIG = config; ENABLE_MOD = config.Bind<bool>("Config", "EnableMod", true, "Enable or disable the mod"); SACRAFICE_GUID = config.Bind<int>("Sacrafice", "SacraficeGUID", 1566989408, "ItemHash for the sacraficed material"); MIN_AMOUNT = config.Bind<int>("Sacrafice", "MinimumRequired", 3, "This is how many must be dropped to trigger blood moon"); ALTER_LOCATION_X = config.Bind<double>("Alter", "AlterLocation_X", -1585.3368, "The float3 position of the alter, accepts sacrafices within 10 distance"); ALTER_LOCATION_Y = config.Bind<double>("Alter", "AlterLocation_Y", -3.8146, (ConfigDescription)null); ALTER_LOCATION_Z = config.Bind<double>("Alter", "AlterLocation_Z", -937.0102, (ConfigDescription)null); } } } namespace CrimsonMoon.Hooks { [HarmonyPatch] internal class Sacrafice { [HarmonyPatch(typeof(DropItemThrowSystem), "OnUpdate")] public class DropItemThrowSystem_Prefix { private EntityQuery dropItemQuery; public static void Prefix(DropItemThrowSystem __instance) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) EntityQuery _query_2070481711_ = __instance.__query_2070481711_0; Enumerator<Entity> enumerator = ((EntityQuery)(ref _query_2070481711_)).ToEntityArray(AllocatorHandle.op_Implicit((Allocator)3)).GetEnumerator(); DropItemAroundPosition val = default(DropItemAroundPosition); Vector3 val3 = default(Vector3); while (enumerator.MoveNext()) { Entity current = enumerator.Current; EntityManager entityManager = Core.Server.EntityManager; if (((EntityManager)(ref entityManager)).TryGetComponentData<DropItemAroundPosition>(current, ref val) && val.ItemHash == new PrefabGUID(Plugin.Settings.SACRAFICE_GUID.Value) && val.Amount >= Plugin.Settings.MIN_AMOUNT.Value) { Vector3 val2 = new Vector3(val.Position.x, val.Position.y, val.Position.z); ((Vector3)(ref val3))..ctor((float)Plugin.Settings.ALTER_LOCATION_X.Value, (float)Plugin.Settings.ALTER_LOCATION_Y.Value, (float)Plugin.Settings.ALTER_LOCATION_Z.Value); if (Vector3.Distance(val2, val3) < 10f) { ServerChatUtils.SendSystemMessageToAllClients(Core.Server.EntityManager, "The Blood Alter runs red!"); Core.Server.GetExistingSystemManaged<DebugEventsSystem>().JumpToNextBloodMoon(); Core.StartCoroutine(Clear(val3, 20)); } } } } private static IEnumerator Clear(Vector3 vector, int radius) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) yield return (object)new WaitForSeconds(1f); int value = Core.DropItem.ClearDropItemsInRadius(float3.op_Implicit(vector), radius); ServerChatUtils.SendSystemMessageToAllClients(Core.Server.EntityManager, $"Cleared {value}"); } } } } namespace CrimsonMoon.Commands { [CommandGroup("crimsonmoon", "cmoon")] internal class BloodMoon { [Command("trigger", "t", null, "Forces next moon to be blood", null, true)] public static void TriggerBloodMoon(ChatCommandContext ctx) { Core.Server.GetExistingSystemManaged<DebugEventsSystem>().JumpToNextBloodMoon(); ctx.Reply("Jumping to Next Blood Moon"); } } }