Adds optional ability to reforge anvils #15
All checks were successful
EpicKnarvik97/Blacksmith/pipeline/head This commit looks good
All checks were successful
EpicKnarvik97/Blacksmith/pipeline/head This commit looks good
This commit is contained in:
@ -61,4 +61,17 @@ public final class ItemHelper {
|
||||
return reforgeAbleMaterials;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the given material is an anvil
|
||||
*
|
||||
* @param material <p>The material to check</p>
|
||||
* @param requireDamaged <p>Whether only a damaged anvil should count</p>
|
||||
* @return <p>True if the given material is an anvil</p>
|
||||
*/
|
||||
public static boolean isAnvil(Material material, boolean requireDamaged) {
|
||||
boolean isDamagedAnvil = material == Material.CHIPPED_ANVIL || material == Material.DAMAGED_ANVIL;
|
||||
boolean isAnvil = isDamagedAnvil || material == Material.ANVIL;
|
||||
return (requireDamaged && isDamagedAnvil) || (!requireDamaged && isAnvil);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user