Refactor of animations

This commit is contained in:
2024-03-11 15:44:31 -04:00
parent 4f7c34aec9
commit ef38e93c11
3 changed files with 18 additions and 71 deletions
@@ -26,34 +26,6 @@ public class dbItemBaseHandler extends dbHandlerBase {
}
public void LOAD_ANIMATIONS(ItemBase itemBase) {
ArrayList<Integer> tempList = new ArrayList<>();
ArrayList<Integer> tempListOff = new ArrayList<>();
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_itembase_animations` WHERE `itemBaseUUID` = ?")) {
preparedStatement.setInt(1, itemBase.getUUID());
ResultSet rs = preparedStatement.executeQuery();
while (rs.next()) {
int animation = rs.getInt("animation");
boolean rightHand = rs.getBoolean("rightHand");
if (rightHand)
tempList.add(animation);
else
tempListOff.add(animation);
}
} catch (SQLException e) {
Logger.error(e);
}
itemBase.setAnimations(tempList);
itemBase.setOffHandAnimations(tempListOff);
}
public void LOAD_ALL_ITEMBASES() {
ItemBase itemBase;