The problem is at SpawnTable.java
Line 320:
final PreparedStatement statement = con.prepareStatement("DELETE FROM " + (Config.SAVE_GMSPAWN_ON_CUSTOM ? "custom_spawnlist" : "spawnlist") + " WHERE id=?");
I have SAVE_GMSPAWN_ON_CUSTOM = True in my configs because I want new spawns to be inserted into the custom_spawnlist table. However, I still want to be able to delete all NPC, custom or not.
Maybe this fixes the problem:
Changing this:
try (Connection con = DatabaseFactory.getConnection())
{
final PreparedStatement statement = con.prepareStatement("DELETE FROM " + (Config.SAVE_GMSPAWN_ON_CUSTOM ? "custom_spawnlist" : "spawnlist") + " WHERE id=?");
statement.setInt(1, spawn.getId());
statement.execute();
statement.close();
}
To this:
try (Connection con = DatabaseFactory.getConnection())
{
PreparedStatement statement;
statement = con.prepareStatement("DELETE FROM custom_spawnlist WHERE id=?");
statement.setInt(1, spawn.getId());
statement.execute();
statement.close();
statement = con.prepareStatement("DELETE FROM spawnlist WHERE id=?");
statement.setInt(1, spawn.getId());
statement.execute();
statement.close();
}