Files
zzz_REBIRTH__Utils/Harmony/Harmony_BlockMine.cs
2025-06-04 16:44:53 +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;
}
}
}