Added fix for overflow block IDs

This commit is contained in:
Anuken
2018-04-09 10:30:15 -04:00
parent aa28c3a45b
commit 0cafa152bf
2 changed files with 8 additions and 2 deletions

View File

@@ -279,6 +279,12 @@ public class Block extends BaseBlock {
}
public static Block getByID(int id){
if(id < 0){
id += 256;
}
if(id >= blocks.size || id < 0){
throw new RuntimeException("No block with ID '" + id + "' found!");
}
return blocks.get(id);
}