From 3cb557c0e16b1f173a9a17d754a89f802cd8676d Mon Sep 17 00:00:00 2001 From: JaTiTV Date: Thu, 6 Jan 2022 01:55:39 +0100 Subject: [PATCH] Add permissionDescription --- ...{T2CodeLib_10_0.xml => T2CodeLib_10_1.xml} | 4 +- pom.xml | 2 +- .../lib/Spigot/Lib/register/Register.java | 7 ++-- .../lib/Spigot/Lib/update/UpdateAPI.java | 38 ++++++++++++++++-- target/classes/bungee.yml | 2 +- .../Lib/yamlConfiguration/BConfig.class | Bin 4692 -> 4692 bytes .../lib/Spigot/Lib/register/Register.class | Bin 2276 -> 2511 bytes .../lib/Spigot/Lib/update/UpdateAPI$3$1.class | Bin 1412 -> 1412 bytes .../lib/Spigot/Lib/update/UpdateAPI$3.class | Bin 3746 -> 3746 bytes .../lib/Spigot/Lib/update/UpdateAPI.class | Bin 9006 -> 9922 bytes target/classes/plugin.yml | 2 +- 11 files changed, 43 insertions(+), 12 deletions(-) rename .idea/artifacts/{T2CodeLib_10_0.xml => T2CodeLib_10_1.xml} (63%) diff --git a/.idea/artifacts/T2CodeLib_10_0.xml b/.idea/artifacts/T2CodeLib_10_1.xml similarity index 63% rename from .idea/artifacts/T2CodeLib_10_0.xml rename to .idea/artifacts/T2CodeLib_10_1.xml index eebabbb..7db3d92 100644 --- a/.idea/artifacts/T2CodeLib_10_0.xml +++ b/.idea/artifacts/T2CodeLib_10_1.xml @@ -1,7 +1,7 @@ - + $PROJECT_DIR$/../../Plugins/T2CodeLib/.jar - + diff --git a/pom.xml b/pom.xml index 97a1bb2..91ad358 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ net.t2code T2CodeLib - 10.0 + 10.1 jar T2CodeLib diff --git a/src/main/java/net/t2code/lib/Spigot/Lib/register/Register.java b/src/main/java/net/t2code/lib/Spigot/Lib/register/Register.java index a01af2f..81c30cf 100644 --- a/src/main/java/net/t2code/lib/Spigot/Lib/register/Register.java +++ b/src/main/java/net/t2code/lib/Spigot/Lib/register/Register.java @@ -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); + + } } diff --git a/src/main/java/net/t2code/lib/Spigot/Lib/update/UpdateAPI.java b/src/main/java/net/t2code/lib/Spigot/Lib/update/UpdateAPI.java index 983e409..d2313dc 100644 --- a/src/main/java/net/t2code/lib/Spigot/Lib/update/UpdateAPI.java +++ b/src/main/java/net/t2code/lib/Spigot/Lib/update/UpdateAPI.java @@ -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==========="); - send.console("§6A new version was found!"); + 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); - 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); + 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); diff --git a/target/classes/bungee.yml b/target/classes/bungee.yml index 6fb495f..452343e 100644 --- a/target/classes/bungee.yml +++ b/target/classes/bungee.yml @@ -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 \ No newline at end of file diff --git a/target/classes/net/t2code/lib/Bungee/Lib/yamlConfiguration/BConfig.class b/target/classes/net/t2code/lib/Bungee/Lib/yamlConfiguration/BConfig.class index bbe251407d2d786da2fb478963eafb8bd732c493..7e4eb60183f428a99aca42f12e7bfa7459295b53 100644 GIT binary patch delta 200 zcmWm5yAA&wNjk}1Ac`Pj^pta9af)+F_^BJ2h!jJbA>+f9 zA;*wsa6GjWMLtS=l>K^CTcb)JwKnSX(l%{$g&I0b7v2N!PnYPaB^AuQHQ+}V8beeu gLK9=OF`>KpO->;&gNZq6SfGU^I#{8PH9ex|KR-1n#{d8T delta 194 zcmcbjaz$l>JP#x9WCb2KPJRXs1_1^>2BArOl9M}loLEH}*ciknpXUkSlmtpi0i|R> zQjWY{obo^c1)zWuNMJ2cKouyU1{Bbk#Fxye4dmzmIeH-3R=#*fqsdSCLMFHHD@=~$ z*PeVHNH5{nX0)Gtf#03cd9s8+r>G}Tix&ewgExa7gAao>gD-;}gWu$B0xu+k7&sY% cfes5{&}Rr`uw@8ia9{{$aAt^@yj^fE07<OV diff --git a/target/classes/net/t2code/lib/Spigot/Lib/register/Register.class b/target/classes/net/t2code/lib/Spigot/Lib/register/Register.class index a60ec2404fe10df35f6685823eeaa0985a83c97e..aaa067a8fe43793432333c50f17db8c43ab7412d 100644 GIT binary patch delta 650 zcmYk3OHKko5QhJm;UNP-Kp2%V5hlbK0vaPOoJ8a;iimGrnkX@ts07$}1lO~0%@K$T z6Biu74VUm7#_EC$Y^u7e>i?>%`ZqXQP=EfuhX69T8K@tMt|Er45Bo?+@OPWNQnP#C zX|;Q;*O$+}@+2=u+Re^$tJ|f(Oin`H>dRp(s2=-IN>6j zqmG;8CGyVX7o-6lWaP<;G~hvjtZ!U^B1#-9V~HX;>&+G45w$95059gLQq*gF51@<+ z-GBfNP$h*2X>71^F{uEZfiiRI%o)13>r+mYI6C53VNMbb(ik?!zzID}a11nX%A*=g zRG4_i#Oz${Q4m9{UZr)$h!@8$sl)NVp=9jO%}!KT4he delta 463 zcmYk&%Syvg5XSL;lQwOm)Y@vP##`eJBo)NEFkscjd#x96=NtGmLKi-VxDye?of|hk zg3nQ$86}kibIyVJewm!l>i4++F?fCjT3kQ+5AM^8d*}4;y_FG<3^}y!^xwSNYFnE0 z2BYj+)pL$L_GK^9p>Dkcud$`QK91B9W3sfrX7{r6C31r@2OLVGNRxF--sIaIO_p$_ zR+ykl#N@wpQ+kgyEcucwypup?j-hqkp1Jt7{IRF3v diff --git a/target/classes/net/t2code/lib/Spigot/Lib/update/UpdateAPI$3$1.class b/target/classes/net/t2code/lib/Spigot/Lib/update/UpdateAPI$3$1.class index d429c197163e4c52ce6e7cdb683fe6b4dd080ff9..a692bb9f4e28498225f3205ece708814b19afea4 100644 GIT binary patch delta 23 ecmZqSZsFc=pM|k$@&lGc)>a02hPKIWtabok#s^pc delta 23 ecmZqSZsFc=pM^1H@&lGc)^rAWhK$K>tabohUsXyt{Q{7+4u%8MqnZ7^D~y88jJ^ l7_1nQ8JrkW7(y8`8Dbc+8B!T?7^)d^8JZaiCjaMM3;+TI5|sb| diff --git a/target/classes/net/t2code/lib/Spigot/Lib/update/UpdateAPI.class b/target/classes/net/t2code/lib/Spigot/Lib/update/UpdateAPI.class index da2a32823eeba3ded84371e435a0819b45f97da7..bc4cf6e578560d0fcfbf3ead7b6ff1320b6f5f39 100644 GIT binary patch delta 4294 zcmb7H4SZA875|?!dG958q-k1gL-{Bml%}l}R#97owpgK1DA@8*onQ!$wosCqq!bkl zIFUI&hTcuBL&fQ=pU7ugsLF<4o6}9VfjWn7?hEHO=O%NLDW3aY`T=bISboWS=iYnn zx##@vIsbdJ{gQ)oTrYpV|5*T~v~j2FEG6N>Qe3GbsACy?1nJg4G$9WUTTQR|*ZKNR=6 zCu%R@Wr@^}#g5F8;$wGtK@VQl@e}-%6Rjm2Ul?p{H`w@uf*Lno$In#!T*ohPh;X*p zl9nsBxSe91-ca%eW~+Gfq%x>mw$cd2ov`7TI^M>w2ufRPds7SN>{wBmHFlgFdPm2* z_%+8AHDa7GA)|)tglc?TXz%IxEq*6v47p8v9e>dAM;sMLhJ-W!M9|Gz2^;Z}1(()p z__J8zDOdigV?I6<_j^VUc^|j9@IL;o;~)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