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:
25
src/main/java/com/gmail/nossr50/util/ModChecks.java
Normal file
25
src/main/java/com/gmail/nossr50/util/ModChecks.java
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user