use of com.solinia.solinia.Models.SoliniaNPCMerchantEntry in project solinia3-core by mixxit.
the class SoliniaNPCMerchantFactory method AddNPCMerchantItem.
public static void AddNPCMerchantItem(int merchantid, int itemid) {
try {
ISoliniaNPCMerchant merchant = StateManager.getInstance().getConfigurationManager().getNPCMerchant(merchantid);
SoliniaNPCMerchantEntry merchantentry = new SoliniaNPCMerchantEntry();
int id = 1;
for (ISoliniaNPCMerchantEntry entry : merchant.getEntries()) {
if (entry.getId() > id)
id = entry.getId() + 1;
}
merchantentry.setId(id);
merchantentry.setMerchantid(merchantid);
merchantentry.setItemid(itemid);
StateManager.getInstance().getConfigurationManager().getNPCMerchant(merchantid).getEntries().add(merchantentry);
} catch (CoreStateInitException e) {
e.printStackTrace();
}
}
Aggregations