Catches a potential error when starting a new session
This commit is contained in:
parent
f5bfbfd4f8
commit
90d3c49c12
@ -94,7 +94,12 @@ public class BlacksmithTrait extends CustomTrait<BlacksmithSetting> {
|
||||
|
||||
//Start a new reforge session for the player
|
||||
currentSessionStartTime = System.currentTimeMillis();
|
||||
try {
|
||||
session = new ReforgeSession(this, player, npc, config);
|
||||
} catch (IllegalArgumentException exception) {
|
||||
BlacksmithPlugin.error(exception.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
//Tell the player the cost of repairing the item
|
||||
String cost = EconomyManager.formatBlacksmithCost(player);
|
||||
|
@ -109,8 +109,13 @@ public class ScrapperTrait extends CustomTrait<ScrapperSetting> {
|
||||
|
||||
//Start a new scrapper session for the player
|
||||
currentSessionStartTime = System.currentTimeMillis();
|
||||
try {
|
||||
session = new SalvageSession(this, player, npc, getSettings(), result.salvage(),
|
||||
result.salvageMethod(), result.requiredAmount());
|
||||
} catch (IllegalArgumentException exception) {
|
||||
BlacksmithPlugin.error(exception.getMessage());
|
||||
return;
|
||||
}
|
||||
// Print the cost to the player
|
||||
printCostMessage(player, itemInHand, EconomyManager.formatSalvageCost(result.salvageMethod()),
|
||||
result.salvageMethod());
|
||||
|
Loading…
x
Reference in New Issue
Block a user