Fixed canTotemAffordTarget returning true when it shouldn't. Added multiplier in the item tooltip.

This commit is contained in:
2022-01-18 23:00:55 +00:00
parent bf92ccd455
commit fdbd055a70

View File

@ -104,9 +104,7 @@ public abstract class TotemItem extends Item {
if (!isTotemFull(stack)) { if (!isTotemFull(stack)) {
return false; return false;
} }
if (isTotemFull(stack) && canReviveMoreExpensiveTargets(stack)) { return isTotemFull(stack) && canReviveMoreExpensiveTargets(stack);
return true;
}
} }
return true; return true;
} }
@ -167,6 +165,7 @@ public abstract class TotemItem extends Item {
int targetCost = getTargetCost(stack); int targetCost = getTargetCost(stack);
int charge = getCharge(stack); int charge = getCharge(stack);
int maxCharge = getMaxCharge(stack); int maxCharge = getMaxCharge(stack);
double multiplier = getConfig(stack).getChargeCostMultiplier();
if (getConfig(stack).getIsEnabled()) { if (getConfig(stack).getIsEnabled()) {
if (targetUUID == null) { if (targetUUID == null) {
@ -177,10 +176,10 @@ public abstract class TotemItem extends Item {
tooltip.add(new StringTextComponent("")); tooltip.add(new StringTextComponent(""));
if (!canTotemAffordTarget(stack)) { if (!canTotemAffordTarget(stack)) {
tooltip.add(new StringTextComponent(TextFormatting.RED + "Charges: " + TextFormatting.DARK_RED + "(" + charge + "/" + targetCost + ") " + tooltip.add(new StringTextComponent(TextFormatting.RED + "Charges: " + TextFormatting.DARK_RED + "(" + charge + "/" + targetCost + ") " +
TextFormatting.RED + "[Max: " + TextFormatting.DARK_RED + maxCharge + TextFormatting.RED + "]")); TextFormatting.RED + "[Max: " + TextFormatting.DARK_RED + maxCharge + TextFormatting.RED + "] [Multi: " + TextFormatting.DARK_RED + multiplier + TextFormatting.RED + "]"));
} else { } else {
tooltip.add(new StringTextComponent(TextFormatting.WHITE + "Charges: " + TextFormatting.GRAY + "(" + charge + "/" + targetCost + ") " + tooltip.add(new StringTextComponent(TextFormatting.WHITE + "Charges: " + TextFormatting.GRAY + "(" + charge + "/" + targetCost + ") " +
TextFormatting.WHITE + "[Max: " + TextFormatting.GRAY + maxCharge + TextFormatting.WHITE + "]")); TextFormatting.WHITE + "[Max: " + TextFormatting.GRAY + maxCharge + TextFormatting.WHITE + "] [Multi: " + TextFormatting.GRAY + multiplier + TextFormatting.WHITE + "]"));
} }
if (canReviveMoreExpensiveTargets(stack)) { if (canReviveMoreExpensiveTargets(stack)) {
tooltip.add(new StringTextComponent(TextFormatting.WHITE + "Can revive more expensive targets.")); tooltip.add(new StringTextComponent(TextFormatting.WHITE + "Can revive more expensive targets."));