Add permissionDescription

This commit is contained in:
JaTiTV 2022-01-06 01:55:39 +01:00
parent da2e9ff6a4
commit 3cb557c0e1
11 changed files with 43 additions and 12 deletions

View File

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

View File

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

View File

@ -5,9 +5,6 @@ import org.bukkit.permissions.Permission;
import org.bukkit.event.Listener;
import org.bukkit.permissions.PermissionDefault;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.Collections;
public class Register {
public static void listener(Listener listener, Plugin plugin) {
@ -35,4 +32,8 @@ public class Register {
plugin.getServer().getPluginManager().getPermission(permission).setDefault(setDefault);
plugin.getServer().getPluginManager().getPermission(permission).getChildren().put(children, setBoolean);
}
public static void permissionDescription(String permission, String description, Plugin plugin) {
plugin.getServer().getPluginManager().getPermission(permission).setDescription(description);
}
}

View File

@ -55,7 +55,19 @@ public class UpdateAPI {
public static void sendUpdateMsg(String Prefix, String Spigot, String Discord, String pluginVersion, String publicVersion) {
send.console("§4=========== " + Prefix + " §4===========");
if (publicVersion.toLowerCase().contains("dev") || publicVersion.toLowerCase().contains("beta") || publicVersion.toLowerCase().contains("snapshot")){
if (publicVersion.toLowerCase().contains("dev")){
send.console("§6A new §4DEV§6 version was found!");
}
if (publicVersion.toLowerCase().contains("beta")){
send.console("§6A new §2BETA§6 version was found!");
}
if (publicVersion.toLowerCase().contains("snapshot")){
send.console("§6A new §eSNAPSHOT§6 version was found!");
}
} else {
send.console("§6A new version was found!");
}
send.console("§6Your version: §c" + pluginVersion + " §7- §6Current version: §a" + publicVersion);
send.console("§6You can download it here: §e" + Spigot);
send.console("§6You can find more information on Discord: §e" + Discord);
@ -67,9 +79,27 @@ public class UpdateAPI {
return;
}
send.player(player, Prefix);
if (publicVersion.toLowerCase().contains("dev") || publicVersion.toLowerCase().contains("beta") || publicVersion.toLowerCase().contains("snapshot")){
if (publicVersion.toLowerCase().contains("dev")){
TextComponent comp = new TextBuilder(Prefix + " §6A new §4DEV§6 version was found!")
.addHover("§6You can download it here: §e" + Spigot).addClickEvent(ClickEvent.Action.OPEN_URL, Spigot).build();
player.spigot().sendMessage(comp);
}
if (publicVersion.toLowerCase().contains("beta")){
TextComponent comp = new TextBuilder(Prefix + " §6A new §2BETA§6 version was found!")
.addHover("§6You can download it here: §e" + Spigot).addClickEvent(ClickEvent.Action.OPEN_URL, Spigot).build();
player.spigot().sendMessage(comp);
}
if (publicVersion.toLowerCase().contains("snapshot")){
TextComponent comp = new TextBuilder(Prefix + " §6A new §eSNAPSHOT§6 version was found!")
.addHover("§6You can download it here: §e" + Spigot).addClickEvent(ClickEvent.Action.OPEN_URL, Spigot).build();
player.spigot().sendMessage(comp);
}
} else {
TextComponent comp = new TextBuilder(Prefix + " §6A new version was found!")
.addHover("§6You can download it here: §e" + Spigot).addClickEvent(ClickEvent.Action.OPEN_URL, Spigot).build();
player.spigot().sendMessage(comp);
}
TextComponent comp1 = new TextBuilder(Prefix + " §c" + pluginVersion + " §7-> §a" + publicVersion)
.addHover("§6You can download it here: §e" + Spigot).addClickEvent(ClickEvent.Action.OPEN_URL, Spigot).build();
player.spigot().sendMessage(comp1);

View File

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

View File

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