I guess people need to be yelled at for bad schematics

This commit is contained in:
Anuken
2021-11-02 10:39:22 -04:00
parent 00293d022c
commit bd30fee404

View File

@@ -511,6 +511,8 @@ public class Schematics implements Loadable{
try(DataInputStream stream = new DataInputStream(new InflaterInputStream(input))){
short width = stream.readShort(), height = stream.readShort();
if(width > 128 || height > 128) throw new IOException("Invalid schematic: Too large (max possible size is 128x128)");
StringMap map = new StringMap();
int tags = stream.readUnsignedByte();
for(int i = 0; i < tags; i++){
@@ -534,6 +536,9 @@ public class Schematics implements Loadable{
}
int total = stream.readInt();
if(total > 128 * 128) throw new IOException("Invalid schematic: Too many blocks.");
Seq<Stile> tiles = new Seq<>(total);
for(int i = 0; i < total; i++){
Block block = blocks.get(stream.readByte());