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

Custom tools - should now support enabling/disabling ability activation

per tool.
This commit is contained in:
GJ
2012-05-15 13:44:39 -04:00
parent 81ac4e8d01
commit 29ee8a035b
3 changed files with 72 additions and 7 deletions

View File

@@ -0,0 +1,25 @@
package com.gmail.nossr50.util;
import org.bukkit.inventory.ItemStack;
import com.gmail.nossr50.config.mods.LoadCustomTools;
import com.gmail.nossr50.datatypes.mods.CustomTool;
public class ModChecks {
/**
* Check if this custom tool can use abilities.
*
* @param item The custom item to check
* @return true if the tool can use abilities, false otherwise
*/
public static boolean toolAbilityEnabled(ItemStack item) {
for (CustomTool tool : LoadCustomTools.getInstance().customTools) {
if (tool.getItemID() == item.getTypeId()) {
return tool.isAbilityEnabled();
}
}
return false;
}
}