Skip to content

Commit

Permalink
Checks if blockutil is implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
Thorinwasher committed Feb 18, 2024
1 parent 63381ac commit aa11f03
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/main/java/org/sgrewritten/stargate/Stargate.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,10 @@ public void onEnable() {
BStatsHelper.registerMetrics(pluginId, this, getRegistry());
servicesManager = this.getServer().getServicesManager();
servicesManager.register(StargateAPI.class, this, this, ServicePriority.High);
RegisteredServiceProvider<BlockUtilAPI> blockUtilProvider = servicesManager.getRegistration(BlockUtilAPI.class);
BlockDropManager.setProvider(blockUtilProvider);
if(NonLegacyClass.BLOCK_UTIL.isImplemented()) {
RegisteredServiceProvider<BlockUtilAPI> blockUtilProvider = servicesManager.getRegistration(BlockUtilAPI.class);
BlockDropManager.setProvider(blockUtilProvider);
}

} catch (StargateInitializationException | IOException | SQLException | URISyntaxException e) {
Stargate.log(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ public enum NonLegacyClass {
/**
* Check for bkcommonlib compatibility
*/
MULTI_BLOCK_CHANGE_EVENT("com.bergerkiller.bukkit.common.events.MultiBlockChangeEvent");
MULTI_BLOCK_CHANGE_EVENT("com.bergerkiller.bukkit.common.events.MultiBlockChangeEvent"),

BLOCK_UTIL("dev.thorinwasher.blockutil.BlockUtil");


private Class<?> aClass = null;
Expand Down

0 comments on commit aa11f03

Please sign in to comment.