/*
* olds_blockmaker.inc - block API of the olds.ro Block Maker core, used by add-ons such as
* Block Undo History. Copyright (C) 2026 daemon (olds.ro). GPL-3.0-or-later.
*
* The core fires the forwards for every block it creates, moves (or turns) and deletes,
* also when the builder is 0 (the console or a layout load). A builder is a player index.
*/
#if defined _olds_blockmaker_included
#endinput
#endif
#define _olds_blockmaker_included
#pragma reqlib olds_blockmaker
#if !defined AMXMODX_NOAUTOLOAD
#pragma loadlib olds_blockmaker
#endif
/* Longest block type name, with the terminator. */
#define OLDS_BM_TYPE_LEN 16
/*
* Creates a block for the builder, as the builder would (limits and turned-off types apply).
* Fires olds_bm_block_created. Returns the entity, or 0 when the core refuses.
*/
native olds_bm_create_block(builder, const type[], const Float:origin[3], const Float:angles[3], const Float:size[3]);
/* Moves or turns a block. Fires olds_bm_block_moved. Returns 1, or 0 when ent is not a block. */
native olds_bm_move_block(builder, ent, const Float:origin[3], const Float:angles[3]);
/* Deletes a block. Fires olds_bm_block_deleted first. Returns 1, or 0 when ent is not a block. */
native olds_bm_delete_block(builder, ent);
/* 1 when ent is a block of the core. */
native olds_bm_is_block(ent);
/* Reads a block: its type, origin, angles and size (maxs - mins). Returns 0 when ent is not a block. */
native olds_bm_get_block(ent, type[], len, Float:origin[3], Float:angles[3], Float:size[3]);
/* A block was created. */
forward olds_bm_block_created(builder, ent);
/* A block was moved or turned; it already has its new origin and angles. */
forward olds_bm_block_moved(builder, ent, const Float:oldOrigin[3], const Float:oldAngles[3]);
/* A block is about to be deleted; it can still be read. */
forward olds_bm_block_deleted(builder, ent);