Table of Contents

Class PlayerPatch

Namespace
ConfigurableWarning.Patches
Assembly
RedstoneWizard08.ContentLibrary.dll

Player & PlayerData patch

[HarmonyPatch]
public class PlayerPatch
Inheritance
PlayerPatch
Inherited Members

Methods

CheckOxygen(Player)

Patches the CheckOxygen value to add our custom stuff.

[HarmonyPrefix]
[HarmonyPatch(typeof(Player), "CheckOxygen")]
public static bool CheckOxygen(Player __instance)

Parameters

__instance Player

The current instance of a Player.

Returns

bool

HarmonyLib.HarmonyPrefix continue-or-not flag (this is a prefix)

GetMaxHealth()

Internal max health value.

public static float GetMaxHealth()

Returns

float

The custom max health value.

GetMaxOxygen()

Internal max oxygen value.

public static float GetMaxOxygen()

Returns

float

The custom max oxygen value.

UpdateValuesPost(PlayerData)

Patches the UpdateValues method to include our custom oxygen code

[HarmonyPostfix]
[HarmonyPatch(typeof(Player.PlayerData), "UpdateValues")]
public static void UpdateValuesPost(Player.PlayerData __instance)

Parameters

__instance Player.PlayerData

The current instance of a Player.PlayerData.

UpdateValuesPre(PlayerData)

Stores the current usingOxygen flag and modifies a few more things.

[HarmonyPrefix]
[HarmonyPatch(typeof(Player.PlayerData), "UpdateValues")]
public static bool UpdateValuesPre(Player.PlayerData __instance)

Parameters

__instance Player.PlayerData

The current instance of a Player.PlayerData.

Returns

bool

HarmonyLib.HarmonyPrefix continue-or-not flag (this is a prefix)