2424import world .bentobox .aoneblock .listeners .InfoListener ;
2525import world .bentobox .aoneblock .listeners .ItemsAdderListener ;
2626import world .bentobox .aoneblock .listeners .JoinLeaveListener ;
27+ import world .bentobox .aoneblock .listeners .NexoListener ;
2728import world .bentobox .aoneblock .listeners .NoBlockHandler ;
2829import world .bentobox .aoneblock .listeners .StartSafetyListener ;
2930import world .bentobox .aoneblock .oneblocks .OneBlockCustomBlockCreator ;
3031import world .bentobox .aoneblock .oneblocks .OneBlocksManager ;
3132import world .bentobox .aoneblock .oneblocks .customblock .ItemsAdderCustomBlock ;
33+ import world .bentobox .aoneblock .oneblocks .customblock .NexoCustomBlock ;
3234import world .bentobox .aoneblock .requests .IslandStatsHandler ;
3335import world .bentobox .aoneblock .requests .LocationStatsHandler ;
3436import world .bentobox .bentobox .api .addons .GameModeAddon ;
@@ -53,6 +55,8 @@ public class AOneBlock extends GameModeAddon {
5355 private static final String THE_END = "_the_end" ;
5456 /** Whether ItemsAdder is present on the server */
5557 private boolean hasItemsAdder = false ;
58+ /** Whether Nexo is present on the server */
59+ private boolean hasNexo = false ;
5660
5761 /** The addon settings */
5862 private Settings settings ;
@@ -116,6 +120,13 @@ public void onLoad() {
116120 OneBlockCustomBlockCreator .register ("itemsadder" , ItemsAdderCustomBlock ::fromMap );
117121 hasItemsAdder = true ;
118122 }
123+ // Check if Nexo exists, if yes register listener
124+ if (Bukkit .getPluginManager ().getPlugin ("Nexo" ) != null ) {
125+ registerListener (new NexoListener (this ));
126+ OneBlockCustomBlockCreator .register (NexoCustomBlock ::fromId );
127+ OneBlockCustomBlockCreator .register ("nexo" , NexoCustomBlock ::fromMap );
128+ hasNexo = true ;
129+ }
119130 // Save the default config from config.yml
120131 saveDefaultConfig ();
121132 // Load settings from config.yml. This will check if there are any issues with
@@ -398,6 +409,13 @@ public boolean hasItemsAdder() {
398409 return hasItemsAdder ;
399410 }
400411
412+ /**
413+ * @return true if Nexo is on the server
414+ */
415+ public boolean hasNexo () {
416+ return hasNexo ;
417+ }
418+
401419 /**
402420 * Set the addon's world. Used only for testing.
403421 * @param world world
0 commit comments