84 Commits
Author SHA1 Message Date
d5db22c23e Entity radius purge (#1030)
* Fixed world purges leaving orphaned entity data

co_entity has no world column, so /co purge r:#world deleted the kill
rows in co_block but kept every co_entity row. Those blobs became
orphans that no later purge removed.

- SQLite: copy only the co_entity rows that a retained kill row still
  references. This also drops orphans left by earlier purges.
- MySQL/DuckDB: delete the co_entity rows of the kill rows a world purge
  removes, before co_block is purged. MySQL uses a join so MariaDB and
  MySQL 5.7 do not run a dependent subquery. Global purges keep the
  cheaper time-based delete, which is equivalent. If MySQL stops between
  the two deletes, running the same purge again removes the remaining
  kill rows.

Player kills use the kill action with type 0 and a user id in data, so
they are never treated as co_entity references.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PdEuKbjcVoVinVQJq4te1f

* Fixed SQLite purges with world and block filters purging other tables

On SQLite, /co purge r:#world i:<block> built the retain condition for
world-scoped tables without checking the block restriction, so it purged
co_container, co_chat and the other world-scoped tables in that world
although a block restriction should leave them untouched. The
entity_container/entity_interaction branch and the MySQL path already
check it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PdEuKbjcVoVinVQJq4te1f

* Fixed console purges with a radius purging all worlds

/co purge rejects a numeric radius, but the check only saw the radius
when the sender had a location. From the console, /co purge t:30d r:50
parsed no radius and no world, so it ran as a server-wide purge. The
radius is now also parsed against a placeholder location, so it is
rejected for every sender. r:#world is unaffected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PdEuKbjcVoVinVQJq4te1f

* Added orphaned entity data cleanup to MySQL #optimize purges

MySQL deletes in place, so co_entity rows orphaned by earlier world
purges stay until something removes them. With #optimize, delete every
co_entity row that no kill row references, through a temporary table of
referenced ids (avoids an anti-join on the unindexed co_block.data), then
let OPTIMIZE reclaim the space. Failures are reported like the table
loop, so the entity_spawn link cleanup still runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PdEuKbjcVoVinVQJq4te1f

* Moved purge conditions into PurgeFilter

PurgeFilter now builds the purge condition for every table, and the
SQLite copy, the SQLite recovery path and the MySQL/DuckDB delete all use
it instead of three hand-built copies. Behavior is unchanged; the block
restriction check that the previous commit added to the SQLite copy is
part of the shared condition.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PdEuKbjcVoVinVQJq4te1f

* Added entity kill filters to purge command

/co purge rejected entity types and actions, so mob farm kill logs could
only be removed together with all other data. New arguments on SQLite,
MySQL and DuckDB:

- a:kill purges only entity kill rows.
- i:<entity> purges kills of those entity types; it can be combined with
  block types.
- e:<entity> keeps kills of those entity types while purging the rest.

Each purged kill also removes its co_entity row. a:kill with block types,
entity types in both i: and e:, e: with only block types in i:,
non-entity exclusions and entity filters on ClickHouse are rejected. Any
a: value other than a kill alias is rejected instead of falling through
to an unrestricted purge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PdEuKbjcVoVinVQJq4te1f

* Added radius support to purge command

/co purge rejected any numeric radius, so kills of one entity type could
only be purged across a whole world. A radius is now accepted when the
purge is restricted to co_block rows with i: or a:kill, for example
/co purge t:30d r:50 i:zombie. r:50x10 also limits the height.

The radius becomes an x/y/z range in the co_block condition. co_entity
rows follow the purged kill rows, so no entity data is orphaned, and the
(wid,x,z,time) index already covers the range. Other tables are left
untouched, as with any restricted purge.

Rejected: a radius without i: or a:kill, WorldEdit selections, radius
purges on ClickHouse, and a numeric radius from the console (it has no
location, as in the console radius fix merged into this branch).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PdEuKbjcVoVinVQJq4te1f

* Made MySQL entity data purges safe against concurrent writers

The #optimize orphan sweep snapshots the co_entity ids that kill rows
reference, then deletes every row missing from the snapshot. Another
installation sharing the database could commit a kill between the two
statements and lose its entity data. The sweep now only deletes rows
inside the purge time range. A kill always writes its co_entity row with
the current time, and a purge range ends at least 24 hours ago, so a
concurrent kill never matches.

A world purge deletes the entity data of the purged kills and
then the kill rows. On MySQL a failure or cancellation between the two
left kept kill rows without their rollback data. Both deletes now run in
one transaction.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Limited SQLite entity data cleanup to the purge time range

A SQLite purge dropped every co_entity row no kill referenced, including
rows newer than the purge range, and counted them as deleted. It now only
removes unreferenced rows inside the range, like the MySQL #optimize sweep.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Rejected purge include and exclude lists without a value

/co purge t:30d e: passed validation, parsed to no exclusions, and ran
as an unrestricted time purge. e:, and e:,,, did the same, as did an
e: at the end of the command and an empty i:. The argument check now
follows each include or exclude list across its continuation tokens and
rejects a list that ends without a value. Space-separated lists such as
e:zombie, villager still work.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Matched purge entity filters to kills logged under renamed types

Bukkit resolves a legacy name such as zombie_pigman to the renamed type,
so the filter only matched the id of the new name. e:zombie_pigman then
purged the old kills it was meant to keep, and i:zombie_pigman missed
them. The filter now covers every entity map id that resolves to the type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Rejected purges with more than one radius argument

/co purge t:30d r:50 r:#world_nether i:zombie ignored the explicit world
and purged around the player in their current world. Two r: arguments
always conflict, so the second one is now rejected before the purge
starts, whether it is a world, #global or another radius.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Applied max-radius to radius purges

A radius purge accepted any value. A radius past the int range saturated,
the area overflowed, and the purge reported success with nothing deleted.
It now stops at max-radius like lookups and rollbacks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Checked radius arguments inside purge include and exclude lists

/co purge t:30d i:zombie, r:50 r:#world_nether passed the second-radius
check: the validator took r:50 as a value of the include list, then saw
r:#world_nether as the only radius. The radius and world parsers read
both. A list now continues only with plain or minecraft: namespaced
values, so a radius after a trailing comma is counted and the second one
is rejected. This is the same change as 39deec3 on entity-kill-purge-filters.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LFQuzYmYun57wJi2a5mqkM

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: TonyJamesStark <tonyjamesstark1@gmail.com>
2026-10-05 17:46:22 -06:00
Intelli 0d96edbf2b Changed required ClickHouse version to v26.1 2026-09-25 15:40:28 -06:00
Intelli 3314d993a6 Bump API documentation to v13 2026-09-24 15:57:17 -06:00
Intelli 3af1079b51 v13 API documentation improvements 2026-09-21 13:15:49 -06:00
Intelli 37be5ebf15 Updated v13 API documentation 2026-09-21 12:59:07 -06:00
Mykhailo Alipa 5db696103a feat(api): add message prefix filters to typed lookups (#1001)
* feat(api): add message prefix filters to typed lookups

* refactor(api): reuse existing message filter helper directly

* chore: remove test file from message filter PR

* feat(api): make message prefix exclusions explicit

* refactor(api): name text prefix filters by their predicates
2026-09-21 12:35:23 -06:00
Intelli 11b4795bf3 Updated documentation 2026-09-16 15:36:25 -06:00
Mykhailo Alipa 45da5eee0c feat(api): extend typed block lookups and add entity lookup (#995)
* feat(api): add material filters to typed block lookup

* feat(api): support scoped typed block lookups

* refactor(api): simplify block material predicates

* feat(api): add typed entity lookup and filters

* fix(api): separate block history and optimize entity scopes

* fix(api): cast ClickHouse entity tracking IDs safely
2026-09-15 13:13:52 -06:00
Mykhailo Alipa 58587ed671 feat(api): add block and session action filters (#985) 2026-09-14 15:14:15 -06:00
Intelli 79ba793626 Fixed #summary not always returning correct row counts (fixes #991) 2026-09-14 13:07:01 -06:00
Intelli d93827f184 Added exclusion support to lookup filters 2026-09-09 18:40:49 -06:00
Mykhailo Alipa 06863f197c feat(api): add action filters to typed transaction lookups (#983)
* feat(api): add typed transaction action filters

* docs(api): clarify action filters for API consumers
2026-09-09 14:08:54 -06:00
Intelli 7dd70c45d5 Fixed ClickHouse user ownership and consumer failure handling 2026-09-08 20:23:41 -06:00
Intelli 548acc16dd Fixed ClickHouse event retention and identity reuse, and DuckDB indexing 2026-09-08 17:54:59 -06:00
Mykhailo Alipa edea5f105b feat(api): add user filters to typed lookups (#980)
* feat(api): add user filters to typed lookups

* docs(api): consolidate lookup filter options

* refactor(api): extract username inclusion filter resolution
2026-09-08 17:07:12 -06:00
Mykhailo Alipa e97878927e feat(api): add material filters to typed lookups (#979)
* feat(api): add typed material lookup filters

* fix(api): match normalized lookup materials

* fix(api): share stored material name resolution
2026-09-08 14:22:39 -06:00
Intelli f2eb0b0331 Improved multi-server support for columnar storage 2026-08-16 14:46:15 -06:00
Intelli a34e56e9d6 Lookup performance improvements 2026-08-01 10:25:58 -06:00
Intelli 6731831283 Added columnar storage options 2026-07-16 14:11:40 -06:00
Intelli 3151a25f3e Added entity spawn, movement, & transaction logging 2026-07-11 16:21:01 -06:00
Intelli eee8d1c39b Update blacklist version requirements in documentation 2026-06-01 20:16:55 -06:00
Intelli 1a9b542517 Link to other versions 2026-05-27 12:11:38 -06:00
2291e0d9c7 #810 Add option to give looked up items into inventory (#811)
* Add givable items to ItemUtils

* Improve performance of givable items methods

* Add ItemUtils#getItemStack

* Add ChatUtils#createGiveItemComponent

* Fix ChatUtils#createGiveItemComponent not returning empty String when no id is given

* Add 'give item' components to StandardLookupThread

* Add GivableItemIdParser

* Add CommandParser#parseGivableItemId

* Add Phrase#INVALID_ITEM_ID

* Add GiveCommand

* Update permissions.md

* Fix itemId parsing

* Improve performance of givable items methods

* Update coreprotect.give permission to be false by default

* Only show give component if player has permission to use the command

---------

Co-authored-by: Leonard Steppy <leonard.steppy@outlook.de>
Co-authored-by: Intelli <6790859+Intelli@users.noreply.github.com>
2026-05-27 10:47:57 -06:00
Intelli 5b2e8883ea Improve auto purge documentation 2026-05-20 13:01:12 -06:00
Intelli 6571e91c56 Formatting improvements 2026-05-20 12:56:31 -06:00
Intelli 434d42b547 Added auto-purge documentation 2026-05-20 12:45:54 -06:00
Intelli 3914e5e989 Update API doc plugin version to v24.0 2026-05-15 13:15:03 -06:00
Intelli ab939cfa6f Update API version from 11 to 12 in documentation 2026-05-15 11:39:36 -06:00
Intelli 688b4b930d Added inventoryLookup API method 2026-05-11 13:28:08 -06:00
Intelli cf04a42d3e Added itemLookup API method 2026-05-11 12:56:05 -06:00
Intelli bd5c1f33b7 API cleanup 2026-05-07 16:17:38 -06:00
Intelli a658c32ce4 Added usernameLookup API method 2026-05-06 15:49:02 -06:00
Intelli 592a4f25e4 Added typed block lookup methods 2026-05-06 15:27:14 -06:00
Intelli 29256b47e6 Added typed session lookups 2026-05-06 15:04:45 -06:00
Intelli 9924a9376e Added typed API helpers 2026-05-06 13:41:46 -06:00
Intelli cebcc8655a Added signLookup API methods 2026-05-06 13:31:39 -06:00
Intelli 3ffece26a3 Added chatLookup and commandLookup API methods 2026-05-05 16:01:14 -06:00
Intelli 7eaa88eb7f Added radius support for container lookup API 2026-05-05 13:58:24 -06:00
RestitutorandIntelli c4d3dda0ad Added Container Lookup API (#854)
* Add ContainerResult and BoxAPI

* Added area container lookup and "v12" docs

* Revert v11.md

* Simplify container API

---------

Co-authored-by: Intelli <contact@intelli.software>
2026-05-05 13:00:55 -06:00
Intelli a92a050d2f Extended CoreProtectPreLogEvent with Action, actionId, material, entityType, and message metadata (implements #846) 2026-04-24 11:03:38 -06:00
Intelli 14b0a712de Add v12.md template 2026-04-24 10:31:06 -06:00
Intelli 383caedff5 Changed blacklist.txt comment character to ';' (fixes #891) 2026-04-23 12:36:52 -06:00
Intelli b83b39feae Formatting fixes 2026-04-22 16:52:53 -06:00
Alisa GusmeroliandIntelli db94ad70eb Blacklist improvements (#847)
* add new blacklist features

* update documentation to include new blacklist additions

---------

Co-authored-by: Intelli <6790859+Intelli@users.noreply.github.com>
2026-04-22 16:36:15 -06:00
Intelli b0856b51a5 Update documentation 2026-01-22 16:58:23 -07:00
Intelli 893ce9af46 Update API docs 2025-12-15 13:50:50 -07:00
Intelli 8b3e37774a Added location to CoreProtectPreLogEvent (implements #709) 2025-09-02 18:05:30 -06:00
Intelli 6155d4e864 Update database-migration.md 2025-09-02 15:03:00 -06:00
Intelli 252de2f233 Update database-migration.md 2025-09-02 14:59:07 -06:00
Intelli cec40e384c Added database migration documentation 2025-09-02 14:52:27 -06:00