### Initialize MultiVersionEventHandlerManager (SupportBuilder)
Source: https://github.com/andrei1058/multiversioneventhandler/blob/main/README.md
Initialize the event manager using SupportBuilder.init(). This method returns null if the server version is not supported.
```java
public class MyPlugin extends JavaPlugin {
private static MultiVersionEventHandlerManager eventManager;
public void onEnable() {
eventManager = MultiVersionEventHandlerManager.SupportBuilder.init();
if (eventManager == null){
//this server version is not supported
Bukkit.getPluginManager().disablePlugin(this);
}
}
}
```
--------------------------------
### Initialize MultiVersionEventHandlerManager (Default)
Source: https://github.com/andrei1058/multiversioneventhandler/blob/main/README.md
Initialize the event manager using the default init() method. This method returns null if the server version is not supported.
```java
public class MyPlugin extends JavaPlugin {
private static MultiVersionEventHandlerManager eventManager;
public void onEnable() {
eventManager = MultiVersionEventHandlerManager.init();
if (eventManager == null){
//this server version is not supported
Bukkit.getPluginManager().disablePlugin(this);
return;
}
// register versioned listener
eventManager.register(this, new MyPickUpListener(), EventPriority.NORMAL);
}
}
```
--------------------------------
### Maven Repository Configuration
Source: https://github.com/andrei1058/multiversioneventhandler/blob/main/README.md
Add the CodeMC repository to your Maven project to access the library.
```xml
codeMC
https://repo.codemc.io/repository/maven-public/
```
--------------------------------
### Implement Wrapped EntityPickUpEvent
Source: https://github.com/andrei1058/multiversioneventhandler/blob/main/README.md
Implement this interface to handle the EntityPickUpEvent. Return true to cancel the event.
```java
import com.andrei1058.spigot.multiversioneventhandler.WrappedEntityPickUpEvent;
public class MyPickUpListener implements WrappedEntityPickUpEvent {
@Override
public boolean onEntityPickUpItemStack(Entity entity, Item item, int remaining){
// true if you want to cancel the event
return false;
}
}
```
--------------------------------
### Maven Dependency for support_shaded
Source: https://github.com/andrei1058/multiversioneventhandler/blob/main/README.md
Include the support_shaded artifact as a dependency in your Maven project.
```xml
com.andrei1058.spigot.multiversioneventhandler
support_shaded
1.0
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.