diff --git a/docs/concepts/events.md b/docs/concepts/events.md index 75dfb038..8fd043fe 100644 --- a/docs/concepts/events.md +++ b/docs/concepts/events.md @@ -120,6 +120,7 @@ graph TD; PlayerEvent-->CanPlayerSleepEvent; class Event,BlockEvent,EntityEvent,LivingEvent,PlayerEvent red; + class BlockDropsEvent,CanPlayerSleepEvent blue; ``` ### Cancellable Events diff --git a/docs/entities/livingentity.md b/docs/entities/livingentity.md index 8e53976f..0b7410e8 100644 --- a/docs/entities/livingentity.md +++ b/docs/entities/livingentity.md @@ -104,13 +104,16 @@ _See [Containers on Entities][containers]._ ## Hierarchy -Living entities have a complex class hierarchy. As mentioned before, there are three direct subclasses: +Living entities have a complex class hierarchy. As mentioned before, there are three direct subclasses (red classes are `abstract`, blue classes are not): ```mermaid graph LR; LivingEntity-->ArmorStand; LivingEntity-->Mob; LivingEntity-->Player; + + class LivingEntity,Mob,Player red; + class ArmorStand blue; ``` Of these, `ArmorStand` has no subclasses (and is also the only non-abstract class), so we will focus on the class hierarchy of `Mob` and `Player`. @@ -181,6 +184,9 @@ graph LR; AbstractClientPlayer-->RemotePlayer; Player-->ServerPlayer; ServerPlayer-->FakePlayer; + + class Player,AbstractClientPlayer red; + class LocalPlayer,RemotePlayer,ServerPlayer,FakePlayer blue; ``` - `AbstractClientPlayer`: This class is used as a base for the two client players, both used to represent players on the [logical client][logicalsides]. diff --git a/src/pages/contributing.md b/src/pages/contributing.md index 878cc881..b992ebfc 100644 --- a/src/pages/contributing.md +++ b/src/pages/contributing.md @@ -297,6 +297,23 @@ I'm within an admonition! ::: ``` +### Diagrams + +Diagrams can be created using the [Mermaid library][mermaid]. + +When creating a diagram, a convention is used to make `abstract` classes red and non-`abstract` classes blue. + +````md + +```mermaid +graph LR; + Class1-->Class2; + + class Class1 red; + class Class2 blue; +``` +```` + [docs]: https://github.com/neoforged/Documentation [npm]: https://www.npmjs.com/ @@ -313,6 +330,7 @@ I'm within an admonition! [eck]: http://math.hws.edu/javanotes/ [docusaurus]: https://docusaurus.io/docs/markdown-features +[mermaid]: https://mermaid.js.org/intro/ [mdx]: https://mdxjs.com/guides/ [admonition]: https://docusaurus.io/docs/markdown-features/admonitions