mirror of
https://github.com/songoda/SongodaCore.git
synced 2025-02-25 07:51:20 +01:00
Merge branch 'development'
This commit is contained in:
commit
5197e20335
@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>SongodaCore-Modules</artifactId>
|
||||
<version>2.4.55</version>
|
||||
<version>2.4.56</version>
|
||||
<relativePath>../</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -56,7 +56,7 @@ public class SongodaCore {
|
||||
/**
|
||||
* This has been added as of Rev 6
|
||||
*/
|
||||
private final static String coreVersion = "2.4.55";
|
||||
private final static String coreVersion = "2.4.56";
|
||||
|
||||
/**
|
||||
* This is specific to the website api
|
||||
@ -85,7 +85,6 @@ public class SongodaCore {
|
||||
}
|
||||
|
||||
public static void registerPlugin(JavaPlugin plugin, int pluginID, String icon, String coreVersion) {
|
||||
boolean showAds = false;
|
||||
if (INSTANCE == null) {
|
||||
// First: are there any other instances of SongodaCore active?
|
||||
for (Class<?> clazz : Bukkit.getServicesManager().getKnownServices()) {
|
||||
@ -121,8 +120,6 @@ public class SongodaCore {
|
||||
// register ourselves as the SongodaCore service!
|
||||
INSTANCE = new SongodaCore(plugin);
|
||||
INSTANCE.init();
|
||||
PluginInfo info = INSTANCE.register(plugin, pluginID, icon, coreVersion);
|
||||
Bukkit.getScheduler().runTaskLater(plugin, () -> runAds(info), 100L);
|
||||
Bukkit.getServicesManager().register(SongodaCore.class, INSTANCE, plugin, ServicePriority.Normal);
|
||||
// we need (JavaPlugin plugin, int pluginID, String icon) for our object
|
||||
if (!otherPlugins.isEmpty()) {
|
||||
@ -150,12 +147,8 @@ public class SongodaCore {
|
||||
// register ourselves as the SongodaCore service!
|
||||
INSTANCE = new SongodaCore(plugin);
|
||||
INSTANCE.init();
|
||||
showAds = true;
|
||||
Bukkit.getServicesManager().register(SongodaCore.class, INSTANCE, plugin, ServicePriority.Normal);
|
||||
}
|
||||
PluginInfo info = INSTANCE.register(plugin, pluginID, icon, coreVersion);
|
||||
if (showAds)
|
||||
Bukkit.getScheduler().runTaskLater(plugin, () -> runAds(info), 100L);
|
||||
}
|
||||
|
||||
SongodaCore() {
|
||||
@ -202,28 +195,6 @@ public class SongodaCore {
|
||||
loginListener = null;
|
||||
}
|
||||
|
||||
private static void runAds(PluginInfo pluginInfo) {
|
||||
if (registeredPlugins.stream().noneMatch(p -> p.getJavaPlugin().getName().toLowerCase().contains("ultimate")))
|
||||
return;
|
||||
|
||||
JSONObject json = pluginInfo.getJson();
|
||||
JSONArray ads = (JSONArray) json.get("ads");
|
||||
|
||||
if (ads == null || ads.isEmpty())
|
||||
return;
|
||||
|
||||
ConsoleCommandSender console = Bukkit.getConsoleSender();
|
||||
console.sendMessage(String.format("%s---------------------- %sSongoda+ ads %s----------------------", ChatColor.GRAY.toString(),
|
||||
ChatColor.LIGHT_PURPLE.toString(), ChatColor.GRAY.toString()));
|
||||
for (Object o : ads) {
|
||||
JSONObject ad = (JSONObject) o;
|
||||
console.sendMessage(String.format("%s" + ad.get("patron") + " - " + ad.get("link")
|
||||
+ " - " + ad.get("descr"), ChatColor.DARK_PURPLE));
|
||||
}
|
||||
console.sendMessage(String.format("%s---------- %sPut your ad here patreon.songoda.com %s----------", ChatColor.GRAY.toString(),
|
||||
ChatColor.LIGHT_PURPLE.toString(), ChatColor.GRAY.toString()));
|
||||
}
|
||||
|
||||
private ArrayList<BukkitTask> tasks = new ArrayList();
|
||||
|
||||
private PluginInfo register(JavaPlugin plugin, int pluginID, String icon, String libraryVersion) {
|
||||
|
@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>SongodaCore-Modules</artifactId>
|
||||
<version>2.4.55</version>
|
||||
<version>2.4.56</version>
|
||||
<relativePath>../../</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>SongodaCore-Modules</artifactId>
|
||||
<version>2.4.55</version>
|
||||
<version>2.4.56</version>
|
||||
<relativePath>../../</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>SongodaCore-Modules</artifactId>
|
||||
<version>2.4.55</version>
|
||||
<version>2.4.56</version>
|
||||
<relativePath>../../</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>SongodaCore-Modules</artifactId>
|
||||
<version>2.4.55</version>
|
||||
<version>2.4.56</version>
|
||||
<relativePath>../../</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>SongodaCore-Modules</artifactId>
|
||||
<version>2.4.55</version>
|
||||
<version>2.4.56</version>
|
||||
<relativePath>../../</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>SongodaCore-Modules</artifactId>
|
||||
<version>2.4.55</version>
|
||||
<version>2.4.56</version>
|
||||
<relativePath>../../</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>SongodaCore-Modules</artifactId>
|
||||
<version>2.4.55</version>
|
||||
<version>2.4.56</version>
|
||||
<relativePath>../../</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>SongodaCore-Modules</artifactId>
|
||||
<version>2.4.55</version>
|
||||
<version>2.4.56</version>
|
||||
<relativePath>../../</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>SongodaCore-Modules</artifactId>
|
||||
<version>2.4.55</version>
|
||||
<version>2.4.56</version>
|
||||
<relativePath>../../</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>SongodaCore-Modules</artifactId>
|
||||
<version>2.4.55</version>
|
||||
<version>2.4.56</version>
|
||||
<relativePath>../../</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>SongodaCore-Modules</artifactId>
|
||||
<version>2.4.55</version>
|
||||
<version>2.4.56</version>
|
||||
<relativePath>../../</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>SongodaCore-Modules</artifactId>
|
||||
<version>2.4.55</version>
|
||||
<version>2.4.56</version>
|
||||
<relativePath>../../</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>SongodaCore-Modules</artifactId>
|
||||
<version>2.4.55</version>
|
||||
<version>2.4.56</version>
|
||||
<relativePath>../../</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>SongodaCore-Modules</artifactId>
|
||||
<version>2.4.55</version>
|
||||
<version>2.4.56</version>
|
||||
<relativePath>../../</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>SongodaCore-Modules</artifactId>
|
||||
<version>2.4.55</version>
|
||||
<version>2.4.56</version>
|
||||
<relativePath>../../</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>SongodaCore-Modules</artifactId>
|
||||
<version>2.4.55</version>
|
||||
<version>2.4.56</version>
|
||||
<relativePath>../../</relativePath>
|
||||
</parent>
|
||||
|
||||
|
@ -18,7 +18,7 @@ Maven Information
|
||||
<dependency>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>SongodaCore</artifactId>
|
||||
<version>2.4.55</version>
|
||||
<version>2.4.56</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
```
|
||||
@ -37,6 +37,6 @@ repositories {
|
||||
* Artifact:
|
||||
```groovy
|
||||
dependencies {
|
||||
compileOnly 'com.songoda:SongodaCore:2.4.55'
|
||||
compileOnly 'com.songoda:SongodaCore:2.4.56'
|
||||
}
|
||||
```
|
@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>com.songoda</groupId>
|
||||
<artifactId>SongodaCore-Modules</artifactId>
|
||||
<version>2.4.55</version>
|
||||
<version>2.4.56</version>
|
||||
<relativePath>../</relativePath>
|
||||
</parent>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user