From 0cafa152bf6130860e16f030a909a8450c869519 Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 9 Apr 2018 10:30:15 -0400 Subject: [PATCH] Added fix for overflow block IDs --- core/assets/version.properties | 4 ++-- core/src/io/anuke/mindustry/world/Block.java | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/core/assets/version.properties b/core/assets/version.properties index cb025c0787..85f79a50d7 100644 --- a/core/assets/version.properties +++ b/core/assets/version.properties @@ -1,7 +1,7 @@ #Autogenerated file. Do not modify. -#Sun Apr 08 21:39:05 EDT 2018 +#Mon Apr 09 10:25:51 EDT 2018 version=release -androidBuildCode=889 +androidBuildCode=891 name=Mindustry code=3.5 build=custom build diff --git a/core/src/io/anuke/mindustry/world/Block.java b/core/src/io/anuke/mindustry/world/Block.java index 1398ece612..9dd930c7d4 100644 --- a/core/src/io/anuke/mindustry/world/Block.java +++ b/core/src/io/anuke/mindustry/world/Block.java @@ -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); }