mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 19:24:44 +02:00
Custom tools - modify XP gain from breaking blocks on a per tool basis.
This commit is contained in:
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user