-
-
Notifications
You must be signed in to change notification settings - Fork 9
Custom Sign Demands
Note
If you think the sign demand you are creating would be a good fit for Create: Tramways, you could submit a pull request. Please ask in the Discord or Issues before submitting the feature.
You will need to either extend the SignDemand class or the AuxSignDemand class, depending on whether you are creating a tram/railway sign (a sign that is bound to the track) or an auxiliary sign (a sign that is not bound to the track).
After writing your implementation, you must register your sign demand using SignDemand.register (even if you are extending AuxSignDemand). Put this registration in a common (runs on both server and client) initialisation method.
Below is an explaination of some of the methods you could/need to implement. Not all methods are explained here, check the Javadoc for a full list.
Warning
This method should be annotated with @Environment(EnvType.CLIENT) (or similar). Servers will crash without it.
The ItemStack returned by this will be rendered on the sign settings screen.
Warning
This method should be annotated with @Environment(EnvType.CLIENT) (or similar). Servers will crash without it.
The PartialModel returned by this will be rendered along with the girder. You do not need to include the girder in your model, only the face in the right location.
You are supplied with the signType. Use this to conditionally return different styles (like a different style for railways and tramways). You shouldn't need to check this if you are making an auxiliary sign.
By default this method returns:
- Railway face (with red border) if
signTypeequalsSignType.RAILWAY - Tram face otherwise