1
0
mirror of https://github.com/mcMMO-Dev/mcMMO.git synced 2026-02-19 02:12:58 +01:00

Custom tools - modify XP gain from breaking blocks on a per tool basis.

This commit is contained in:
GJ
2012-05-15 14:21:21 -04:00
parent 29ee8a035b
commit e9af0ebdc5
4 changed files with 28 additions and 2 deletions

View File

@@ -22,4 +22,20 @@ public class ModChecks {
return false;
}
/**
* Get the custom tool associated with an item.
*
* @param item The item to check
* @return the tool if it exists, null otherwise
*/
public static CustomTool getToolFromItemStack(ItemStack item) {
for (CustomTool tool : LoadCustomTools.getInstance().customTools) {
if (tool.getItemID() == item.getTypeId()) {
return tool;
}
}
return null;
}
}