Config:
- Added default return value to getDurability in case of an exception due to this causing a crash when gathering data.
This commit is contained in:
@ -53,7 +53,7 @@ public final class Config {
|
|||||||
private final ForgeConfigSpec.BooleanValue CAN_REVIVE_ACROSS_DIMENSIONS;
|
private final ForgeConfigSpec.BooleanValue CAN_REVIVE_ACROSS_DIMENSIONS;
|
||||||
private final ForgeConfigSpec.IntValue DURABILITY;
|
private final ForgeConfigSpec.IntValue DURABILITY;
|
||||||
|
|
||||||
TotemConfig(ForgeConfigSpec.Builder builder, String name, boolean isEnabled, int chargeCost,
|
public TotemConfig(ForgeConfigSpec.Builder builder, String name, boolean isEnabled, int chargeCost,
|
||||||
int chargeCostLimit, double chargeCostMultiplier, boolean canReviveMoreExpensiveTargets,
|
int chargeCostLimit, double chargeCostMultiplier, boolean canReviveMoreExpensiveTargets,
|
||||||
boolean canReviveAcrossDimensions, int durability) {
|
boolean canReviveAcrossDimensions, int durability) {
|
||||||
builder.push(name);
|
builder.push(name);
|
||||||
@ -90,6 +90,13 @@ public final class Config {
|
|||||||
public double getChargeCostMultiplier() { return CHARGE_COST_MULTIPLIER.get(); }
|
public double getChargeCostMultiplier() { return CHARGE_COST_MULTIPLIER.get(); }
|
||||||
public boolean getCanReviveMoreExpensiveTargets() { return CAN_REVIVE_MORE_EXPENSIVE_TARGETS.get(); }
|
public boolean getCanReviveMoreExpensiveTargets() { return CAN_REVIVE_MORE_EXPENSIVE_TARGETS.get(); }
|
||||||
public boolean getCanReviveAcrossDimensions() { return CAN_REVIVE_ACROSS_DIMENSIONS.get(); }
|
public boolean getCanReviveAcrossDimensions() { return CAN_REVIVE_ACROSS_DIMENSIONS.get(); }
|
||||||
public int getDurability() { return DURABILITY.get(); }
|
public int getDurability() {
|
||||||
|
try {
|
||||||
|
return DURABILITY.get();
|
||||||
|
} catch (IllegalStateException e) {
|
||||||
|
return 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user