Compare commits

...

3 Commits

Author SHA1 Message Date
JaTiTV
ad5d7e09ea Merge pull request 'UpdateAPI bug' (#3) from CloseInventory into main
Reviewed-on: #3
2022-01-11 02:59:54 +01:00
JaTiTV
c564cdead1 Merge branch 'main' into CloseInventory 2022-01-11 02:59:43 +01:00
2db5be7d56 UpdateAPI bug
When joining the server, it could happen that an error occurred, because the UpdateChecker had not yet checked the public version.
2022-01-11 02:58:00 +01:00
12 changed files with 7 additions and 9 deletions

View File

@ -1,7 +1,7 @@
<component name="ArtifactManager">
<artifact type="jar" name="T2CodeLib_10.1">
<artifact type="jar" name="T2CodeLib_10.2">
<output-path>$PROJECT_DIR$/../../Plugins/T2CodeLib/.jar</output-path>
<root id="archive" name="T2CodeLib_10.1.jar">
<root id="archive" name="T2CodeLib_10.2.jar">
<element id="module-output" name="T2CodeLib" />
</root>
</artifact>

View File

@ -6,7 +6,7 @@
<groupId>net.t2code</groupId>
<artifactId>T2CodeLib</artifactId>
<version>10.1</version>
<version>10.2</version>
<packaging>jar</packaging>
<name>T2CodeLib</name>

View File

@ -26,18 +26,17 @@ public class UpdateAPI {
public static void join(Plugin plugin, String prefix, String perm, Player player, String spigot, String discord) {
String pluginVersion = plugin.getDescription().getVersion();
String publicVersion = UpdateAPI.PluginVersionen.get(plugin.getName()).publicVersion;
if (!player.hasPermission(perm) || !player.isOp()) {
return;
}
if (publicVersion == null) {
if (UpdateAPI.PluginVersionen.get(plugin.getName()) == null) {
new BukkitRunnable() {
@Override
public void run() {
join(plugin, prefix, perm, player, spigot, discord);
}
}.runTaskLater(plugin, 20L);
} else use(plugin, prefix, player, pluginVersion, publicVersion, spigot, discord);
} else use(plugin, prefix, player, pluginVersion, UpdateAPI.PluginVersionen.get(plugin.getName()).publicVersion, spigot, discord);
}
private static void use(Plugin plugin, String prefix, Player player, String pluginVersion, String publicVersion, String spigot, String discord) {

View File

@ -21,7 +21,6 @@ import org.bukkit.plugin.java.JavaPlugin;
import java.io.File;
import java.util.List;
import java.util.Objects;
public final class Main extends JavaPlugin {

View File

@ -1,5 +1,5 @@
name: T2CodeLib
version: 10.1
version: 10.2
main: net.t2code.lib.Bungee.BMain
author: JaTiTV, Jkobs
description: Libarie from T2Code Plugins

View File

@ -1,5 +1,5 @@
name: T2CodeLib
version: 10.1
version: 10.2
main: net.t2code.lib.Spigot.system.Main
api-version: 1.13
prefix: T2CodeLib