It is great snippet, much better then osbots current dropAll method really
Here, have dropAllExcept so you don't have to ignore those 2 inventory slots.
public void dropAllExcept(String...blacklist) {
for(int i : VERTICAL_DROP){
if (getInventory().getItemInSlot(i) != null && getInventory().getItemInSlot(i).hasAction("Drop") && !getInventory().getItemInSlot(i).getName().equals(blacklist)) {
getInventory().interact(i, "Drop");
}
}
}