Added item interaction with stringsi.interact(use); - as example

This commit is contained in:
JKetelaar
2014-10-29 09:36:49 +01:00
parent 15f9420f5c
commit a42658da67
3 changed files with 33 additions and 1 deletions
+19
View File
@@ -167,6 +167,25 @@ public class Menu {
sendAction(actionId, item.getSlot(), item.getId(), 3214);
}
public static void interact(Item item, String action){
int actionId = 447;
switch (action.toLowerCase()){
case "use":
actionId = 447;
break;
case "drop":
actionId = 847;
break;
case "examine":
actionId = 1125;
break;
case "cancel":
actionId = 1107;
break;
}
sendAction(actionId, item.getSlot(), item.getId(), 3214);
}
/**
* Drops an item
*
+1 -1
View File
@@ -3,7 +3,7 @@ package org.rev317.min.api.methods;
import org.rev317.min.Loader;
/**
* @author Dane
* @author Dane, JKetelaar
*/
public enum Skill {
+13
View File
@@ -58,6 +58,19 @@ public class Item {
Menu.interact(this, i);
}
/**
* Interacts with this item
* @param s
*/
public void interact(String s){
Menu.interact(this, s);
}
/**
*
* @param actionIndex
* @param interfaceParentId
*/
public void transform(int actionIndex, int interfaceParentId) {
Menu.transformItem(this, actionIndex, interfaceParentId);
}