Mod Version: 1.21.6
Summary: I'm trying to override a chisel behavior and can't figure out how to assert that a block is in chiseling process.
Detailed description:
namespace betterchisel.Client.Item
{
internal class ChiselOverrideBehavior(CollectibleObject collObj) : CollectibleBehavior(collObj)
{
public override void OnHeldAttackStart(
ItemSlot slot,
EntityAgent byEntity,
BlockSelection blockSel,
EntitySelection entitySel,
ref EnumHandHandling handHandling,
ref EnumHandling handling
)
{
if (byEntity.World.Side != EnumAppSide.Client)
{
return;
}
if (entitySel != null)
{
return;
}
if (blockSel == null)
{
return;
}
var pos = blockSel.Position;
var blockEntity = byEntity.World.BlockAccessor.GetBlockEntity(pos);
if (blockEntity is not ) // That's where I've just stuck
handling = EnumHandling.PreventDefault;
}
}
}
I don't know how to assert that blockEntity relates to chiseled one. By "chiseld one" I mean the block transformation after you pressing RMB with chisel and hammer in right hand on it.
The goal is to cancel method handling if block is not in process of chiseling. Also I would really appreciate some examples of how I can edit voxel grid of a chiseled block.
That's my first mod for VS and also my first experience with C#. But I have Java background
Already Tried:
I searched classes with "Chisel" in their name in API namespace but found nothing. ChatGPT trying to convince me that somewhere exists class named BlockEntityChisel and it is placed somewhere in game content, but I've searched the content of VintageStoryLib.dll and didn't found anything relative.