Upload from upload_mods.ps1
This commit is contained in:
25
Harmony/Harmony_BlockMine.cs
Normal file
25
Harmony/Harmony_BlockMine.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user