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

@ -381,7 +381,6 @@ public class Combat {
damageAmount = 1;
}
//TODO: Looking at this, I think it's busted. Need to test to confirm.
for (Entity entity : target.getNearbyEntities(2.5, 2.5, 2.5)) {
if (!(entity instanceof LivingEntity)) {
continue;

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;
}
}