Templates backfilled with modtable data

This commit is contained in:
2024-03-28 12:08:09 -04:00
parent 8e43f17da0
commit 230679cef9
6 changed files with 27 additions and 11 deletions
+18 -1
View File
@@ -193,9 +193,26 @@ public class dbItemHandler extends dbHandlerBase {
} catch (Exception e) {
Logger.error(e);
}
}
public void LOAD_TEMPLATE_MODTABLES() {
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_vendor_items`;");
ResultSet rs = preparedStatement.executeQuery()) {
while (rs.next()) {
int templateID = rs.getInt("templateID");
int modTable = rs.getInt("modTable");
ItemTemplate template = ItemTemplate.templates.get(templateID);
template.modTable = modTable;
}
} catch (Exception e) {
Logger.error(e);
}
}
public Item GET_ITEM(final int itemUUID) {
Item item;