@@ -7,6 +7,7 @@
public class ItemChecks {
private static Config configInstance = Config .getInstance ();
private static boolean customToolsEnabled = configInstance .getToolModsEnabled ();
/**
* Checks if the item is a sword.
@@ -24,7 +25,7 @@ public static boolean isSword(ItemStack is) {
return true ;
default :
if (configInstance . getToolModsEnabled () && LoadCustomTools .getInstance ().customSwordIDs .contains (is .getTypeId ())) {
if (customToolsEnabled && LoadCustomTools .getInstance ().customSwordIDs .contains (is .getTypeId ())) {
return true ;
}
else {
@@ -49,7 +50,7 @@ public static boolean isHoe(ItemStack is) {
return true ;
default :
if (configInstance . getToolModsEnabled () && LoadCustomTools .getInstance ().customHoeIDs .contains (is .getTypeId ())) {
if (customToolsEnabled && LoadCustomTools .getInstance ().customHoeIDs .contains (is .getTypeId ())) {
return true ;
}
else {
@@ -74,7 +75,7 @@ public static boolean isShovel(ItemStack is) {
return true ;
default :
if (configInstance . getToolModsEnabled () && LoadCustomTools .getInstance ().customShovelIDs .contains (is .getTypeId ())) {
if (customToolsEnabled && LoadCustomTools .getInstance ().customShovelIDs .contains (is .getTypeId ())) {
return true ;
}
else {
@@ -99,7 +100,7 @@ public static boolean isAxe(ItemStack is) {
return true ;
default :
if (configInstance . getToolModsEnabled () && LoadCustomTools .getInstance ().customAxeIDs .contains (is .getTypeId ())) {
if (customToolsEnabled && LoadCustomTools .getInstance ().customAxeIDs .contains (is .getTypeId ())) {
return true ;
}
else {
@@ -124,7 +125,7 @@ public static boolean isPickaxe(ItemStack is) {
return true ;
default :
if (configInstance . getToolModsEnabled () && LoadCustomTools .getInstance ().customPickaxeIDs .contains (is .getTypeId ())) {
if (customToolsEnabled && LoadCustomTools .getInstance ().customPickaxeIDs .contains (is .getTypeId ())) {
return true ;
}
else {
@@ -305,6 +306,21 @@ public static boolean isTool(ItemStack is) {
return isStoneTool (is ) || isWoodTool (is ) || isGoldTool (is ) || isIronTool (is ) || isDiamondTool (is ) || isStringTool (is );
}
/**
* Checks to see if an item is a custom tool.
*
* @param is Item to check
* @return true if the item is a custom tool, false otherwise
*/
public static boolean isCustomTool (ItemStack is ) {
if (customToolsEnabled && LoadCustomTools .getInstance ().customIDs .contains (is .getTypeId ())) {
return true ;
}
else {
return false ;
}
}
/**
* Checks to see if an item is a stone tool.
*