Added negative id check to Material.getMaterial(int). Fixes BUKKIT-3414

Negative id values would try to access the array out of bounds and throw an java.lang.ArrayIndexOutOfBoundsException.

Adding a check for negative values fixes this issue, and makes the method behave as expected from the documentation.
I also updated the test case, to also check for negative out of bounds.

[BUKKIT-3414](https://bukkit.atlassian.net/browse/BUKKIT-3414)