9
0
mirror of https://github.com/Xiao-MoMi/Custom-Nameplates.git synced 2025-12-30 04:09:12 +00:00
This commit is contained in:
XiaoMoMi
2023-07-27 01:04:21 +08:00
parent faea16e517
commit 568cb99cf1
7 changed files with 15 additions and 10 deletions

View File

@@ -50,8 +50,7 @@ public abstract class AbstractMainCommand implements TabExecutor {
return true;
}
return subCommand.onCommand(sender, argList.subList(1, argList.size()));
}
else {
} else {
AdventureUtils.sendMessage(sender, MessageManager.prefix + MessageManager.unavailableArgs);
return true;
}

View File

@@ -46,8 +46,7 @@ public class NameplatesListCommand extends AbstractSubCommand {
stringJoiner.add(availableNameplate);
}
AdventureUtils.playerMessage(player, MessageManager.prefix + MessageManager.np_available.replace("{Nameplates}", stringJoiner.toString()));
}
else {
} else {
AdventureUtils.playerMessage(player, MessageManager.prefix + MessageManager.np_haveNone);
}
return true;

View File

@@ -272,7 +272,7 @@ public class ChatBubblesManager extends Function {
for (int i = 0; i < split.length; i++) {
int finalI = i;
String finalBubble = bubble;
plugin.getScheduler().runTaskAsyncLater(() -> sendBubble(player, split[finalI], bubbleConfig, finalBubble), (long) i * coolDown / 50);
plugin.getScheduler().runTaskAsyncLater(() -> sendBubble(player, split[finalI], bubbleConfig, finalBubble), (long) i * (coolDown / 50) + 1);
}
}

View File

@@ -226,8 +226,15 @@ public class NameplatePlaceholders extends PlaceholderExpansion {
private String getVanilla(String param, Player player) {
VanillaHud vanillaHud = placeholderManager.getVanillaHud(param);
if (vanillaHud == null) return param + " NOT FOUND";
double current = Double.parseDouble(PlaceholderAPI.setPlaceholders(player, vanillaHud.papi()));
double max = Double.parseDouble(PlaceholderAPI.setPlaceholders(player, vanillaHud.max()));
double current;
double max;
try {
current= Double.parseDouble(PlaceholderAPI.setPlaceholders(player, vanillaHud.papi()));
max = Double.parseDouble(PlaceholderAPI.setPlaceholders(player, vanillaHud.max()));
} catch (NumberFormatException e) {
current = 1;
max = 1;
}
int point = (int) ((current / max) * 20);
int full_amount = point / 2;
int half_amount = point % 2;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@@ -20,7 +20,7 @@ messages:
not-exist-nameplates: '<white>This nameplate does not exist!</white>'
not-available-nameplates: '<white>This nameplate is currently not available!</white>'
available-nameplates: '<white>Available nameplates: {Nameplates}.</white>'
have-no-nameplates: '<white>You don''t have any nameplates yet'
have-no-nameplates: '<white>You don''t have any nameplate yet'
equip-bubbles: '<white>Successfully equipped chatting bubbles {Bubble}</white>'
force-equip-bubbles: '<white>Successfully equipped chatting bubbles {Bubbles}</white>'
@@ -29,4 +29,4 @@ messages:
not-exist-bubbles: '<white>This bubble does not exist!</white>'
not-available-bubbles: '<white>This bubble is currently not available!</white>'
available-bubbles: '<white>Available bubbles: {Bubbles}</white>'
have-no-bubbles: '<white>You don''t have any bubbles yet'
have-no-bubbles: '<white>You don''t have any bubble yet'