tutorial:blockentityrenderers
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
tutorial:blockentityrenderers [2019/08/13 14:31] – Register block entity renderers in ClientModInitializer jamieswhiteshirt | tutorial:blockentityrenderers [2019/08/13 15:43] – added more information for client entrypoint fudge | ||
---|---|---|---|
Line 22: | Line 22: | ||
} | } | ||
</ | </ | ||
- | And register | + | We're going to need to register our '' |
+ | This wouldn' | ||
+ | However, in a multiplayer setting, where the server runs in a different process than the client, the server code | ||
+ | has no concept of a " | ||
+ | To run initialization code only for the client, we need to setup a '' | ||
+ | |||
+ | Create a new class next to your main class that implements '' | ||
+ | <code java> | ||
+ | public class ExampleModClient implements ClientModInitializer { | ||
+ | @Override | ||
+ | public void onInitializeClient() { | ||
+ | // Here we will put client-only registration code | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Set this class as the '' | ||
+ | <code javascript " | ||
+ | " | ||
+ | [...] | ||
+ | " | ||
+ | { | ||
+ | " | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | And register | ||
<code java> | <code java> | ||
@Override | @Override | ||
public void onInitializeClient() { | public void onInitializeClient() { | ||
- | [...] | ||
BlockEntityRendererRegistry.INSTANCE.register(DemoBlockEntity.class, | BlockEntityRendererRegistry.INSTANCE.register(DemoBlockEntity.class, | ||
} | } |
tutorial/blockentityrenderers.txt · Last modified: 2023/02/09 13:14 by mschae23