mirror of
https://github.com/2006-Scape/Parabot-317-API-Minified.git
synced 2026-07-07 08:39:13 +00:00
Added Inventory#clearExcept
This commit is contained in:
@@ -11,7 +11,7 @@ import java.util.ArrayList;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Everel
|
* @author Everel, JKetelaar, Fryslan
|
||||||
*/
|
*/
|
||||||
public class Inventory {
|
public class Inventory {
|
||||||
public static final int INVENTORY_INDEX = 3214;
|
public static final int INVENTORY_INDEX = 3214;
|
||||||
@@ -35,6 +35,16 @@ public class Inventory {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void clearExcept(int... ids) {
|
||||||
|
for (Item item : getItems()) {
|
||||||
|
for (int id : ids) {
|
||||||
|
if (item.getId() != id) {
|
||||||
|
item.drop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets inventory interface
|
* Gets inventory interface
|
||||||
*
|
*
|
||||||
@@ -196,13 +206,13 @@ public class Inventory {
|
|||||||
return Inventory.getCount() == 0;
|
return Inventory.getCount() == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean containts(int... id){
|
public static boolean containts(int... id) {
|
||||||
return getCount(id) > 0;
|
return getCount(id) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Item getItem(int id){
|
public static Item getItem(int id) {
|
||||||
for (Item i : getItems(id)){
|
for (Item i : getItems(id)) {
|
||||||
if (i != null){
|
if (i != null) {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user