Decompiled source of StraftatNoBlood v1.0.0

StraftatNoBlood.dll

Decompiled 4 days ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using ComputerysModdingUtilities;
using HarmonyLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: StraftatMod(true)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("StraftatNoBlood")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("StraftatNoBlood")]
[assembly: AssemblyTitle("StraftatNoBlood")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace NoBloodMod;

[BepInPlugin("com.yourname.noblood", "No Blood Mod", "1.0.0")]
public class NoBloodPlugin : BaseUnityPlugin
{
	private void Awake()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Expected O, but got Unknown
		Harmony val = new Harmony("com.yourname.noblood");
		val.PatchAll();
		((BaseUnityPlugin)this).Logger.LogInfo((object)"No Blood Mod loaded!");
	}
}
[HarmonyPatch(typeof(Object), "Instantiate", new Type[]
{
	typeof(Object),
	typeof(Vector3),
	typeof(Quaternion)
})]
internal class NoBloodPatch
{
	private static bool Prefix(ref Object original)
	{
		if (original != (Object)null && original.name.ToLower().Contains("blood"))
		{
			Debug.Log((object)("[NoBloodMod] Blocked prefab: " + original.name));
			return false;
		}
		return true;
	}
}