Upload from upload_mods.ps1
This commit is contained in:
27
Score/Fire/Harmony/UpdateCurrentBlockposAndValueFire.cs
Normal file
27
Score/Fire/Harmony/UpdateCurrentBlockposAndValueFire.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
namespace Features.Fire.Harmony
|
||||
{
|
||||
[HarmonyPatch(typeof(Block))]
|
||||
[HarmonyPatch("OnEntityWalking")]
|
||||
public class BlockOnEntityWalking
|
||||
{
|
||||
public static void Postfix(int _x, int _y, int _z, Entity entity)
|
||||
{
|
||||
if (FireManager.Instance == null) return;
|
||||
|
||||
var blockPosition = new Vector3i(_x, _y, _z);
|
||||
|
||||
if (!FireManager.IsBurning(blockPosition)) return;
|
||||
|
||||
if (!GameManager.IsDedicatedServer)
|
||||
if (!GameManager.Instance.HasBlockParticleEffect(blockPosition)) return;
|
||||
|
||||
if (entity is not EntityAlive entityAlive) return;
|
||||
|
||||
var buff = "buffBurningMolotov";
|
||||
if (!string.IsNullOrEmpty(buff))
|
||||
{
|
||||
entityAlive.Buffs.AddBuff(buff, -1, entityAlive.isEntityRemote);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user