This commit is contained in:
AjMac 2024-05-10 01:05:21 +00:00 committed by GitHub
commit d40e608ea3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 19 additions and 6 deletions

View File

@ -45,25 +45,28 @@ public class Commandpay extends EssentialsLoopCommand {
}
BigDecimal tempAmount = new BigDecimal(sanitizedString);
switch (Character.toLowerCase(ogStr.charAt(ogStr.length() - 1))) {
case 'k': {
switch (ogStr.replace(sanitizedString, "")) {
case "": {
break;
}
case "k": {
tempAmount = tempAmount.multiply(THOUSAND);
break;
}
case 'm': {
case "m": {
tempAmount = tempAmount.multiply(MILLION);
break;
}
case 'b': {
case "b": {
tempAmount = tempAmount.multiply(BILLION);
break;
}
case 't': {
case "t": {
tempAmount = tempAmount.multiply(TRILLION);
break;
}
default: {
break;
throw new InvalidModifierException();
}
}

View File

@ -0,0 +1,9 @@
package com.earth2me.essentials.commands;
import net.ess3.api.TranslatableException;
public class InvalidModifierException extends TranslatableException {
public InvalidModifierException() {
super("invalidModifier");
}
}

View File

@ -548,6 +548,7 @@ invalidHome=<dark_red>Home<secondary> {0} <dark_red>doesn''t exist\!
invalidHomeName=<dark_red>Invalid home name\!
invalidItemFlagMeta=<dark_red>Invalid itemflag meta\: <secondary>{0}<dark_red>.
invalidMob=<dark_red>Invalid mob type.
invalidModifier=<dark_red>Invalid Modifier.
invalidNumber=Invalid Number.
invalidPotion=<dark_red>Invalid Potion.
invalidPotionMeta=<dark_red>Invalid potion meta\: <secondary>{0}<dark_red>.