Fixed canTotemAffordTarget returning true when it shouldn't. Added multiplier in the item tooltip.
This commit is contained in:
@ -104,9 +104,7 @@ public abstract class TotemItem extends Item {
|
||||
if (!isTotemFull(stack)) {
|
||||
return false;
|
||||
}
|
||||
if (isTotemFull(stack) && canReviveMoreExpensiveTargets(stack)) {
|
||||
return true;
|
||||
}
|
||||
return isTotemFull(stack) && canReviveMoreExpensiveTargets(stack);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -167,6 +165,7 @@ public abstract class TotemItem extends Item {
|
||||
int targetCost = getTargetCost(stack);
|
||||
int charge = getCharge(stack);
|
||||
int maxCharge = getMaxCharge(stack);
|
||||
double multiplier = getConfig(stack).getChargeCostMultiplier();
|
||||
|
||||
if (getConfig(stack).getIsEnabled()) {
|
||||
if (targetUUID == null) {
|
||||
@ -177,10 +176,10 @@ public abstract class TotemItem extends Item {
|
||||
tooltip.add(new StringTextComponent(""));
|
||||
if (!canTotemAffordTarget(stack)) {
|
||||
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 {
|
||||
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)) {
|
||||
tooltip.add(new StringTextComponent(TextFormatting.WHITE + "Can revive more expensive targets."));
|
||||
|
Reference in New Issue
Block a user