diff --git a/src/engine/db/handlers/dbItemHandler.java b/src/engine/db/handlers/dbItemHandler.java index a7e2654b..3b241f74 100644 --- a/src/engine/db/handlers/dbItemHandler.java +++ b/src/engine/db/handlers/dbItemHandler.java @@ -565,4 +565,25 @@ public class dbItemHandler extends dbHandlerBase { return false; } } + + public boolean UPDATE_EQUIP_SLOT(Item item) { + + try (Connection connection = DbManager.getConnection(); + PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_item` SET `equipSlot`=? WHERE `UID` = ?")) { + + if (item.equipSlot.equals(Enum.EquipSlotType.NONE)) + preparedStatement.setString(1, ""); + else + preparedStatement.setString(1, item.equipSlot.name()); + + preparedStatement.setLong(2, item.getObjectUUID()); + + return (preparedStatement.executeUpdate() > 0); + + } catch (SQLException e) { + Logger.error(e); + return false; + } + } + }