Added fix for overflow block IDs
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
#Autogenerated file. Do not modify.
|
#Autogenerated file. Do not modify.
|
||||||
#Sun Apr 08 21:39:05 EDT 2018
|
#Mon Apr 09 10:25:51 EDT 2018
|
||||||
version=release
|
version=release
|
||||||
androidBuildCode=889
|
androidBuildCode=891
|
||||||
name=Mindustry
|
name=Mindustry
|
||||||
code=3.5
|
code=3.5
|
||||||
build=custom build
|
build=custom build
|
||||||
|
|||||||
@@ -279,6 +279,12 @@ public class Block extends BaseBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Block getByID(int id){
|
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);
|
return blocks.get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user