Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block Action -> ? #1319

Closed
Earthcomputer opened this issue May 1, 2020 · 6 comments · Fixed by #1323
Closed

Block Action -> ? #1319

Earthcomputer opened this issue May 1, 2020 · 6 comments · Fixed by #1323
Labels
discussion refactor A PR that renames existing names.

Comments

@Earthcomputer
Copy link
Contributor

What yarn currently calls "block actions" are used by:

  • Pistons (for pushing)
  • Note blocks (for playing a sound)
  • Bells (for ringing)
  • Chests (for the opening animation)
  • Ender chests (for the opening animation)
  • Shulker boxes (for the opening animation)
  • End gateways (for the beam)
  • Mob spawners (triggered when the mob spawns to reset the mob spinning speed)

"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?

@Prospector
Copy link
Contributor

Maybe go for simplicity... Sync Event?

@Juuxel
Copy link
Member

Juuxel commented May 1, 2020

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.

@Kroppeb
Copy link
Contributor

Kroppeb commented May 1, 2020

BlockEvent?

@YanisBft YanisBft added discussion refactor A PR that renames existing names. labels May 1, 2020
@Runemoro
Copy link
Contributor

Runemoro commented May 1, 2020

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.)

@Earthcomputer
Copy link
Contributor Author

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.

@Earthcomputer
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion refactor A PR that renames existing names.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants