3.10 changes

This commit is contained in:
okx-code
2020-11-24 23:28:03 +00:00
parent 7b1a6fd335
commit 3c01b7a664
7 changed files with 47 additions and 37 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ plugins {
}
group 'sh.okx'
version '3.10-alpha.1'
version '3.10'
repositories {
mavenCentral()
+10 -3
View File
@@ -151,8 +151,14 @@ public class RankupPlugin extends JavaPlugin {
}
if (config.getBoolean("ranks")) {
if (config.getBoolean("ranks-gui")) {
RanksGuiListener listener = new RanksGuiListener();
getCommand("ranks").setExecutor(new RanksGuiCommand(this, listener));
getServer().getPluginManager().registerEvents(listener, this);
} else {
getCommand("ranks").setExecutor(new RanksCommand(this));
}
}
if (config.getBoolean("prestige")) {
getCommand("prestige").setExecutor(new PrestigeCommand(this));
if (config.getBoolean("prestiges")) {
@@ -163,11 +169,8 @@ public class RankupPlugin extends JavaPlugin {
getCommand("maxrankup").setExecutor(new MaxRankupCommand(this));
}
RanksGuiListener listener = new RanksGuiListener();
getCommand("ranksgui").setExecutor(new RanksGuiCommand(this, listener));
getCommand("rankup").setExecutor(new RankupCommand(this));
getCommand("rankup3").setExecutor(new InfoCommand(this, notifier));
getServer().getPluginManager().registerEvents(listener, this);
getServer().getPluginManager().registerEvents(new GuiListener(this), this);
getServer().getPluginManager().registerEvents(
new JoinUpdateNotifier(notifier, () -> getConfig().getBoolean("notify-update"), "rankup.notify"), this);
@@ -451,16 +454,20 @@ public class RankupPlugin extends JavaPlugin {
Requirement money = rank.getRequirement(sender instanceof Player ? (Player) sender : null, "money");
if (money != null) {
Double amount = null;
Double total = null;
if (sender instanceof Player && rank.isIn((Player) sender)) {
if (economy != null) {
amount = money.getRemaining((Player) sender);
total = money.getTotal((Player) sender);
}
} else {
amount = money.getValueDouble();
total = 0D;
}
if (amount != null && economy != null) {
builder.replace(Variable.MONEY_NEEDED, formatMoney(amount));
builder.replace(Variable.MONEY, formatMoney(money.getValueDouble()));
builder.replace(Variable.MONEY_DONE, formatMoney(total));
}
}
if (sender instanceof Player) {
@@ -46,7 +46,8 @@ public class RankupCommand implements CommandExecutor {
String confirmationType = config.getString("confirmation-type").toLowerCase();
// if they are on text confirming, rank them up
if (confirmationType.equals("text") && confirming.containsKey(player)) {
// clicking on the gui cannot confirm a rankup
if (confirmationType.equals("text") && confirming.containsKey(player) && !(args.length > 0 && args[0].equalsIgnoreCase("gui"))) {
long time = System.currentTimeMillis() - confirming.remove(player);
if (time < config.getInt("text.timeout") * 1000) {
plugin.getHelper().rankup(player);
@@ -8,6 +8,7 @@ public enum Variable {
TO,
MONEY,
MONEY_NEEDED,
MONEY_DONE,
AMOUNT,
AMOUNT_NEEDED,
AMOUNT_DONE,
+5 -1
View File
@@ -8,7 +8,7 @@ version: 9
locale: en
# interval (in minutes) to check to autorankup players
# ranking up manually wil always be enabled
# ranking up manually will always be enabled
# set to 0 to disable
autorankup-interval: 0
@@ -20,6 +20,10 @@ ranks: true
# this will also make the command not autocomplete in 1.13
prestiges: true
# whether to enabable the /ranks GUI.
# will override the /ranks command
ranks-gui: false
# whether or not /prestige and /prestiges should be enabled.
# when a player reaches the top rank, they can do /prestige to return to the first rank,
# but you will be able to grant them an additional "prestige" group or additional items.
-1
View File
@@ -43,7 +43,6 @@ rankup:
rows: 3
offset: 10
width: 7
rankup:
complete:
material: GREEN_STAINED_GLASS_PANE
name: "&aRank &7{RANK} &a(completed)"
-2
View File
@@ -26,8 +26,6 @@ commands:
maxrankup:
permission: rankup.maxrankup
description: Rankup as much as possible.
ranksgui:
description: Show the ranks GUI
permissions:
rankup.*:
children: