Files
7d2dXG/Mods/zzz_REBIRTH__Utils/Harmony/Harmony_BlockMine.cs
Nathaniel Cosford 062dfab2cd Patched
2025-05-30 01:04:40 +09:30

26 lines
792 B
C#

namespace Harmony.BlockMinePatches
{
[HarmonyPatch(typeof(BlockMine))]
[HarmonyPatch("OnEntityWalking")]
public class OnEntityWalkingPatch
{
public static bool Prefix(BlockMine __instance, WorldBase _world, int _x, int _y, int _z, BlockValue _blockValue, Entity entity)
{
if (entity is EntityNPCRebirth)
{
if (entity.EntityClass.Properties.Values.ContainsKey("PreventTrapDamage"))
{
string preventTrapDamage = entity.EntityClass.Properties.Values["PreventTrapDamage"];
if (preventTrapDamage == "true")
{
return false;
}
}
}
return true;
}
}
}