Skip to content

Commit

Permalink
address luke's comment
Browse files Browse the repository at this point in the history
  • Loading branch information
IchHabeHunger54 committed Dec 2, 2024
1 parent a1746fe commit 887ed98
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/concepts/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ graph TD;
PlayerEvent-->CanPlayerSleepEvent;
class Event,BlockEvent,EntityEvent,LivingEvent,PlayerEvent red;
class BlockDropsEvent,CanPlayerSleepEvent blue;
```

### Cancellable Events
Expand Down
8 changes: 7 additions & 1 deletion docs/entities/livingentity.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down Expand Up @@ -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].
Expand Down
18 changes: 18 additions & 0 deletions src/pages/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<!-- Class1 is abstract, Class2 is not -->
```mermaid
graph LR;
Class1-->Class2;

class Class1 red;
class Class2 blue;
```
````

[docs]: https://github.com/neoforged/Documentation

[npm]: https://www.npmjs.com/
Expand All @@ -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

1 comment on commit 887ed98

@neoforged-pages-deployments
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploying with Cloudflare Pages

Name Result
Last commit: 887ed98fe3916c8539323d7c9ff5199f1783b83b
Status: ✅ Deploy successful!
Preview URL: https://fcc8ed66.neoforged-docs-previews.pages.dev
PR Preview URL: https://pr-171.neoforged-docs-previews.pages.dev

Please sign in to comment.