What yarn currently calls "block actions" are used by:
"Block actions" are triggered by the server, and processed by both the server and clients within range of the block (the "block action" is sent to these clients). Basically, it is used for events that also need to be processed on the client.
The yarn name is confusing and does not capture its actual purpose. It looks like a method you would want to call to simulate a right-click action or something. What should we call it instead?
Maybe go for simplicity... Sync Event?
There are also world events for worlds, which are basically the same thing but not dependent on a Block instance, so "[something] event" would be good.
"Sync event" is a bit ugly IMO but descriptive, so it could work.
BlockEvent?
I personally think action describes perfectly all of these. The word action just means "something that is done" (pushing, playing, ringing, opening, emitting a beam, etc.)
But this is more specific than simply something that is done, it's something that need to be done on the client. Look over this list again, and see if you can spot that pattern.
The problem with BlockEvent is that, although it's more commonly used throughout communities and is consistent with world event, the name has the exact same issues as "block action".
I therefore propose World.addBlockAction to be renamed to addSyncedBlockEvent and Block.onBlockAction to onSyncedBlockEvent. The class currently called BlockAction can be renamed to BlockEvent - it doesn't need to be SyncedBlockEvent because nothing about the class implies that it's synced.
Similarly, I propose world events to be renamed to synced world events to be clearer and more consistent with this.
Most helpful comment
The problem with
BlockEventis that, although it's more commonly used throughout communities and is consistent with world event, the name has the exact same issues as "block action".I therefore propose
World.addBlockActionto be renamed toaddSyncedBlockEventandBlock.onBlockActiontoonSyncedBlockEvent. The class currently calledBlockActioncan be renamed toBlockEvent- it doesn't need to beSyncedBlockEventbecause nothing about the class implies that it's synced.Similarly, I propose world events to be renamed to synced world events to be clearer and more consistent with this.