Skip to content

Commit

Permalink
chore: add debugging for payment parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
Thatsmusic99 committed Jul 25, 2023
1 parent a62ebf1 commit 4c86ec9
Showing 1 changed file with 11 additions and 0 deletions.
Expand Up @@ -71,6 +71,14 @@ private Payment parsePayment(String rawPayment) {
if (matcher.matches()) {
String plugin = matcher.group(1);
double payment = Double.parseDouble(matcher.group(2));

CoreClass.debug("Split payment into two, part 1: " + plugin + ", part two: " + payment);
CoreClass.debug("Material: " + Material.getMaterial(plugin == null ? "" : plugin);

// If it's not a plugin and actually an item, lmao
if (plugin != null && Material.getMaterial(plugin) != null) {
return ItemsPayment.getFromString(rawPayment);
}
return new VaultPayment(
payment, plugin == null ? null : plugin.substring(0, plugin.length() - 1));
}
Expand All @@ -87,6 +95,9 @@ private Payment parsePayment(String rawPayment) {
String plugin = matcher.group(1);
double payment = Double.parseDouble(matcher.group(2));

CoreClass.debug("Split payment into two, part 1: " + plugin + ", part two: " + payment);
CoreClass.debug("Material: " + Material.getMaterial(plugin == null ? "" : plugin);

// If it's not a plugin and actually an item, lmao
if (plugin != null && Material.getMaterial(plugin) != null) {
return ItemsPayment.getFromString(rawPayment);
Expand Down

0 comments on commit 4c86ec9

Please sign in to comment.