3.10 changes
This commit is contained in:
+1
-1
@@ -4,7 +4,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group 'sh.okx'
|
group 'sh.okx'
|
||||||
version '3.10-alpha.1'
|
version '3.10'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
|||||||
@@ -151,8 +151,14 @@ public class RankupPlugin extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (config.getBoolean("ranks")) {
|
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));
|
getCommand("ranks").setExecutor(new RanksCommand(this));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (config.getBoolean("prestige")) {
|
if (config.getBoolean("prestige")) {
|
||||||
getCommand("prestige").setExecutor(new PrestigeCommand(this));
|
getCommand("prestige").setExecutor(new PrestigeCommand(this));
|
||||||
if (config.getBoolean("prestiges")) {
|
if (config.getBoolean("prestiges")) {
|
||||||
@@ -163,11 +169,8 @@ public class RankupPlugin extends JavaPlugin {
|
|||||||
getCommand("maxrankup").setExecutor(new MaxRankupCommand(this));
|
getCommand("maxrankup").setExecutor(new MaxRankupCommand(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
RanksGuiListener listener = new RanksGuiListener();
|
|
||||||
getCommand("ranksgui").setExecutor(new RanksGuiCommand(this, listener));
|
|
||||||
getCommand("rankup").setExecutor(new RankupCommand(this));
|
getCommand("rankup").setExecutor(new RankupCommand(this));
|
||||||
getCommand("rankup3").setExecutor(new InfoCommand(this, notifier));
|
getCommand("rankup3").setExecutor(new InfoCommand(this, notifier));
|
||||||
getServer().getPluginManager().registerEvents(listener, this);
|
|
||||||
getServer().getPluginManager().registerEvents(new GuiListener(this), this);
|
getServer().getPluginManager().registerEvents(new GuiListener(this), this);
|
||||||
getServer().getPluginManager().registerEvents(
|
getServer().getPluginManager().registerEvents(
|
||||||
new JoinUpdateNotifier(notifier, () -> getConfig().getBoolean("notify-update"), "rankup.notify"), this);
|
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");
|
Requirement money = rank.getRequirement(sender instanceof Player ? (Player) sender : null, "money");
|
||||||
if (money != null) {
|
if (money != null) {
|
||||||
Double amount = null;
|
Double amount = null;
|
||||||
|
Double total = null;
|
||||||
if (sender instanceof Player && rank.isIn((Player) sender)) {
|
if (sender instanceof Player && rank.isIn((Player) sender)) {
|
||||||
if (economy != null) {
|
if (economy != null) {
|
||||||
amount = money.getRemaining((Player) sender);
|
amount = money.getRemaining((Player) sender);
|
||||||
|
total = money.getTotal((Player) sender);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
amount = money.getValueDouble();
|
amount = money.getValueDouble();
|
||||||
|
total = 0D;
|
||||||
}
|
}
|
||||||
if (amount != null && economy != null) {
|
if (amount != null && economy != null) {
|
||||||
builder.replace(Variable.MONEY_NEEDED, formatMoney(amount));
|
builder.replace(Variable.MONEY_NEEDED, formatMoney(amount));
|
||||||
builder.replace(Variable.MONEY, formatMoney(money.getValueDouble()));
|
builder.replace(Variable.MONEY, formatMoney(money.getValueDouble()));
|
||||||
|
builder.replace(Variable.MONEY_DONE, formatMoney(total));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (sender instanceof Player) {
|
if (sender instanceof Player) {
|
||||||
|
|||||||
@@ -46,7 +46,8 @@ public class RankupCommand implements CommandExecutor {
|
|||||||
String confirmationType = config.getString("confirmation-type").toLowerCase();
|
String confirmationType = config.getString("confirmation-type").toLowerCase();
|
||||||
|
|
||||||
// if they are on text confirming, rank them up
|
// 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);
|
long time = System.currentTimeMillis() - confirming.remove(player);
|
||||||
if (time < config.getInt("text.timeout") * 1000) {
|
if (time < config.getInt("text.timeout") * 1000) {
|
||||||
plugin.getHelper().rankup(player);
|
plugin.getHelper().rankup(player);
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ public enum Variable {
|
|||||||
TO,
|
TO,
|
||||||
MONEY,
|
MONEY,
|
||||||
MONEY_NEEDED,
|
MONEY_NEEDED,
|
||||||
|
MONEY_DONE,
|
||||||
AMOUNT,
|
AMOUNT,
|
||||||
AMOUNT_NEEDED,
|
AMOUNT_NEEDED,
|
||||||
AMOUNT_DONE,
|
AMOUNT_DONE,
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ version: 9
|
|||||||
locale: en
|
locale: en
|
||||||
|
|
||||||
# interval (in minutes) to check to autorankup players
|
# 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
|
# set to 0 to disable
|
||||||
autorankup-interval: 0
|
autorankup-interval: 0
|
||||||
|
|
||||||
@@ -20,6 +20,10 @@ ranks: true
|
|||||||
# this will also make the command not autocomplete in 1.13
|
# this will also make the command not autocomplete in 1.13
|
||||||
prestiges: true
|
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.
|
# 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,
|
# 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.
|
# but you will be able to grant them an additional "prestige" group or additional items.
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ rankup:
|
|||||||
rows: 3
|
rows: 3
|
||||||
offset: 10
|
offset: 10
|
||||||
width: 7
|
width: 7
|
||||||
rankup:
|
|
||||||
complete:
|
complete:
|
||||||
material: GREEN_STAINED_GLASS_PANE
|
material: GREEN_STAINED_GLASS_PANE
|
||||||
name: "&aRank &7{RANK} &a(completed)"
|
name: "&aRank &7{RANK} &a(completed)"
|
||||||
|
|||||||
@@ -26,8 +26,6 @@ commands:
|
|||||||
maxrankup:
|
maxrankup:
|
||||||
permission: rankup.maxrankup
|
permission: rankup.maxrankup
|
||||||
description: Rankup as much as possible.
|
description: Rankup as much as possible.
|
||||||
ranksgui:
|
|
||||||
description: Show the ranks GUI
|
|
||||||
permissions:
|
permissions:
|
||||||
rankup.*:
|
rankup.*:
|
||||||
children:
|
children:
|
||||||
|
|||||||
Reference in New Issue
Block a user