Add dispensers config option to disable dispenser logging (fixes #727) - #989
Conversation
|
Please ensure that the bone-meal filter identifies actual dispenser activity instead of suppressing all #bonemeal events, which also hides growth caused by other plugins. Also apply dispensers: false to dispenser ignition in BlockIgniteListener. |
|
The bone meal filter now only covers actual dispenser activity, and The hand-off in
Testing:
With With Not tested: droppers, lava, and entities spawned by dispensers. |
|
Please restrict bone-meal tracking to actual dispensers so a dropper ejecting bone meal cannot accidentally prevent CoreProtect from logging plant growth caused by another plugin. Also ensure dispensers: false still prevents fire-charge ignition logging if the dispenser is removed before impact. |
|
Bone meal tracking now requires the block to be an actual dispenser, and fire charge ignition no longer depends on the dispenser still being there. Bone mealDroppers report the same I reproduced the old behavior with a test plugin that applies bone meal to the faced block from its own dispense listener, running after CoreProtect's. With Fire chargeFireball ignitions report no igniting block, so the check fell back to the shooter's block at the moment of impact. That is whatever occupies the dispenser's position by then, and it is air once the dispenser has been broken. The check now asks whether the fireball's shooter is a Reproduced first: a dispenser at (350,-40,420) with a fire charge, powered and then removed before the fireball landed, wrote a Droppers cannot launch projectiles, so the shooter check cannot pick one up: a dropper holding a fire charge ejected it as an item, with no projectile spawn event and no ignition. Verification
One scope note from the same run: TNT primed by a dispenser's flint and steel still writes its block row as |
|
Thanks for addressing the dispenser/dropper distinction and fire-charge ignition after the dispenser is removed. Please clarify the dispensers config header: it controls direct dispenser block changes, including bucket use, ignition, and bone-meal growth. Subsequent fluid flow, fire spread, and TNT priming/explosions remain controlled by their existing options. Keep the current TNT behavior and attribution unchanged; no need to extend this PR into the TNT listeners. |
|
The # Logs direct block changes caused by dispensers: bucket use, ignition,
# and the growth caused by dispensed bone meal. Fluid flow, fire spread,
# and TNT priming and explosions remain controlled by their own options.This commit only changes that header string in The header is emitted through the existing multi-line header path, the same one used by entries such as Build: |
Adds a dispensers config option that controls whether CoreProtect logs the world changes a dispenser causes. It defaults to true, so existing installations keep their current behavior. Fixes #727.
Problem
#727 asks for a way to stop dispensers from writing a row for every block they change, which adds up fast on farms, without turning off player block logging. Setting
block-place: falsestops those rows today, but it stops player block logging with them. A comment in the issue also asks for dispensed bone meal.Fix
Config.javagains aDISPENSERSfield, adispensersentry in the generated config.yml, and a header explaining it, placed afterpistons.Three listeners read it.
BlockDispenseListenerreturns before queueing any world change when the option is off. The return sits after the dispenser item transaction and after the bone meal hand-off, so neither is affected.BlockFertilizeListenerskips growth attributed to a dispenser. The hand-off inBlockDispenseListenerrecords the block a dispenser's bone meal was applied to, and it does so only when the block is an actual dispenser, so a dropper ejecting bone meal cannot claim a block that another plugin then grows. Bone meal that other plugins apply without a player stays#bonemealand is still logged.BlockIgniteListenerskips ignition caused by a dispenser. Flint and steel is matched throughgetIgnitingBlock(). A fire charge becomes a fireball that reports no igniting block, so it is matched through the fireball's shooter being aBlockProjectileSource, which still identifies the dispenser after the block itself has been broken.Testing
Build:
mvn -B verifyon JDK 25, BUILD SUCCESS.Live: Paper 26.2 build 123, flat world, DuckDB storage, CoreProtect built from this branch. I drove the server over RCON and read the plugin's DuckDB tables afterwards. A helper plugin applies bone meal with no player for the other-plugin cases, including from a dropper's own dispense event when testing whether a dropper can claim the block.
With
dispensers: true:#bonemeal. Before this revision that row was logged as#dispenser.#dispenserthere.#fire.#fireat (340,-60,450) with the dispenser in place, and at (351,-60,450) when the dispenser was removed while the fireball was still in the air. The removal was confirmed withexecute if blockbefore the fireball landed.#bonemealat (360,-60,450).#dispenser. Water dispensed onto open ground at (400,-60,450) was logged as#dispenser, and the blocks the water spread into were logged as#water.With
dispensers: false, applied by/co reload:execute if block) and wrote no block rows.#bonemeal, and the water flowing from (400,-60,470) still wrote#waterrows.Not tested: entities spawned by dispensers, and per-world configuration files.
Notes
Dispenser and dropper item transactions stay under
item-transactions, and entities that dispensers spawn stay underentity-spawns. Water or lava that flows after a dispenser places the source is still logged underwater-flowandlava-flow, like any other source. Only the initial ignition is attributed to the dispenser; fire that spreads afterwards has no dispenser source and is logged as before.TNT primed by a dispenser's flint and steel keeps its current attribution. Both the TNT break row and the explosion rows are written as
#tnt, and both follow theexplosionsoption: they disappear withexplosions: falseand stay in place withdispensers: false. The dispenser is not named on those rows.docs/config.mddoes not list the logging options, so the option is documented in its config.yml header. Happy to add a section to that page as well.