mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 19:24:44 +02:00
WIP on custom mod support - should now be able to repair custom tools at
an anvil.
This commit is contained in:
@ -7,6 +7,7 @@ import com.gmail.nossr50.config.mods.LoadCustomTools;
|
||||
|
||||
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 class ItemChecks {
|
||||
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 class ItemChecks {
|
||||
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 class ItemChecks {
|
||||
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 class ItemChecks {
|
||||
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 class ItemChecks {
|
||||
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 class ItemChecks {
|
||||
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.
|
||||
*
|
||||
|
Reference in New Issue
Block a user