File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -207,11 +207,17 @@ class DurabilityMechanicsManager implements Listener {
207
207
### Last step: register our mechanic
208
208
209
209
To finish we need to register our MechanicFactory and reload the items to apply the new mechanic to them.\
210
+ It is recommended to register it in an EventListener for ` OraxenNativeMechanicsRegisteredEvent ` , due to ` /oraxen reload all ` clearing this registry.\
210
211
To do this we need to add these lines in the onEnable method of our plugin:
211
212
212
213
``` java
213
- MechanicsManager . registerMechanicFactory(" durability" , DurabilityMechanicFactory :: new , true);
214
- OraxenItems . loadItems();
214
+ Bukkit . getPluginManager(). registerEvents(new Listener () {
215
+ @EventHandler
216
+ public void onMechanicRegister (OraxenNativeMechanicsRegisteredEvent event ) {
217
+ MechanicsManager . registerMechanicFactory(" durability" , DurabilityMechanicFactory :: new , true);
218
+ OraxenItems . loadItems();
219
+ }
220
+ }, this );
215
221
```
216
222
217
223
## Conclusion
You can’t perform that action at this time.
0 commit comments