Changes

41 bytes added ,  04:14, 27 July 2021
Copy Events to MC1.16 archive
Line 42: Line 42:     
==== Mod-Specific Event Buses ====
 
==== Mod-Specific Event Buses ====
The '''mod-specific event buses''' are the family of event buses where mod-related initialization and registration events are fired, such as the events for [[Registration|registering objects/1.16]] or setup on different physical sides. Only events which implement <code>IModBusEvent</code> may be fired or listened for on these event buses.
+
The '''mod-specific event buses''' are the family of event buses where mod-related initialization and registration events are fired, such as the events for [[Registration/1.16|registering objects]] or setup on different physical sides. Only events which implement <code>IModBusEvent</code> may be fired or listened for on these event buses.
    
Each loaded mod has their own instance of a mod-specific event bus. The mod-specific event bus for the currently loading mod can be retrieved from <code>FMLModContainer#getEventBus()</code>, which is also accessible from <code>FMLJavaModLoadingContext#getModEventBus()</code>.
 
Each loaded mod has their own instance of a mod-specific event bus. The mod-specific event bus for the currently loading mod can be retrieved from <code>FMLModContainer#getEventBus()</code>, which is also accessible from <code>FMLJavaModLoadingContext#getModEventBus()</code>.
Line 49: Line 49:     
==== Network Channel Event Buses ====
 
==== Network Channel Event Buses ====
The '''network channel event buses''' are the family of event buses where different network-related events are fired. Each registered [[Networking|networking channel/1.16]] has their own instance of an event-bus in <code>NetworkInstance</code>, where only events pertinent to that channel are fired on.
+
The '''network channel event buses''' are the family of event buses where different network-related events are fired. Each registered [[Networking/1.16|networking channel]] has their own instance of an event-bus in <code>NetworkInstance</code>, where only events pertinent to that channel are fired on.
    
The network channel event buses cannot be accessed directly; <code>EventNetworkChannel</code> provides methods to register events listeners to the event bus.
 
The network channel event buses cannot be accessed directly; <code>EventNetworkChannel</code> provides methods to register events listeners to the event bus.
Line 56: Line 56:  
An '''event listener''' (also known as an '''event handler''') is a class, object, or method registered to an event bus to capture for specific events (and their subclasses).
 
An '''event listener''' (also known as an '''event handler''') is a class, object, or method registered to an event bus to capture for specific events (and their subclasses).
   −
[[File:Guide to Event Handlers.png|thumb|upright 0.9|A visual guide on how event listeners are registered./1.16]]
+
[[File:Guide to Event Handlers.png/1.16|thumb|upright 0.9|A visual guide on how event listeners are registered.]]
    
An event listener may be registered in three ways:
 
An event listener may be registered in three ways:
Line 138: Line 138:  
* Config Events
 
* Config Events
 
* Data Provider Events
 
* Data Provider Events
and more, are fired on the Mod bus. See [[Stages of Modloading|mod loading events/1.16]]. Note that some of these are fired in parallel.
+
and more, are fired on the Mod bus. See [[Stages of Modloading/1.16|mod loading events]]. Note that some of these are fired in parallel.
    
== Sub Events ==
 
== Sub Events ==
Line 264: Line 264:  
These are the four most commonly used lifecycle events that are called during mod initialization on the mod event bus:  
 
These are the four most commonly used lifecycle events that are called during mod initialization on the mod event bus:  
 
* <code>FMLCommonSetupEvent</code>  
 
* <code>FMLCommonSetupEvent</code>  
* <code>FMLClientSetupEvent</code> & <code>FMLDedicatedServerSetupEvent</code> (''These events are only called on their respective [[Sides#Different_Kinds_of_Sides|physical side/1.16]].'')
+
* <code>FMLClientSetupEvent</code> & <code>FMLDedicatedServerSetupEvent</code> (''These events are only called on their respective [[Sides#Different Kinds of Sides/1.16|physical side]].'')
 
* <code>InterModEnqueueEvent</code>  
 
* <code>InterModEnqueueEvent</code>  
 
* <code>InterModProcessEvent</code>
 
* <code>InterModProcessEvent</code>
Line 354: Line 354:       −
[[Category:Events/1.16]]
+
[[Category:Events/1.16|Category:Events]]
      −
[[Category:Common Concepts/1.16]]
+
[[Category:Common Concepts/1.16|Category:Common Concepts]]
372

edits