Package codechicken.multipart.api
Class RegisterMultipartTraitsEvent
java.lang.Object
net.neoforged.bus.api.Event
codechicken.multipart.api.RegisterMultipartTraitsEvent
- All Implemented Interfaces:
net.neoforged.fml.event.IModBusEvent
public final class RegisterMultipartTraitsEvent
extends net.neoforged.bus.api.Event
implements net.neoforged.fml.event.IModBusEvent
Fired on the mod bus for mods to register their traits and passthrough interfaces
for
TileMultipart classes.
This is fired at the end of mod loading, from FMLLoadCompleteEvent.
Created by covers1624 on 20/1/24.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidregisterClientPassthroughInterface(Class<?> iFace) The same asregisterPassthroughInterface(Class)however, only effective client side.voidregisterClientTrait(Class<?> marker, Class<? extends TileMultipart> trait) The same asregisterTrait(Class, Class)however, only effective client side.voidregisterPassthroughInterface(Class<?> iFace) Register the specified class, when found on aMultiPartinstance:
- Implemented the interface on theTileMultipartinstance with all methods proxied through to your part.
- Only allow one instance of a part with this interface in the block space.voidregisterServerPassthroughInterface(Class<?> iFace) The same asregisterPassthroughInterface(Class)however, only effective server side (including integrated server).voidregisterServerTrait(Class<?> marker, Class<? extends TileMultipart> trait) The same asregisterTrait(Class, Class)however, only effective server side (including integrated server).voidregisterTrait(Class<?> marker, Class<? extends TileMultipart> trait) Registertraitto be mixed into theTileMultipartwhenmarkeris found implemented on aMultiPartinstance.
-
Constructor Details
-
RegisterMultipartTraitsEvent
-
-
Method Details
-
registerTrait
Registertraitto be mixed into theTileMultipartwhenmarkeris found implemented on aMultiPartinstance.- Parameters:
marker- The part marker class.trait- The trait to implement.
-
registerClientTrait
The same asregisterTrait(Class, Class)however, only effective client side.- Parameters:
marker- The part marker class.trait- The trait to implement.
-
registerServerTrait
The same asregisterTrait(Class, Class)however, only effective server side (including integrated server).- Parameters:
marker- The part marker class.trait- The trait to implement.
-
registerPassthroughInterface
Register the specified class, when found on aMultiPartinstance:
- Implemented the interface on theTileMultipartinstance with all methods proxied through to your part.
- Only allow one instance of a part with this interface in the block space.- Parameters:
iFace- The interface to register.
-
registerClientPassthroughInterface
The same asregisterPassthroughInterface(Class)however, only effective client side.- Parameters:
iFace- The interface to register.
-
registerServerPassthroughInterface
The same asregisterPassthroughInterface(Class)however, only effective server side (including integrated server).- Parameters:
iFace- The interface to register.
-