Move the vendor mod table off the legacy item template
LOAD_TEMPLATE_MODTABLES now returns a templateID -> modTable map that ForgeManager owns (vendorModTables). ForgeManager.forgeItem, WorkOrder validation and the ManageNPCMsg forge item list read it through ForgeManager.getVendorModTable(), and ItemTemplate.modTable is removed. Values are unchanged: static_vendor_items has 5089 rows, one per templateID, all present in static_item_templates, modTable 0-30. Templates not in the table still read 0. The old loader stopped at the first templateID missing from ItemTemplate.templates; there are none. No comparator added or removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2b4c1a73d1
commit
70ea9b3bc9
6 files changed
+27
-20
No files matched your search
@@ -201,23 +201,23 @@ public class dbItemHandler extends dbHandlerBase {
|
||||
}
|
||||
}
|
||||
|
||||
public void LOAD_TEMPLATE_MODTABLES() {
|
||||
public HashMap<Integer, Integer> LOAD_TEMPLATE_MODTABLES() {
|
||||
|
||||
HashMap<Integer, Integer> modTables = new HashMap<>();
|
||||
|
||||
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;
|
||||
}
|
||||
while (rs.next())
|
||||
modTables.put(rs.getInt("templateID"), rs.getInt("modTable"));
|
||||
|
||||
} catch (Exception e) {
|
||||
Logger.error(e);
|
||||
}
|
||||
|
||||
Logger.info("read: " + modTables.size());
|
||||
return modTables;
|
||||
}
|
||||
|
||||
public Item GET_ITEM(final int itemUUID) {
|
||||
|
||||
Reference in new issue
Block a user