Adds Dynmap integration
Some checks failed
EpicKnarvik97/Stargate/pipeline/head There was a failure building this commit

This adds Dynmap integration for displaying Stargates in Dynmap
API version is changed back to 1.18 as 1.19 is still kind of new
Version is now 0.9.4.1
This commit is contained in:
2022-06-18 16:05:05 +02:00
parent 92c3eadf8f
commit 643a48392b
9 changed files with 223 additions and 17 deletions

View File

@ -15,6 +15,7 @@ import org.bukkit.World;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.plugin.messaging.Messenger;
import org.dynmap.DynmapAPI;
import java.io.File;
import java.io.IOException;
@ -101,6 +102,11 @@ public final class StargateConfig {
//Set up vault economy if vault has been loaded
setupVaultEconomy();
DynmapAPI dynmapAPI = (DynmapAPI) Bukkit.getPluginManager().getPlugin("dynmap");
if (dynmapAPI != null) {
DynmapManager.initialize(dynmapAPI);
DynmapManager.addAllPortalMarkers();
}
}
/**
@ -152,6 +158,24 @@ public final class StargateConfig {
return (boolean) configOptions.get(ConfigOption.PERMISSION_DEBUG);
}
/**
* Gets whether Dynmap integration is disabled
*
* @return <p>Whether Dynmap integration is disabled</p>
*/
public boolean isDynmapDisabled() {
return !((boolean) configOptions.get(ConfigOption.ENABLE_DYNMAP));
}
/**
* Gets whether Dynmap icons should be hidden by default
*
* @return <p>Whether Dynmap icons should be hidden by default</p>
*/
public boolean hideDynmapIcons() {
return (boolean) configOptions.get(ConfigOption.DYNMAP_ICONS_DEFAULT_HIDDEN);
}
/**
* Gets the object containing economy config values
*
@ -189,6 +213,9 @@ public final class StargateConfig {
startStopBungeeListener(stargateGateConfig.enableBungee());
}
//Reload portal markers
DynmapManager.addAllPortalMarkers();
messageSender.sendErrorMessage(sender, languageLoader.getString("reloaded"));
}